committed by
Mahmoud Ben Hassine
parent
fd7dd5f1a7
commit
5a35b03300
@@ -20,6 +20,7 @@ import java.util.Set;
|
||||
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.JobInstance;
|
||||
import org.springframework.batch.core.JobParameters;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.core.launch.NoSuchJobException;
|
||||
import org.springframework.batch.item.ExecutionContext;
|
||||
@@ -34,6 +35,7 @@ import org.springframework.lang.Nullable;
|
||||
* @author Michael Minella
|
||||
* @author Will Schipp
|
||||
* @author Mahmoud Ben Hassine
|
||||
* @author Parikshit Dutta
|
||||
* @since 2.0
|
||||
*/
|
||||
public interface JobExplorer {
|
||||
@@ -92,6 +94,16 @@ public interface JobExplorer {
|
||||
@Nullable
|
||||
JobInstance getJobInstance(@Nullable Long instanceId);
|
||||
|
||||
/**
|
||||
* @param jobName {@link String} name for the jobInstance.
|
||||
* @param jobParameters {@link JobParameters} parameters for the jobInstance.
|
||||
* @return the {@link JobInstance} with this name and parameters, or null
|
||||
*
|
||||
* @since 5.0
|
||||
*/
|
||||
@Nullable
|
||||
JobInstance getJobInstance(String jobName, JobParameters jobParameters);
|
||||
|
||||
/**
|
||||
* Retrieve job executions by their job instance. The corresponding step executions
|
||||
* may not be fully hydrated (for example, their execution context may be missing),
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.springframework.batch.core.explore.support;
|
||||
|
||||
import org.springframework.batch.core.JobExecution;
|
||||
import org.springframework.batch.core.JobInstance;
|
||||
import org.springframework.batch.core.JobParameters;
|
||||
import org.springframework.batch.core.StepExecution;
|
||||
import org.springframework.batch.core.explore.JobExplorer;
|
||||
import org.springframework.batch.core.launch.NoSuchJobException;
|
||||
@@ -38,6 +39,8 @@ import java.util.Set;
|
||||
* @author Michael Minella
|
||||
* @author Will Schipp
|
||||
* @author Mahmoud Ben Hassine
|
||||
* @author Parikshit Dutta
|
||||
*
|
||||
* @see JobExplorer
|
||||
* @see JobInstanceDao
|
||||
* @see JobExecutionDao
|
||||
@@ -185,6 +188,19 @@ public class SimpleJobExplorer implements JobExplorer {
|
||||
return jobInstanceDao.getJobInstance(instanceId);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.springframework.batch.core.explore.JobExplorer#getJobInstance(java
|
||||
* .lang.String, org.springframework.batch.core.JobParameters)
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public JobInstance getJobInstance(String jobName, JobParameters jobParameters) {
|
||||
return jobInstanceDao.getJobInstance(jobName, jobParameters);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
||||
@@ -46,6 +46,7 @@ import java.util.List;
|
||||
* @author David Turanski
|
||||
* @author Michael Minella
|
||||
* @author Mahmoud Ben Hassine
|
||||
* @author Parikshit Dutta
|
||||
*/
|
||||
public interface JobRepository {
|
||||
|
||||
@@ -186,6 +187,16 @@ public interface JobRepository {
|
||||
*/
|
||||
void updateExecutionContext(JobExecution jobExecution);
|
||||
|
||||
/**
|
||||
* @param jobName {@link String} the name of the jobInstance
|
||||
* @param jobParameters {@link JobParameters} parameters identifying the {@link JobInstance}
|
||||
* @return the {@link JobInstance} with name and parameters, or null
|
||||
*
|
||||
* @since 5.0
|
||||
*/
|
||||
@Nullable
|
||||
JobInstance getJobInstance(String jobName, JobParameters jobParameters);
|
||||
|
||||
/**
|
||||
* @param jobInstance {@link JobInstance} instance containing the step executions.
|
||||
* @param stepName the name of the step execution that might have run.
|
||||
|
||||
@@ -53,6 +53,8 @@ import java.util.List;
|
||||
* @author David Turanski
|
||||
* @author Mahmoud Ben Hassine
|
||||
* @author Baris Cubukcuoglu
|
||||
* @author Parikshit Dutta
|
||||
*
|
||||
* @see JobRepository
|
||||
* @see JobInstanceDao
|
||||
* @see JobExecutionDao
|
||||
@@ -244,6 +246,11 @@ public class SimpleJobRepository implements JobRepository {
|
||||
ecDao.updateExecutionContext(jobExecution);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JobInstance getJobInstance(String jobName, JobParameters jobParameters) {
|
||||
return jobInstanceDao.getJobInstance(jobName, jobParameters);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public StepExecution getLastStepExecution(JobInstance jobInstance, String stepName) {
|
||||
|
||||
Reference in New Issue
Block a user