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, org.springframework.batch.core.repository.dao.JobExecutionDao, org.springframework.beans.factory.InitializingBean

public class JdbcSearchableJobExecutionDao
extends org.springframework.batch.core.repository.dao.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(java.lang.String jobName)
           
 java.util.List<org.springframework.batch.core.JobExecution> getJobExecutions(int start, int count)
          Get the JobExecutions in reverse order of creation (so normally of execution).
 java.util.List<org.springframework.batch.core.JobExecution> getJobExecutions(java.lang.String jobName, int start, int count)
          Get the JobExecutions for a specific job name in reverse order of creation (so normally of execution).
 java.util.Collection<org.springframework.batch.core.JobExecution> getRunningJobExecutions()
          Find all the running executions (status less than STOPPING).
 void saveJobExecution(org.springframework.batch.core.JobExecution jobExecution)
           
 void setDataSource(javax.sql.DataSource dataSource)
           
 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
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(javax.sql.DataSource dataSource)
Parameters:
dataSource - the dataSource to set

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Overrides:
afterPropertiesSet in class org.springframework.batch.core.repository.dao.JdbcJobExecutionDao
Throws:
java.lang.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(java.lang.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 java.util.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:
SearchableJobExecutionDao.getRunningJobExecutions()

getJobExecutions

public java.util.List<org.springframework.batch.core.JobExecution> getJobExecutions(java.lang.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 java.util.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:
SearchableJobExecutionDao.getJobExecutions(int, int)

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


Copyright © 2011. All Rights Reserved.