Package overit.geocall.scheduler
Class JobExecution
java.lang.Object
overit.geocall.scheduler.JobExecution
- All Implemented Interfaces:
Serializable
Class about a job execution, useful for logging purposes.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnum about possibleJobExecutionrunning states.static enumEnum about possibleJobExecutionstates.static enum -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJobExecution(String jobId, String jobSource, String description, Runnable task, String agent, Long company, JobExecution.Type type) JobExecution(@NotNull Map<String, Object> map) Creates a newJobExecutioninstance using the providedMap<String, Object> instance.JobExecution(@NotNull Job job) Creates a newJobExecutioninstance using the providedJobinstance. -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()getAgent()Returns aStringabout theagent.Returns aLongabout thecompany.Returns aStringabout thedescription.getEnd()Returns aInstantabout theend.Returns aStringabout theexception.getId()Returns aLongabout the ID.getJobId()Returns aStringabout thejobId.Returns aStringabout thejobSource.getStart()Returns aInstantabout thestart.getState()Returns aJobExecution.Stateabout thestate.Returns aStringabout thesubmitter.getTask()Returns aRunnableabout thetask.getType()Returns aJobExecution.Typeabout thetype.voidSets theendusing the provided value.voidsetException(String exception) Sets theexceptionusing the provided value.voidsetId(long id) Sets theidusing the provided value.voidSets thestartusing the provided value.voidsetState(JobExecution.State state) Sets thestateusing the provided value.voidsetSubmitter(String submitter) Sets thesubmitterusing the provided value.voidSets thetaskusing the provided value.voidvoidstart()Starts the job execution using the provided system defaultClock.voidStops the job execution using the providedThrowable.toMap()Returns aHashMap<String, Object> about thisJobExecutionvalues.
-
Field Details
-
LOG
-
-
Constructor Details
-
JobExecution
Creates a newJobExecutioninstance using the providedJobinstance.- Parameters:
job-Jobuseful to create the returnedJobExecutioninstance.
-
JobExecution
-
JobExecution
Creates a newJobExecutioninstance using the providedMap<String, Object> instance.- Parameters:
map-Map<String, Object> useful to create the returnedJobExecutioninstance.
-
-
Method Details
-
start
public void start()Starts the job execution using the provided system defaultClock. -
stop
Stops the job execution using the providedThrowable.- Parameters:
exception- possibleThrowablethrown during the job execution.
-
skip
-
cancel
public void cancel() -
getId
Returns aLongabout the ID.- Returns:
- a
Longabout the ID.
-
setId
public void setId(long id) Sets theidusing the provided value.- Parameters:
id- long about the value to set.
-
setStart
Sets thestartusing the provided value.- Parameters:
start-Instantabout the value to set.
-
setEnd
Sets theendusing the provided value.- Parameters:
end-Instantabout the value to set.
-
setSubmitter
Sets thesubmitterusing the provided value.- Parameters:
submitter-Stringabout the value to set.
-
setException
Sets theexceptionusing the provided value.- Parameters:
exception-Stringabout the value to set.
-
setState
Sets thestateusing the provided value.- Parameters:
state-JobExecution.Stateabout the value to set.
-
setTask
Sets thetaskusing the provided value.- Parameters:
task-Runnableabout the value to set.
-
getJobId
Returns aStringabout thejobId.- Returns:
- a
Stringabout thejobId.
-
getJobSource
Returns aStringabout thejobSource.- Returns:
- a
Stringabout thejobSource.
-
getDescription
Returns aStringabout thedescription.- Returns:
- a
Stringabout thedescription.
-
getTask
Returns aRunnableabout thetask.- Returns:
- a
Runnableabout thetask.
-
getStart
Returns aInstantabout thestart.- Returns:
- a
Instantabout thestart.
-
getEnd
Returns aInstantabout theend.- Returns:
- a
Instantabout theend.
-
getException
Returns aStringabout theexception.- Returns:
- a
Stringabout theexception.
-
getState
Returns aJobExecution.Stateabout thestate.- Returns:
- a
JobExecution.Stateabout thestate.
-
getType
Returns aJobExecution.Typeabout thetype.- Returns:
- a
JobExecution.Typeabout thetype.
-
getAgent
Returns aStringabout theagent.- Returns:
- a
Stringabout theagent.
-
getCompany
Returns aLongabout thecompany.- Returns:
- a
Longabout thecompany.
-
getSubmitter
Returns aStringabout thesubmitter.- Returns:
- a
Stringabout thesubmitter.
-
toMap
Returns aHashMap<String, Object> about thisJobExecutionvalues.- Returns:
- a
HashMap<String, Object> about thisJobExecutionvalues.
-