Class JdbcSearchableJobExecutionDao

java.lang.Object
org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao
org.springframework.batch.core.repository.dao.JdbcJobExecutionDao
org.springframework.cloud.dataflow.server.batch.JdbcSearchableJobExecutionDao
All Implemented Interfaces:
org.springframework.batch.core.repository.dao.JobExecutionDao, InitializingBean, SearchableJobExecutionDao

public class JdbcSearchableJobExecutionDao extends org.springframework.batch.core.repository.dao.JdbcJobExecutionDao implements SearchableJobExecutionDao
Author:
Dave Syer, Michael Minella, Glenn Renfro, Corneil du Plessis
  • Constructor Details

    • JdbcSearchableJobExecutionDao

      public JdbcSearchableJobExecutionDao()
  • Method Details

    • setDataSource

      public void setDataSource(DataSource dataSource)
      Parameters:
      dataSource - the dataSource to set
    • setTaskTablePrefix

      public void setTaskTablePrefix(String taskTablePrefix)
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface InitializingBean
      Overrides:
      afterPropertiesSet in class org.springframework.batch.core.repository.dao.JdbcJobExecutionDao
      Throws:
      Exception
      See Also:
      • JdbcJobExecutionDao.afterPropertiesSet()
    • getTaskQuery

      protected String getTaskQuery(String base)
    • findJobExecutions

      public List<org.springframework.batch.core.JobExecution> findJobExecutions(org.springframework.batch.core.JobInstance job)
      Specified by:
      findJobExecutions in interface org.springframework.batch.core.repository.dao.JobExecutionDao
      Overrides:
      findJobExecutions in class org.springframework.batch.core.repository.dao.JdbcJobExecutionDao
    • getLastJobExecution

      public org.springframework.batch.core.JobExecution getLastJobExecution(org.springframework.batch.core.JobInstance jobInstance)
      Specified by:
      getLastJobExecution in interface org.springframework.batch.core.repository.dao.JobExecutionDao
      Overrides:
      getLastJobExecution in class org.springframework.batch.core.repository.dao.JdbcJobExecutionDao
    • findRunningJobExecutions

      public Set<org.springframework.batch.core.JobExecution> findRunningJobExecutions(String jobName)
      Specified by:
      findRunningJobExecutions in interface org.springframework.batch.core.repository.dao.JobExecutionDao
      Overrides:
      findRunningJobExecutions in class org.springframework.batch.core.repository.dao.JdbcJobExecutionDao
    • getJobExecution

      public org.springframework.batch.core.JobExecution getJobExecution(Long executionId)
      Specified by:
      getJobExecution in interface org.springframework.batch.core.repository.dao.JobExecutionDao
      Overrides:
      getJobExecution in class org.springframework.batch.core.repository.dao.JdbcJobExecutionDao
    • countJobExecutions

      public int countJobExecutions()
      Specified by:
      countJobExecutions in interface SearchableJobExecutionDao
      Returns:
      the total number of JobExecution instances
      See Also:
    • countJobExecutions

      public int countJobExecutions(String jobName)
      Description copied from interface: SearchableJobExecutionDao
      Gets count of job executions.
      Specified by:
      countJobExecutions in interface SearchableJobExecutionDao
      Parameters:
      jobName - the name of a job
      Returns:
      the number of JobExecutions belonging to this job
      See Also:
    • countJobExecutions

      public int countJobExecutions(org.springframework.batch.core.BatchStatus status)
      Description copied from interface: SearchableJobExecutionDao
      Gets count of job executions.
      Specified by:
      countJobExecutions in interface SearchableJobExecutionDao
      Parameters:
      status - the job status
      Returns:
      the number of JobExecutions belonging to this job
      See Also:
    • countJobExecutions

      public int countJobExecutions(String jobName, org.springframework.batch.core.BatchStatus status)
      Description copied from interface: SearchableJobExecutionDao
      Gets count of job executions.
      Specified by:
      countJobExecutions in interface SearchableJobExecutionDao
      Parameters:
      jobName - the name of a job
      status - the job status
      Returns:
      the number of JobExecutions belonging to this job
      See Also:
    • getJobExecutionsWithStepCount

      public List<JobExecutionWithStepCount> getJobExecutionsWithStepCount(Date fromDate, Date toDate, int start, int count)
      Description copied from interface: SearchableJobExecutionDao
      Get the JobExecutions for a specific date range in reverse order of creation (so normally of execution).
      Specified by:
      getJobExecutionsWithStepCount in interface SearchableJobExecutionDao
      Parameters:
      fromDate - the date which start date must be greater than.
      toDate - the date which start date must be less than.
      start - the start index of the instances
      count - the maximum number of instances to return
      Returns:
      the JobExecutionWithStepCount instances requested
      See Also:
    • getJobExecutionsWithStepCountFilteredByJobInstanceId

      public List<JobExecutionWithStepCount> getJobExecutionsWithStepCountFilteredByJobInstanceId(int jobInstanceId, int start, int count)
      Description copied from interface: SearchableJobExecutionDao
      Get the JobExecutions for a specific job instance id in reverse order of creation (so normally of execution).
      Specified by:
      getJobExecutionsWithStepCountFilteredByJobInstanceId in interface SearchableJobExecutionDao
      Parameters:
      jobInstanceId - the job instance id associated with the execution.
      start - the start index of the instances
      count - the maximum number of instances to return
      Returns:
      the JobExecutionWithStepCount instances requested
    • getJobExecutionsWithStepCountFilteredByTaskExecutionId

      public List<JobExecutionWithStepCount> getJobExecutionsWithStepCountFilteredByTaskExecutionId(int taskExecutionId, int start, int count)
      Description copied from interface: SearchableJobExecutionDao
      Get the JobExecutions for a specific task execution id in reverse order of creation (so normally of execution).
      Specified by:
      getJobExecutionsWithStepCountFilteredByTaskExecutionId in interface SearchableJobExecutionDao
      Parameters:
      taskExecutionId - the task execution id associated with the execution.
      start - the start index of the instances
      count - the maximum number of instances to return
      Returns:
      the JobExecutionWithStepCount instances requested
    • getRunningJobExecutions

      public Collection<org.springframework.batch.core.JobExecution> getRunningJobExecutions()
      Description copied from interface: SearchableJobExecutionDao
      Find all the running executions (status less than STOPPING).
      Specified by:
      getRunningJobExecutions in interface SearchableJobExecutionDao
      Returns:
      all the JobExecution instances that are currently running
      See Also:
    • getJobExecutions

      public List<org.springframework.batch.core.JobExecution> getJobExecutions(String jobName, org.springframework.batch.core.BatchStatus status, int start, int count)
      Description copied from interface: SearchableJobExecutionDao
      Get the JobExecutions for a specific job name in reverse order of creation (so normally of execution).
      Specified by:
      getJobExecutions in interface SearchableJobExecutionDao
      Parameters:
      jobName - the name of the job
      status - the status of the job
      start - the start index of the instances
      count - the maximum number of instances to return
      Returns:
      the JobExecution instances requested
      See Also:
    • getJobExecutions

      public List<org.springframework.batch.core.JobExecution> getJobExecutions(String jobName, int start, int count)
      Description copied from interface: SearchableJobExecutionDao
      Get the JobExecutions for a specific job name in reverse order of creation (so normally of execution).
      Specified by:
      getJobExecutions in interface SearchableJobExecutionDao
      Parameters:
      jobName - the name of the job
      start - the start index of the instances
      count - the maximum number of instances to return
      Returns:
      the JobExecution instances requested
      See Also:
    • getJobExecutions

      public List<org.springframework.batch.core.JobExecution> getJobExecutions(org.springframework.batch.core.BatchStatus status, int start, int count)
      Description copied from interface: SearchableJobExecutionDao
      Get the JobExecutions for a specific status in reverse order of creation (so normally of execution).
      Specified by:
      getJobExecutions in interface SearchableJobExecutionDao
      Parameters:
      status - the status of the job
      start - the start index of the instances
      count - the maximum number of instances to return
      Returns:
      the JobExecution instances requested
    • getJobExecutionsWithStepCount

      public List<JobExecutionWithStepCount> getJobExecutionsWithStepCount(String jobName, int start, int count)
      Description copied from interface: SearchableJobExecutionDao
      Get the JobExecutions for a specific job name in reverse order of creation (so normally of execution).
      Specified by:
      getJobExecutionsWithStepCount in interface SearchableJobExecutionDao
      Parameters:
      jobName - the name of the job
      start - the start index of the instances
      count - the maximum number of instances to return
      Returns:
      the JobExecutionWithStepCount instances requested
      See Also:
    • getJobExecutions

      public List<org.springframework.batch.core.JobExecution> getJobExecutions(int start, int count)
      Description copied from interface: SearchableJobExecutionDao
      Get the JobExecutions in reverse order of creation (so normally of execution).
      Specified by:
      getJobExecutions in interface SearchableJobExecutionDao
      Parameters:
      start - the start index of the instances
      count - the maximum number of instances to return
      Returns:
      the JobExecution instances requested
      See Also:
    • getJobExecutionsWithStepCount

      public List<JobExecutionWithStepCount> getJobExecutionsWithStepCount(int start, int count)
      Description copied from interface: SearchableJobExecutionDao
      Get the JobExecutions in reverse order of creation (so normally of execution) without StepExecution.
      Specified by:
      getJobExecutionsWithStepCount in interface SearchableJobExecutionDao
      Parameters:
      start - the start index of the instances
      count - the maximum number of instances to return
      Returns:
      the JobExecutionWithStepCount instances requested
    • getJobExecutionsByTaskIds

      public Map<Long,Set<Long>> getJobExecutionsByTaskIds(Collection<Long> ids)
      Specified by:
      getJobExecutionsByTaskIds in interface SearchableJobExecutionDao
      Parameters:
      ids - the set of task execution ids.
      Returns:
      Map with the TaskExecution id as the key and the set of job execution ids as values.
    • saveJobExecution

      public void saveJobExecution(org.springframework.batch.core.JobExecution jobExecution)
      Specified by:
      saveJobExecution in interface org.springframework.batch.core.repository.dao.JobExecutionDao
      Overrides:
      saveJobExecution in class org.springframework.batch.core.repository.dao.JdbcJobExecutionDao
    • synchronizeStatus

      public void synchronizeStatus(org.springframework.batch.core.JobExecution jobExecution)
      Specified by:
      synchronizeStatus in interface org.springframework.batch.core.repository.dao.JobExecutionDao
      Overrides:
      synchronizeStatus in class org.springframework.batch.core.repository.dao.JdbcJobExecutionDao
    • updateJobExecution

      public void updateJobExecution(org.springframework.batch.core.JobExecution jobExecution)
      Specified by:
      updateJobExecution in interface org.springframework.batch.core.repository.dao.JobExecutionDao
      Overrides:
      updateJobExecution in class org.springframework.batch.core.repository.dao.JdbcJobExecutionDao
    • getJobParameters

      protected org.springframework.batch.core.JobParameters getJobParameters(Long executionId)
      Overrides:
      getJobParameters in class org.springframework.batch.core.repository.dao.JdbcJobExecutionDao