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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classRe-usable mapper forJobExecutionWithStepCountinstances.protected classRe-usable mapper forJobExecutioninstances. -
Field Summary
Fields inherited from class org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao
DEFAULT_EXIT_MESSAGE_LENGTH, DEFAULT_SHORT_CONTEXT_LENGTH, DEFAULT_TABLE_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidintintcountJobExecutions(String jobName) Gets count of job executions.intcountJobExecutions(String jobName, org.springframework.batch.core.BatchStatus status) Gets count of job executions.intcountJobExecutions(org.springframework.batch.core.BatchStatus status) Gets count of job executions.List<org.springframework.batch.core.JobExecution>findJobExecutions(org.springframework.batch.core.JobInstance job) Set<org.springframework.batch.core.JobExecution>findRunningJobExecutions(String jobName) org.springframework.batch.core.JobExecutiongetJobExecution(Long executionId) List<org.springframework.batch.core.JobExecution>getJobExecutions(int start, int count) Get theJobExecutionsin reverse order of creation (so normally of execution).List<org.springframework.batch.core.JobExecution>getJobExecutions(String jobName, int start, int count) Get theJobExecutionsfor a specific job name in reverse order of creation (so normally of execution).List<org.springframework.batch.core.JobExecution>getJobExecutions(String jobName, org.springframework.batch.core.BatchStatus status, int start, int count) Get theJobExecutionsfor a specific job name in reverse order of creation (so normally of execution).List<org.springframework.batch.core.JobExecution>getJobExecutions(org.springframework.batch.core.BatchStatus status, int start, int count) Get theJobExecutionsfor a specific status in reverse order of creation (so normally of execution).getJobExecutionsWithStepCount(int start, int count) Get theJobExecutionsin reverse order of creation (so normally of execution) without StepExecution.getJobExecutionsWithStepCount(String jobName, int start, int count) Get theJobExecutionsfor a specific job name in reverse order of creation (so normally of execution).getJobExecutionsWithStepCount(Date fromDate, Date toDate, int start, int count) Get theJobExecutionsfor a specific date range in reverse order of creation (so normally of execution).getJobExecutionsWithStepCountFilteredByJobInstanceId(int jobInstanceId, int start, int count) Get theJobExecutionsfor a specific job instance id in reverse order of creation (so normally of execution).getJobExecutionsWithStepCountFilteredByTaskExecutionId(int taskExecutionId, int start, int count) Get theJobExecutionsfor a specific task execution id in reverse order of creation (so normally of execution).protected org.springframework.batch.core.JobParametersgetJobParameters(Long executionId) org.springframework.batch.core.JobExecutiongetLastJobExecution(org.springframework.batch.core.JobInstance jobInstance) Collection<org.springframework.batch.core.JobExecution>Find all the running executions (status less than STOPPING).protected StringgetTaskQuery(String base) voidsaveJobExecution(org.springframework.batch.core.JobExecution jobExecution) voidsetDataSource(DataSource dataSource) voidsetTaskTablePrefix(String taskTablePrefix) voidsynchronizeStatus(org.springframework.batch.core.JobExecution jobExecution) voidupdateJobExecution(org.springframework.batch.core.JobExecution jobExecution) Methods inherited from class org.springframework.batch.core.repository.dao.JdbcJobExecutionDao
deleteJobExecution, deleteJobExecutionParameters, setConversionService, setExitMessageLength, setJobExecutionIncrementerMethods inherited from class org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao
getClobTypeToUse, getJdbcTemplate, getQuery, getTablePrefix, setClobTypeToUse, setJdbcTemplate, setTablePrefixMethods 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
-
JdbcSearchableJobExecutionDao
public JdbcSearchableJobExecutionDao()
-
-
Method Details
-
setDataSource
- Parameters:
dataSource- the dataSource to set
-
setTaskTablePrefix
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceInitializingBean- Overrides:
afterPropertiesSetin classorg.springframework.batch.core.repository.dao.JdbcJobExecutionDao- Throws:
Exception- See Also:
-
JdbcJobExecutionDao.afterPropertiesSet()
-
getTaskQuery
-
findJobExecutions
public List<org.springframework.batch.core.JobExecution> findJobExecutions(org.springframework.batch.core.JobInstance job) - Specified by:
findJobExecutionsin interfaceorg.springframework.batch.core.repository.dao.JobExecutionDao- Overrides:
findJobExecutionsin classorg.springframework.batch.core.repository.dao.JdbcJobExecutionDao
-
getLastJobExecution
public org.springframework.batch.core.JobExecution getLastJobExecution(org.springframework.batch.core.JobInstance jobInstance) - Specified by:
getLastJobExecutionin interfaceorg.springframework.batch.core.repository.dao.JobExecutionDao- Overrides:
getLastJobExecutionin classorg.springframework.batch.core.repository.dao.JdbcJobExecutionDao
-
findRunningJobExecutions
- Specified by:
findRunningJobExecutionsin interfaceorg.springframework.batch.core.repository.dao.JobExecutionDao- Overrides:
findRunningJobExecutionsin classorg.springframework.batch.core.repository.dao.JdbcJobExecutionDao
-
getJobExecution
- Specified by:
getJobExecutionin interfaceorg.springframework.batch.core.repository.dao.JobExecutionDao- Overrides:
getJobExecutionin classorg.springframework.batch.core.repository.dao.JdbcJobExecutionDao
-
countJobExecutions
public int countJobExecutions()- Specified by:
countJobExecutionsin interfaceSearchableJobExecutionDao- Returns:
- the total number of
JobExecutioninstances - See Also:
-
countJobExecutions
Description copied from interface:SearchableJobExecutionDaoGets count of job executions.- Specified by:
countJobExecutionsin interfaceSearchableJobExecutionDao- Parameters:
jobName- the name of a job- Returns:
- the number of
JobExecutionsbelonging to this job - See Also:
-
countJobExecutions
public int countJobExecutions(org.springframework.batch.core.BatchStatus status) Description copied from interface:SearchableJobExecutionDaoGets count of job executions.- Specified by:
countJobExecutionsin interfaceSearchableJobExecutionDao- Parameters:
status- the job status- Returns:
- the number of
JobExecutionsbelonging to this job - See Also:
-
countJobExecutions
Description copied from interface:SearchableJobExecutionDaoGets count of job executions.- Specified by:
countJobExecutionsin interfaceSearchableJobExecutionDao- Parameters:
jobName- the name of a jobstatus- the job status- Returns:
- the number of
JobExecutionsbelonging to this job - See Also:
-
getJobExecutionsWithStepCount
public List<JobExecutionWithStepCount> getJobExecutionsWithStepCount(Date fromDate, Date toDate, int start, int count) Description copied from interface:SearchableJobExecutionDaoGet theJobExecutionsfor a specific date range in reverse order of creation (so normally of execution).- Specified by:
getJobExecutionsWithStepCountin interfaceSearchableJobExecutionDao- 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 instancescount- the maximum number of instances to return- Returns:
- the
JobExecutionWithStepCountinstances requested - See Also:
-
getJobExecutionsWithStepCountFilteredByJobInstanceId
public List<JobExecutionWithStepCount> getJobExecutionsWithStepCountFilteredByJobInstanceId(int jobInstanceId, int start, int count) Description copied from interface:SearchableJobExecutionDaoGet theJobExecutionsfor a specific job instance id in reverse order of creation (so normally of execution).- Specified by:
getJobExecutionsWithStepCountFilteredByJobInstanceIdin interfaceSearchableJobExecutionDao- Parameters:
jobInstanceId- the job instance id associated with the execution.start- the start index of the instancescount- the maximum number of instances to return- Returns:
- the
JobExecutionWithStepCountinstances requested
-
getJobExecutionsWithStepCountFilteredByTaskExecutionId
public List<JobExecutionWithStepCount> getJobExecutionsWithStepCountFilteredByTaskExecutionId(int taskExecutionId, int start, int count) Description copied from interface:SearchableJobExecutionDaoGet theJobExecutionsfor a specific task execution id in reverse order of creation (so normally of execution).- Specified by:
getJobExecutionsWithStepCountFilteredByTaskExecutionIdin interfaceSearchableJobExecutionDao- Parameters:
taskExecutionId- the task execution id associated with the execution.start- the start index of the instancescount- the maximum number of instances to return- Returns:
- the
JobExecutionWithStepCountinstances requested
-
getRunningJobExecutions
Description copied from interface:SearchableJobExecutionDaoFind all the running executions (status less than STOPPING).- Specified by:
getRunningJobExecutionsin interfaceSearchableJobExecutionDao- Returns:
- all the
JobExecutioninstances 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:SearchableJobExecutionDaoGet theJobExecutionsfor a specific job name in reverse order of creation (so normally of execution).- Specified by:
getJobExecutionsin interfaceSearchableJobExecutionDao- Parameters:
jobName- the name of the jobstatus- the status of the jobstart- the start index of the instancescount- the maximum number of instances to return- Returns:
- the
JobExecutioninstances requested - See Also:
-
getJobExecutions
public List<org.springframework.batch.core.JobExecution> getJobExecutions(String jobName, int start, int count) Description copied from interface:SearchableJobExecutionDaoGet theJobExecutionsfor a specific job name in reverse order of creation (so normally of execution).- Specified by:
getJobExecutionsin interfaceSearchableJobExecutionDao- Parameters:
jobName- the name of the jobstart- the start index of the instancescount- the maximum number of instances to return- Returns:
- the
JobExecutioninstances 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:SearchableJobExecutionDaoGet theJobExecutionsfor a specific status in reverse order of creation (so normally of execution).- Specified by:
getJobExecutionsin interfaceSearchableJobExecutionDao- Parameters:
status- the status of the jobstart- the start index of the instancescount- the maximum number of instances to return- Returns:
- the
JobExecutioninstances requested
-
getJobExecutionsWithStepCount
public List<JobExecutionWithStepCount> getJobExecutionsWithStepCount(String jobName, int start, int count) Description copied from interface:SearchableJobExecutionDaoGet theJobExecutionsfor a specific job name in reverse order of creation (so normally of execution).- Specified by:
getJobExecutionsWithStepCountin interfaceSearchableJobExecutionDao- Parameters:
jobName- the name of the jobstart- the start index of the instancescount- the maximum number of instances to return- Returns:
- the
JobExecutionWithStepCountinstances requested - See Also:
-
getJobExecutions
Description copied from interface:SearchableJobExecutionDaoGet theJobExecutionsin reverse order of creation (so normally of execution).- Specified by:
getJobExecutionsin interfaceSearchableJobExecutionDao- Parameters:
start- the start index of the instancescount- the maximum number of instances to return- Returns:
- the
JobExecutioninstances requested - See Also:
-
getJobExecutionsWithStepCount
Description copied from interface:SearchableJobExecutionDaoGet theJobExecutionsin reverse order of creation (so normally of execution) without StepExecution.- Specified by:
getJobExecutionsWithStepCountin interfaceSearchableJobExecutionDao- Parameters:
start- the start index of the instancescount- the maximum number of instances to return- Returns:
- the
JobExecutionWithStepCountinstances requested
-
getJobExecutionsByTaskIds
- Specified by:
getJobExecutionsByTaskIdsin interfaceSearchableJobExecutionDao- 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:
saveJobExecutionin interfaceorg.springframework.batch.core.repository.dao.JobExecutionDao- Overrides:
saveJobExecutionin classorg.springframework.batch.core.repository.dao.JdbcJobExecutionDao
-
synchronizeStatus
public void synchronizeStatus(org.springframework.batch.core.JobExecution jobExecution) - Specified by:
synchronizeStatusin interfaceorg.springframework.batch.core.repository.dao.JobExecutionDao- Overrides:
synchronizeStatusin classorg.springframework.batch.core.repository.dao.JdbcJobExecutionDao
-
updateJobExecution
public void updateJobExecution(org.springframework.batch.core.JobExecution jobExecution) - Specified by:
updateJobExecutionin interfaceorg.springframework.batch.core.repository.dao.JobExecutionDao- Overrides:
updateJobExecutionin classorg.springframework.batch.core.repository.dao.JdbcJobExecutionDao
-
getJobParameters
- Overrides:
getJobParametersin classorg.springframework.batch.core.repository.dao.JdbcJobExecutionDao
-