org.springframework.batch.admin.service
Class JdbcSearchableJobExecutionDao

java.lang.Object
  extended by org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao
      extended by org.springframework.batch.core.repository.dao.JdbcJobExecutionDao
          extended by org.springframework.batch.admin.service.JdbcSearchableJobExecutionDao
All Implemented Interfaces:
SearchableJobExecutionDao, JobExecutionDao, InitializingBean

public class JdbcSearchableJobExecutionDao
extends JdbcJobExecutionDao
implements SearchableJobExecutionDao

Author:
Dave Syer

Nested Class Summary
protected static class JdbcSearchableJobExecutionDao.JobExecutionRowMapper
          Re-usable mapper for JobExecution instances.
 
Field Summary
 
Fields inherited from class org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao
DEFAULT_EXIT_MESSAGE_LENGTH, DEFAULT_TABLE_PREFIX
 
Constructor Summary
JdbcSearchableJobExecutionDao()
           
 
Method Summary
 void afterPropertiesSet()
           
 int countJobExecutions()
           
 int countJobExecutions(String jobName)
           
 List<JobExecution> getJobExecutions(int start, int count)
          Get the JobExecutions in reverse order of creation (so normally of execution).
 List<JobExecution> getJobExecutions(String jobName, int start, int count)
          Get the JobExecutions for a specific job name in reverse order of creation (so normally of execution).
 Collection<JobExecution> getRunningJobExecutions()
          Find all the running executions (status less than STOPPING).
 void saveJobExecution(JobExecution jobExecution)
           
 void setDataSource(DataSource dataSource)
           
 void synchronizeStatus(JobExecution jobExecution)
           
 void updateJobExecution(JobExecution jobExecution)
           
 
Methods inherited from class org.springframework.batch.core.repository.dao.JdbcJobExecutionDao
findJobExecutions, findRunningJobExecutions, getJobExecution, getLastJobExecution, 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
findJobExecutions, findRunningJobExecutions, getJobExecution, getLastJobExecution
 

Constructor Detail

JdbcSearchableJobExecutionDao

public JdbcSearchableJobExecutionDao()
Method Detail

setDataSource

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

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class JdbcJobExecutionDao
Throws:
Exception
See Also:
JdbcJobExecutionDao.afterPropertiesSet()

countJobExecutions

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

countJobExecutions

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

getRunningJobExecutions

public Collection<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:
SearchableJobExecutionDao.getRunningJobExecutions()

getJobExecutions

public List<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:
SearchableJobExecutionDao.getJobExecutions(String, int, int)

getJobExecutions

public List<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:
SearchableJobExecutionDao.getJobExecutions(int, int)

saveJobExecution

public void saveJobExecution(JobExecution jobExecution)
Specified by:
saveJobExecution in interface JobExecutionDao
Overrides:
saveJobExecution in class JdbcJobExecutionDao

synchronizeStatus

public void synchronizeStatus(JobExecution jobExecution)
Specified by:
synchronizeStatus in interface JobExecutionDao
Overrides:
synchronizeStatus in class JdbcJobExecutionDao

updateJobExecution

public void updateJobExecution(JobExecution jobExecution)
Specified by:
updateJobExecution in interface JobExecutionDao
Overrides:
updateJobExecution in class JdbcJobExecutionDao


Copyright © 2011. All Rights Reserved.