Class JobExecution

java.lang.Object
overit.geocall.scheduler.JobExecution
All Implemented Interfaces:
Serializable

public class JobExecution extends Object implements Serializable
Class about a job execution, useful for logging purposes.
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • start

      public void start()
      Starts the job execution using the provided system default Clock.
    • stop

      public void stop(Throwable exception)
      Stops the job execution using the provided Throwable.
      Parameters:
      exception - possible Throwable thrown during the job execution.
    • skip

      public void skip(Throwable exception)
    • cancel

      public void cancel()
    • getId

      public Long getId()
      Returns a Long about the ID.
      Returns:
      a Long about the ID.
    • setId

      public void setId(long id)
      Sets the id using the provided value.
      Parameters:
      id - long about the value to set.
    • setStart

      public void setStart(Instant start)
      Sets the start using the provided value.
      Parameters:
      start - Instant about the value to set.
    • setEnd

      public void setEnd(Instant end)
      Sets the end using the provided value.
      Parameters:
      end - Instant about the value to set.
    • setSubmitter

      public void setSubmitter(String submitter)
      Sets the submitter using the provided value.
      Parameters:
      submitter - String about the value to set.
    • setException

      public void setException(String exception)
      Sets the exception using the provided value.
      Parameters:
      exception - String about the value to set.
    • setState

      public void setState(JobExecution.State state)
      Sets the state using the provided value.
      Parameters:
      state - JobExecution.State about the value to set.
    • setTask

      public void setTask(Runnable task)
      Sets the task using the provided value.
      Parameters:
      task - Runnable about the value to set.
    • getJobId

      public String getJobId()
      Returns a String about the jobId.
      Returns:
      a String about the jobId.
    • getJobSource

      public String getJobSource()
      Returns a String about the jobSource.
      Returns:
      a String about the jobSource.
    • getDescription

      public String getDescription()
      Returns a String about the description.
      Returns:
      a String about the description.
    • getTask

      public Runnable getTask()
      Returns a Runnable about the task.
      Returns:
      a Runnable about the task.
    • getStart

      public Instant getStart()
      Returns a Instant about the start.
      Returns:
      a Instant about the start.
    • getEnd

      public Instant getEnd()
      Returns a Instant about the end.
      Returns:
      a Instant about the end.
    • getException

      public String getException()
      Returns a String about the exception.
      Returns:
      a String about the exception.
    • getState

      public JobExecution.State getState()
      Returns a JobExecution.State about the state.
      Returns:
      a JobExecution.State about the state.
    • getType

      public JobExecution.Type getType()
      Returns a JobExecution.Type about the type.
      Returns:
      a JobExecution.Type about the type.
    • getAgent

      public String getAgent()
      Returns a String about the agent.
      Returns:
      a String about the agent.
    • getCompany

      public Long getCompany()
      Returns a Long about the company.
      Returns:
      a Long about the company.
    • getSubmitter

      public String getSubmitter()
      Returns a String about the submitter.
      Returns:
      a String about the submitter.
    • toMap

      public HashMap<String,Object> toMap()
      Returns a HashMap<String, Object> about this JobExecution values.
      Returns:
      a HashMap<String, Object> about this JobExecution values.