org.springframework.batch.core.repository.dao
Interface JobExecutionDao

All Known Implementing Classes:
JdbcJobExecutionDao, MapJobExecutionDao

public interface JobExecutionDao

Data Access Object for job executions.

Author:
Lucas Ward, Robert Kasanicky

Method Summary
 List<JobExecution> findJobExecutions(JobInstance jobInstance)
          Return all JobExecution for given JobInstance, sorted backwards by creation order (so the first element is the most recent).
 Set<JobExecution> findRunningJobExecutions(String jobName)
           
 JobExecution getJobExecution(Long executionId)
           
 JobExecution getLastJobExecution(JobInstance jobInstance)
          Find the last JobExecution to have been created for a given JobInstance.
 void saveJobExecution(JobExecution jobExecution)
          Save a new JobExecution.
 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.
 

Method Detail

saveJobExecution

void saveJobExecution(JobExecution jobExecution)
Save a new JobExecution. Preconditions: jobInstance the jobExecution belongs to must have a jobInstanceId.

Parameters:
jobExecution -

updateJobExecution

void updateJobExecution(JobExecution jobExecution)
Update and existing JobExecution. Preconditions: jobExecution must have an Id (which can be obtained by the save method) and a jobInstanceId.

Parameters:
jobExecution -

findJobExecutions

List<JobExecution> findJobExecutions(JobInstance jobInstance)
Return all JobExecution for given JobInstance, sorted backwards by creation order (so the first element is the most recent).


getLastJobExecution

JobExecution getLastJobExecution(JobInstance jobInstance)
Find the last JobExecution to have been created for a given JobInstance.

Parameters:
jobInstance - the JobInstance
Returns:
the last JobExecution to execute for this instance

findRunningJobExecutions

Set<JobExecution> findRunningJobExecutions(String jobName)
Returns:
all JobExecution that are still running (or indeterminate state), i.e. having null end date, for the specified job name.

getJobExecution

JobExecution getJobExecution(Long executionId)
Returns:
the JobExecution for given identifier.

synchronizeStatus

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.

Parameters:
jobExecution - to be updated.


Copyright © 2013 SpringSource. All Rights Reserved.