Interface JobExecutionDao

All Known Implementing Classes:
JdbcJobExecutionDao

public interface JobExecutionDao
Data Access Object for job executions.
Author:
Lucas Ward, Robert Kasanicky, Mahmoud Ben Hassine
  • Method Details

    • saveJobExecution

      void saveJobExecution(JobExecution jobExecution)
      Save a new JobExecution.

      Preconditions: jobInstance the jobExecution belongs to must have a jobInstanceId.

      Parameters:
      jobExecution - JobExecution instance to be saved.
    • 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 - JobExecution instance to be updated.
    • findJobExecutions

      List<JobExecution> findJobExecutions(JobInstance jobInstance)
      Return all JobExecutions for given JobInstance, sorted backwards by creation order (so the first element is the most recent).
      Parameters:
      jobInstance - parent JobInstance of the JobExecutions to find.
      Returns:
      List containing JobExecutions for the jobInstance.
    • getLastJobExecution

      @Nullable 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 or null if no job execution is found for the given job instance.
    • findRunningJobExecutions

      Set<JobExecution> findRunningJobExecutions(String jobName)
      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

      @Nullable JobExecution getJobExecution(Long executionId)
      Parameters:
      executionId - Long containing the id of the execution.
      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.
    • deleteJobExecution

      default void deleteJobExecution(JobExecution jobExecution)
      Delete the given job execution.
      Parameters:
      jobExecution - the job execution to delete
      Since:
      5.0
    • deleteJobExecutionParameters

      default void deleteJobExecutionParameters(JobExecution jobExecution)
      Delete the parameters associated with the given job execution.
      Parameters:
      jobExecution - the job execution for which job parameters should be deleted
      Since:
      5.0