Class MongoJobExecutionDao
java.lang.Object
org.springframework.batch.core.repository.dao.MongoJobExecutionDao
- All Implemented Interfaces:
JobExecutionDao
- Since:
- 5.2.0
- Author:
- Mahmoud Ben Hassine
-
Constructor Summary
ConstructorsConstructorDescriptionMongoJobExecutionDao
(org.springframework.data.mongodb.core.MongoOperations mongoOperations) -
Method Summary
Modifier and TypeMethodDescriptionfindJobExecutions
(JobInstance jobInstance) Return allJobExecution
s for givenJobInstance
, sorted backwards by creation order (so the first element is the most recent).findRunningJobExecutions
(String jobName) getJobExecution
(Long executionId) getLastJobExecution
(JobInstance jobInstance) Find the lastJobExecution
to have been created for a givenJobInstance
.void
saveJobExecution
(JobExecution jobExecution) Save a new JobExecution.void
setJobExecutionIncrementer
(org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer jobExecutionIncrementer) void
synchronizeStatus
(JobExecution jobExecution) Because it may be possible that the status of a JobExecution is updated while running, the following method will synchronize only the status and version fields.void
updateJobExecution
(JobExecution jobExecution) Update and existing JobExecution.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.batch.core.repository.dao.JobExecutionDao
deleteJobExecution, deleteJobExecutionParameters
-
Constructor Details
-
MongoJobExecutionDao
public MongoJobExecutionDao(org.springframework.data.mongodb.core.MongoOperations mongoOperations)
-
-
Method Details
-
setJobExecutionIncrementer
public void setJobExecutionIncrementer(org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer jobExecutionIncrementer) -
saveJobExecution
Description copied from interface:JobExecutionDao
Save a new JobExecution.Preconditions: jobInstance the jobExecution belongs to must have a jobInstanceId.
- Specified by:
saveJobExecution
in interfaceJobExecutionDao
- Parameters:
jobExecution
-JobExecution
instance to be saved.
-
updateJobExecution
Description copied from interface:JobExecutionDao
Update and existing JobExecution.Preconditions: jobExecution must have an Id (which can be obtained by the save method) and a jobInstanceId.
- Specified by:
updateJobExecution
in interfaceJobExecutionDao
- Parameters:
jobExecution
-JobExecution
instance to be updated.
-
findJobExecutions
Description copied from interface:JobExecutionDao
Return allJobExecution
s for givenJobInstance
, sorted backwards by creation order (so the first element is the most recent).- Specified by:
findJobExecutions
in interfaceJobExecutionDao
- Parameters:
jobInstance
- parentJobInstance
of theJobExecution
s to find.- Returns:
List
containing JobExecutions for the jobInstance.
-
getLastJobExecution
Description copied from interface:JobExecutionDao
Find the lastJobExecution
to have been created for a givenJobInstance
.- Specified by:
getLastJobExecution
in interfaceJobExecutionDao
- Parameters:
jobInstance
- theJobInstance
- Returns:
- the last
JobExecution
to execute for this instance ornull
if no job execution is found for the given job instance.
-
findRunningJobExecutions
- Specified by:
findRunningJobExecutions
in interfaceJobExecutionDao
- Parameters:
jobName
-String
containing the name of the job.- Returns:
- all
JobExecution
that are still running (or indeterminate state), i.e. having null end date, for the specified job name.
-
getJobExecution
- Specified by:
getJobExecution
in interfaceJobExecutionDao
- Parameters:
executionId
-Long
containing the id of the execution.- Returns:
- the
JobExecution
for given identifier.
-
synchronizeStatus
Description copied from interface:JobExecutionDao
Because it may be possible that the status of a JobExecution is updated while running, the following method will synchronize only the status and version fields.- Specified by:
synchronizeStatus
in interfaceJobExecutionDao
- Parameters:
jobExecution
- to be updated.
-