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
Modifier and TypeClassDescriptionprotected class
Re-usable mapper forJobExecutionWithStepCount
instances.protected class
Re-usable mapper forJobExecution
instances. -
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
int
int
countJobExecutions
(String jobName) Gets count of job executions.int
countJobExecutions
(String jobName, org.springframework.batch.core.BatchStatus status) Gets count of job executions.int
countJobExecutions
(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.JobExecution
getJobExecution
(Long executionId) List<org.springframework.batch.core.JobExecution>
getJobExecutions
(int start, int count) Get theJobExecutions
in reverse order of creation (so normally of execution).List<org.springframework.batch.core.JobExecution>
getJobExecutions
(String jobName, int start, int count) Get theJobExecutions
for 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 theJobExecutions
for 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 theJobExecutions
for a specific status in reverse order of creation (so normally of execution).getJobExecutionsWithStepCount
(int start, int count) Get theJobExecutions
in reverse order of creation (so normally of execution) without StepExecution.getJobExecutionsWithStepCount
(String jobName, int start, int count) Get theJobExecutions
for a specific job name in reverse order of creation (so normally of execution).getJobExecutionsWithStepCount
(Date fromDate, Date toDate, int start, int count) Get theJobExecutions
for a specific date range in reverse order of creation (so normally of execution).getJobExecutionsWithStepCountFilteredByJobInstanceId
(int jobInstanceId, int start, int count) Get theJobExecutions
for a specific job instance id in reverse order of creation (so normally of execution).getJobExecutionsWithStepCountFilteredByTaskExecutionId
(int taskExecutionId, int start, int count) Get theJobExecutions
for a specific task execution id in reverse order of creation (so normally of execution).protected org.springframework.batch.core.JobParameters
getJobParameters
(Long executionId) org.springframework.batch.core.JobExecution
getLastJobExecution
(org.springframework.batch.core.JobInstance jobInstance) Collection<org.springframework.batch.core.JobExecution>
Find all the running executions (status less than STOPPING).protected String
getTaskQuery
(String base) void
saveJobExecution
(org.springframework.batch.core.JobExecution jobExecution) void
setDataSource
(DataSource dataSource) void
setTaskTablePrefix
(String taskTablePrefix) void
synchronizeStatus
(org.springframework.batch.core.JobExecution jobExecution) void
updateJobExecution
(org.springframework.batch.core.JobExecution jobExecution) Methods inherited from class org.springframework.batch.core.repository.dao.JdbcJobExecutionDao
deleteJobExecution, deleteJobExecutionParameters, setConversionService, setExitMessageLength, setJobExecutionIncrementer
Methods inherited from class org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao
getClobTypeToUse, getJdbcTemplate, getQuery, getTablePrefix, setClobTypeToUse, setJdbcTemplate, setTablePrefix
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
afterPropertiesSet
in interfaceInitializingBean
- Overrides:
afterPropertiesSet
in 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:
findJobExecutions
in interfaceorg.springframework.batch.core.repository.dao.JobExecutionDao
- Overrides:
findJobExecutions
in classorg.springframework.batch.core.repository.dao.JdbcJobExecutionDao
-
getLastJobExecution
public org.springframework.batch.core.JobExecution getLastJobExecution(org.springframework.batch.core.JobInstance jobInstance) - Specified by:
getLastJobExecution
in interfaceorg.springframework.batch.core.repository.dao.JobExecutionDao
- Overrides:
getLastJobExecution
in classorg.springframework.batch.core.repository.dao.JdbcJobExecutionDao
-
findRunningJobExecutions
- Specified by:
findRunningJobExecutions
in interfaceorg.springframework.batch.core.repository.dao.JobExecutionDao
- Overrides:
findRunningJobExecutions
in classorg.springframework.batch.core.repository.dao.JdbcJobExecutionDao
-
getJobExecution
- Specified by:
getJobExecution
in interfaceorg.springframework.batch.core.repository.dao.JobExecutionDao
- Overrides:
getJobExecution
in classorg.springframework.batch.core.repository.dao.JdbcJobExecutionDao
-
countJobExecutions
public int countJobExecutions()- Specified by:
countJobExecutions
in interfaceSearchableJobExecutionDao
- Returns:
- the total number of
JobExecution
instances - See Also:
-
countJobExecutions
Description copied from interface:SearchableJobExecutionDao
Gets count of job executions.- Specified by:
countJobExecutions
in interfaceSearchableJobExecutionDao
- 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 interfaceSearchableJobExecutionDao
- Parameters:
status
- the job status- Returns:
- the number of
JobExecutions
belonging to this job - See Also:
-
countJobExecutions
Description copied from interface:SearchableJobExecutionDao
Gets count of job executions.- Specified by:
countJobExecutions
in interfaceSearchableJobExecutionDao
- Parameters:
jobName
- the name of a jobstatus
- 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 theJobExecutions
for a specific date range in reverse order of creation (so normally of execution).- Specified by:
getJobExecutionsWithStepCount
in 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
JobExecutionWithStepCount
instances requested - See Also:
-
getJobExecutionsWithStepCountFilteredByJobInstanceId
public List<JobExecutionWithStepCount> getJobExecutionsWithStepCountFilteredByJobInstanceId(int jobInstanceId, int start, int count) Description copied from interface:SearchableJobExecutionDao
Get theJobExecutions
for a specific job instance id in reverse order of creation (so normally of execution).- Specified by:
getJobExecutionsWithStepCountFilteredByJobInstanceId
in 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
JobExecutionWithStepCount
instances requested
-
getJobExecutionsWithStepCountFilteredByTaskExecutionId
public List<JobExecutionWithStepCount> getJobExecutionsWithStepCountFilteredByTaskExecutionId(int taskExecutionId, int start, int count) Description copied from interface:SearchableJobExecutionDao
Get theJobExecutions
for a specific task execution id in reverse order of creation (so normally of execution).- Specified by:
getJobExecutionsWithStepCountFilteredByTaskExecutionId
in 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
JobExecutionWithStepCount
instances requested
-
getRunningJobExecutions
Description copied from interface:SearchableJobExecutionDao
Find all the running executions (status less than STOPPING).- Specified by:
getRunningJobExecutions
in interfaceSearchableJobExecutionDao
- 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 theJobExecutions
for a specific job name in reverse order of creation (so normally of execution).- Specified by:
getJobExecutions
in 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
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 theJobExecutions
for a specific job name in reverse order of creation (so normally of execution).- Specified by:
getJobExecutions
in interfaceSearchableJobExecutionDao
- Parameters:
jobName
- the name of the jobstart
- the start index of the instancescount
- 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 theJobExecutions
for a specific status in reverse order of creation (so normally of execution).- Specified by:
getJobExecutions
in interfaceSearchableJobExecutionDao
- Parameters:
status
- the status of the jobstart
- the start index of the instancescount
- 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 theJobExecutions
for a specific job name in reverse order of creation (so normally of execution).- Specified by:
getJobExecutionsWithStepCount
in interfaceSearchableJobExecutionDao
- Parameters:
jobName
- the name of the jobstart
- the start index of the instancescount
- the maximum number of instances to return- Returns:
- the
JobExecutionWithStepCount
instances requested - See Also:
-
getJobExecutions
Description copied from interface:SearchableJobExecutionDao
Get theJobExecutions
in reverse order of creation (so normally of execution).- Specified by:
getJobExecutions
in interfaceSearchableJobExecutionDao
- Parameters:
start
- the start index of the instancescount
- the maximum number of instances to return- Returns:
- the
JobExecution
instances requested - See Also:
-
getJobExecutionsWithStepCount
Description copied from interface:SearchableJobExecutionDao
Get theJobExecutions
in reverse order of creation (so normally of execution) without StepExecution.- Specified by:
getJobExecutionsWithStepCount
in interfaceSearchableJobExecutionDao
- Parameters:
start
- the start index of the instancescount
- the maximum number of instances to return- Returns:
- the
JobExecutionWithStepCount
instances requested
-
getJobExecutionsByTaskIds
- Specified by:
getJobExecutionsByTaskIds
in 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:
saveJobExecution
in interfaceorg.springframework.batch.core.repository.dao.JobExecutionDao
- Overrides:
saveJobExecution
in classorg.springframework.batch.core.repository.dao.JdbcJobExecutionDao
-
synchronizeStatus
public void synchronizeStatus(org.springframework.batch.core.JobExecution jobExecution) - Specified by:
synchronizeStatus
in interfaceorg.springframework.batch.core.repository.dao.JobExecutionDao
- Overrides:
synchronizeStatus
in classorg.springframework.batch.core.repository.dao.JdbcJobExecutionDao
-
updateJobExecution
public void updateJobExecution(org.springframework.batch.core.JobExecution jobExecution) - Specified by:
updateJobExecution
in interfaceorg.springframework.batch.core.repository.dao.JobExecutionDao
- Overrides:
updateJobExecution
in classorg.springframework.batch.core.repository.dao.JdbcJobExecutionDao
-
getJobParameters
- Overrides:
getJobParameters
in classorg.springframework.batch.core.repository.dao.JdbcJobExecutionDao
-