IN PROGRESS - BATCH-518: clean up the *Or* repository methods
created standalone ExecutionContextDao interface
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package org.springframework.batch.core.repository.dao;
|
||||
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
|
||||
/**
|
||||
* DAO interface for persisting and retrieving {@link ExecutionContext}s.
|
||||
*
|
||||
* @author Robert Kasanicky
|
||||
*/
|
||||
public interface ExecutionContextDao {
|
||||
|
||||
/**
|
||||
* @param jobExecution
|
||||
* @return execution context associated with the given jobExecution
|
||||
*/
|
||||
ExecutionContext getExecutionContext(JobExecution jobExecution);
|
||||
|
||||
/**
|
||||
* @param stepExecution
|
||||
* @return execution context associated with the given stepExecution
|
||||
*/
|
||||
ExecutionContext getExecutionContext(StepExecution stepExecution);
|
||||
|
||||
/**
|
||||
* Persist the execution context associated with the given jobExecution
|
||||
* @param jobExecution
|
||||
*/
|
||||
void persistExecutionContext(final JobExecution jobExecution);
|
||||
|
||||
/**
|
||||
* Persist the execution context associated with the given stepExecution
|
||||
* @param stepExecution
|
||||
*/
|
||||
void persistExecutionContext(final StepExecution stepExecution);
|
||||
}
|
||||
@@ -29,7 +29,7 @@ import org.springframework.util.Assert;
|
||||
* @author Lucas Ward
|
||||
* @author Robert Kasanicky
|
||||
*/
|
||||
class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao {
|
||||
public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implements ExecutionContextDao {
|
||||
|
||||
private static final String STEP_DISCRIMINATOR = "S";
|
||||
|
||||
@@ -83,7 +83,7 @@ class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao {
|
||||
* jobExecution
|
||||
* @param jobExecution
|
||||
*/
|
||||
public void saveOrUpdateExecutionContext(final JobExecution jobExecution) {
|
||||
public void persistExecutionContext(final JobExecution jobExecution) {
|
||||
Long executionId = jobExecution.getId();
|
||||
ExecutionContext executionContext = jobExecution.getExecutionContext();
|
||||
Assert.notNull(executionId, "ExecutionId must not be null.");
|
||||
@@ -97,7 +97,7 @@ class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao {
|
||||
* stepExecution
|
||||
* @param stepExecution
|
||||
*/
|
||||
public void saveOrUpdateExecutionContext(final StepExecution stepExecution) {
|
||||
public void persistExecutionContext(final StepExecution stepExecution) {
|
||||
|
||||
Long executionId = stepExecution.getId();
|
||||
ExecutionContext executionContext = stepExecution.getExecutionContext();
|
||||
|
||||
@@ -237,7 +237,7 @@ public class JdbcJobExecutionDao extends AbstractJdbcBatchMetadataDao implements
|
||||
}
|
||||
|
||||
public void persistExecutionContext(JobExecution jobExecution) {
|
||||
ecDao.saveOrUpdateExecutionContext(jobExecution);
|
||||
ecDao.persistExecutionContext(jobExecution);
|
||||
}
|
||||
|
||||
public void setLobHandler(LobHandler lobHandler) {
|
||||
|
||||
@@ -139,7 +139,7 @@ public class JdbcStepExecutionDao extends AbstractJdbcBatchMetadataDao implement
|
||||
*/
|
||||
public void persistExecutionContext(final StepExecution stepExecution) {
|
||||
|
||||
ecDao.saveOrUpdateExecutionContext(stepExecution);
|
||||
ecDao.persistExecutionContext(stepExecution);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user