|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao org.springframework.batch.core.repository.dao.JdbcJobExecutionDao
public class JdbcJobExecutionDao
Jdbc implementation of JobExecutionDao
. Uses sequences (via Spring's
DataFieldMaxValueIncrementer
abstraction) to create all primary keys
before inserting a new row. Objects are checked to ensure all mandatory
fields to be stored are not null. If any are found to be null, an
IllegalArgumentException will be thrown. This could be left to JdbcTemplate,
however, the exception will be fairly vague, and fails to highlight which
field caused the exception.
Field Summary |
---|
Fields inherited from class org.springframework.batch.core.repository.dao.AbstractJdbcBatchMetadataDao |
---|
DEFAULT_EXIT_MESSAGE_LENGTH, DEFAULT_TABLE_PREFIX |
Constructor Summary | |
---|---|
JdbcJobExecutionDao()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
List<JobExecution> |
findJobExecutions(JobInstance job)
Return all JobExecution for given JobInstance , sorted
backwards by creation order (so the first element is the most recent). |
Set<JobExecution> |
findRunningJobExecutions(String jobName)
|
JobExecution |
getJobExecution(Long executionId)
|
JobExecution |
getLastJobExecution(JobInstance jobInstance)
Find the last JobExecution to have been created for a given
JobInstance . |
void |
saveJobExecution(JobExecution jobExecution)
SQL implementation using Sequences via the Spring incrementer abstraction. |
void |
setExitMessageLength(int exitMessageLength)
Public setter for the exit message length in database. |
void |
setJobExecutionIncrementer(DataFieldMaxValueIncrementer jobExecutionIncrementer)
Setter for DataFieldMaxValueIncrementer to be used when
generating primary keys for JobExecution instances. |
void |
synchronizeStatus(JobExecution jobExecution)
Because it may be possible that the status of a JobExecution is updated while running, the following method will synchronize only the status and version fields. |
void |
updateJobExecution(JobExecution jobExecution)
Update given JobExecution using a SQL UPDATE statement. |
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 |
Constructor Detail |
---|
public JdbcJobExecutionDao()
Method Detail |
---|
public void setExitMessageLength(int exitMessageLength)
exitMessageLength
- the exitMessageLength to setpublic void setJobExecutionIncrementer(DataFieldMaxValueIncrementer jobExecutionIncrementer)
DataFieldMaxValueIncrementer
to be used when
generating primary keys for JobExecution
instances.
jobExecutionIncrementer
- the DataFieldMaxValueIncrementer
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
afterPropertiesSet
in class AbstractJdbcBatchMetadataDao
Exception
public List<JobExecution> findJobExecutions(JobInstance job)
JobExecutionDao
JobExecution
for given JobInstance
, sorted
backwards by creation order (so the first element is the most recent).
findJobExecutions
in interface JobExecutionDao
public void saveJobExecution(JobExecution jobExecution)
saveJobExecution
in interface JobExecutionDao
IllegalArgumentException
- if jobExecution is null, as well as any
of it's fields to be persisted.JobExecutionDao.saveJobExecution(JobExecution)
public void updateJobExecution(JobExecution jobExecution)
updateJobExecution
in interface JobExecutionDao
JobExecutionDao.updateJobExecution(JobExecution)
public JobExecution getLastJobExecution(JobInstance jobInstance)
JobExecutionDao
JobExecution
to have been created for a given
JobInstance
.
getLastJobExecution
in interface JobExecutionDao
jobInstance
- the JobInstance
JobExecution
to execute for this instancepublic JobExecution getJobExecution(Long executionId)
getJobExecution
in interface JobExecutionDao
JobExecution
for given identifier.public Set<JobExecution> findRunningJobExecutions(String jobName)
findRunningJobExecutions
in interface JobExecutionDao
JobExecution
that are still running (or indeterminate
state), i.e. having null end date, for the specified job name.public void synchronizeStatus(JobExecution jobExecution)
JobExecutionDao
synchronizeStatus
in interface JobExecutionDao
jobExecution
- to be updated.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |