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 allJobExecutions 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 lastJobExecutionto have been created for a givenJobInstance.voidsaveJobExecution(JobExecution jobExecution) Save a new JobExecution.voidsetJobExecutionIncrementer(org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer jobExecutionIncrementer) voidsynchronizeStatus(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.voidupdateJobExecution(JobExecution jobExecution) Update and existing JobExecution.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:JobExecutionDaoSave a new JobExecution.Preconditions: jobInstance the jobExecution belongs to must have a jobInstanceId.
- Specified by:
saveJobExecutionin interfaceJobExecutionDao- Parameters:
jobExecution-JobExecutioninstance to be saved.
-
updateJobExecution
Description copied from interface:JobExecutionDaoUpdate and existing JobExecution.Preconditions: jobExecution must have an Id (which can be obtained by the save method) and a jobInstanceId.
- Specified by:
updateJobExecutionin interfaceJobExecutionDao- Parameters:
jobExecution-JobExecutioninstance to be updated.
-
findJobExecutions
Description copied from interface:JobExecutionDaoReturn allJobExecutions for givenJobInstance, sorted backwards by creation order (so the first element is the most recent).- Specified by:
findJobExecutionsin interfaceJobExecutionDao- Parameters:
jobInstance- parentJobInstanceof theJobExecutions to find.- Returns:
Listcontaining JobExecutions for the jobInstance.
-
getLastJobExecution
Description copied from interface:JobExecutionDaoFind the lastJobExecutionto have been created for a givenJobInstance.- Specified by:
getLastJobExecutionin interfaceJobExecutionDao- Parameters:
jobInstance- theJobInstance- Returns:
- the last
JobExecutionto execute for this instance ornullif no job execution is found for the given job instance.
-
findRunningJobExecutions
- Specified by:
findRunningJobExecutionsin interfaceJobExecutionDao- Parameters:
jobName-Stringcontaining the name of the job.- Returns:
- all
JobExecutionthat are still running (or indeterminate state), i.e. having null end date, for the specified job name.
-
getJobExecution
- Specified by:
getJobExecutionin interfaceJobExecutionDao- Parameters:
executionId-Longcontaining the id of the execution.- Returns:
- the
JobExecutionfor given identifier.
-
synchronizeStatus
Description copied from interface:JobExecutionDaoBecause 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:
synchronizeStatusin interfaceJobExecutionDao- Parameters:
jobExecution- to be updated.
-