@ThreadSafe
public interface ExecutionContext
Modifier and Type | Method and Description |
---|---|
void |
addCleanupActions(StateAction stateAction)
Enqueue cleanup for a state action.
|
void |
addStateActionError(States state,
java.lang.Class<? extends org.springframework.statemachine.action.Action> actionClass,
java.lang.Exception exception)
Record a state action failure to execute and threw an exception.
|
java.util.Optional<java.lang.String> |
getClaimedJobId()
Get the job id, if a job was claimed.
|
java.util.List<StateAction> |
getCleanupActions()
Get the queue of states visited for the purpose of tracking post-job cleanup execution.
|
java.util.Optional<JobStatus> |
getCurrentJobStatus()
Get the current job status.
|
java.util.Optional<JobStatus> |
getFinalJobStatus()
Get the job status, if one was set.
|
java.util.Optional<java.io.File> |
getJobDirectory()
Get the job run directory.
|
java.util.Optional<java.util.Map<java.lang.String,java.lang.String>> |
getJobEnvironment()
Get the environment variables map for the job process.
|
java.util.Optional<JobSpecification> |
getJobSpecification()
Get the job specification.
|
java.util.List<org.apache.commons.lang3.tuple.Triple<States,java.lang.Class<? extends org.springframework.statemachine.action.Action>,java.lang.Exception>> |
getStateActionErrors()
Get the list of state actions that failed during execution, if any.
|
boolean |
hasStateActionError()
Whether any state action executed so far failed.
|
void |
setClaimedJobId(@NotBlank java.lang.String jobId)
Set the job id of a successfully claimed job.
|
void |
setCurrentJobStatus(JobStatus jobStatus)
Set the current job status.
|
void |
setFinalJobStatus(JobStatus jobStatus)
Set the job status.
|
void |
setJobDirectory(java.io.File jobDirectory)
Set the job directory.
|
void |
setJobEnvironment(java.util.Map<java.lang.String,java.lang.String> jobEnvironment)
Set the job environment variables map.
|
void |
setJobSpecification(JobSpecification jobSpecification)
Set the job specification.
|
java.util.Optional<java.io.File> getJobDirectory()
void setJobDirectory(java.io.File jobDirectory)
jobDirectory
- the job directoryjava.util.Optional<JobSpecification> getJobSpecification()
void setJobSpecification(JobSpecification jobSpecification)
jobSpecification
- the job specificationjava.util.Optional<java.util.Map<java.lang.String,java.lang.String>> getJobEnvironment()
void setJobEnvironment(java.util.Map<java.lang.String,java.lang.String> jobEnvironment)
jobEnvironment
- a map of environment variables and their value to be passed to the job process at launchvoid addCleanupActions(StateAction stateAction)
stateAction
- the action that needs cleanupjava.util.List<StateAction> getCleanupActions()
void addStateActionError(States state, java.lang.Class<? extends org.springframework.statemachine.action.Action> actionClass, java.lang.Exception exception)
state
- the state whose action failed with an exceptionactionClass
- the class of the state action that failedexception
- the exception thrown by the state actionboolean hasStateActionError()
java.util.List<org.apache.commons.lang3.tuple.Triple<States,java.lang.Class<? extends org.springframework.statemachine.action.Action>,java.lang.Exception>> getStateActionErrors()
java.util.Optional<JobStatus> getFinalJobStatus()
void setFinalJobStatus(JobStatus jobStatus)
jobStatus
- the job statusjava.util.Optional<JobStatus> getCurrentJobStatus()
void setCurrentJobStatus(JobStatus jobStatus)
jobStatus
- the job statusjava.util.Optional<java.lang.String> getClaimedJobId()
void setClaimedJobId(@NotBlank @NotBlank java.lang.String jobId)
jobId
- the job id