|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface JobService
Interface for general purpose monitoring and management of Batch jobs. The features here can generally be composed from existing Spring Batch interfaces (although for performance reasons, implementations might choose special-purpose optimisations via a relation database, for instance).
| Method Summary | |
|---|---|
org.springframework.batch.core.JobExecution |
abandon(java.lang.Long jobExecutionId)
Mark the JobExecution as ABANDONED. |
int |
countJobExecutions()
Count the maximum number of executions that could be returned by listJobExecutions(int, int). |
int |
countJobExecutionsForJob(java.lang.String jobName)
Count the job executions in the repository for a job. |
int |
countJobInstances(java.lang.String jobName)
Count the number of job instances in the repository
for a given job name. |
int |
countJobs()
Count the total number of jobs that can be returned by listJobs(int, int). |
int |
countStepExecutionsForStep(java.lang.String jobName,
java.lang.String stepName)
Count the step executions in the repository for a given step name (or pattern). |
org.springframework.batch.core.JobExecution |
getJobExecution(java.lang.Long jobExecutionId)
Get a JobExecution by id. |
java.util.Collection<org.springframework.batch.core.JobExecution> |
getJobExecutionsForJobInstance(java.lang.String jobName,
java.lang.Long jobInstanceId)
Get all the job executions for a given job instance. |
org.springframework.batch.core.JobInstance |
getJobInstance(long jobInstanceId)
Get a job instance by id. |
org.springframework.batch.core.JobParameters |
getLastJobParameters(java.lang.String jobName)
Get the last JobParameters used to execute a job successfully. |
org.springframework.batch.core.StepExecution |
getStepExecution(java.lang.Long jobExecutionId,
java.lang.Long stepExecutionId)
Locate a StepExecution from its id and that of its parent
JobExecution. |
java.util.Collection<org.springframework.batch.core.StepExecution> |
getStepExecutions(java.lang.Long jobExecutionId)
Get the step executions for a given job execution
(by id). |
java.util.Collection<java.lang.String> |
getStepNamesForJob(java.lang.String jobName)
Get the names of the steps in a job (or a historical list of recent execution names if the Job is not launchable). |
boolean |
isIncrementable(java.lang.String jobName)
Check if a job has a JobParametersIncrementer. |
boolean |
isLaunchable(java.lang.String jobName)
Convenience method to determine if a job is available for launching. |
org.springframework.batch.core.JobExecution |
launch(java.lang.String jobName,
org.springframework.batch.core.JobParameters params)
Launch a job with the parameters provided. |
java.util.Collection<org.springframework.batch.core.JobExecution> |
listJobExecutions(int start,
int count)
List the job executions in descending order of
creation (usually close to execution order). |
java.util.Collection<org.springframework.batch.core.JobExecution> |
listJobExecutionsForJob(java.lang.String jobName,
int start,
int count)
List the job executions for a job in descending
order of creation (usually close to execution order). |
java.util.Collection<org.springframework.batch.core.JobInstance> |
listJobInstances(java.lang.String jobName,
int start,
int count)
List the job instances in descending order of
creation (usually close to order of execution). |
java.util.Collection<java.lang.String> |
listJobs(int start,
int count)
Query the job names in the system, either launchable or not. |
java.util.Collection<org.springframework.batch.core.StepExecution> |
listStepExecutionsForStep(java.lang.String jobName,
java.lang.String stepName,
int start,
int count)
List the step executions for a step in descending
order of creation (usually close to execution order). |
org.springframework.batch.core.JobExecution |
restart(java.lang.Long jobExecutionId)
Launch a job with the parameters provided. |
org.springframework.batch.core.JobExecution |
stop(java.lang.Long jobExecutionId)
Send a signal to a job execution to stop processing. |
int |
stopAll()
Send a stop signal to all running job executions. |
| Method Detail |
|---|
boolean isLaunchable(java.lang.String jobName)
listJobs(int, int) might be in the
repository, but not be launchable if the host application has no
configuration for them.
jobName - the name of the job
org.springframework.batch.core.JobExecution launch(java.lang.String jobName,
org.springframework.batch.core.JobParameters params)
throws org.springframework.batch.core.launch.NoSuchJobException,
org.springframework.batch.core.repository.JobExecutionAlreadyRunningException,
org.springframework.batch.core.repository.JobRestartException,
org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException,
org.springframework.batch.core.JobParametersInvalidException
jobName - the job nameparams - the JobParameters
JobExecution if successful
org.springframework.batch.core.launch.NoSuchJobException
org.springframework.batch.core.repository.JobExecutionAlreadyRunningException
org.springframework.batch.core.repository.JobRestartException
org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException
org.springframework.batch.core.JobParametersInvalidException
org.springframework.batch.core.JobParameters getLastJobParameters(java.lang.String jobName)
throws org.springframework.batch.core.launch.NoSuchJobException
JobParameters used to execute a job successfully.
jobName - the name of the job
org.springframework.batch.core.launch.NoSuchJobException
org.springframework.batch.core.JobExecution restart(java.lang.Long jobExecutionId)
throws org.springframework.batch.core.launch.NoSuchJobExecutionException,
org.springframework.batch.core.repository.JobExecutionAlreadyRunningException,
org.springframework.batch.core.repository.JobRestartException,
org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException,
org.springframework.batch.core.launch.NoSuchJobException,
org.springframework.batch.core.JobParametersInvalidException
jobExecutionId - the job execution to restart
JobExecution if successful
org.springframework.batch.core.launch.NoSuchJobExecutionException
org.springframework.batch.core.repository.JobExecutionAlreadyRunningException
org.springframework.batch.core.repository.JobRestartException
org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException
org.springframework.batch.core.launch.NoSuchJobException
org.springframework.batch.core.JobParametersInvalidException
org.springframework.batch.core.JobExecution stop(java.lang.Long jobExecutionId)
throws org.springframework.batch.core.launch.NoSuchJobExecutionException,
org.springframework.batch.core.launch.JobExecutionNotRunningException
Job and Step
implementations to ensure that the signal is obeyed. In particular, if
users provide a custom Tasklet to a Step it must check
the signal in the JobExecution itself.
jobExecutionId - the job execution id to stop
JobExecution that was stopped
org.springframework.batch.core.launch.NoSuchJobExecutionException
org.springframework.batch.core.launch.JobExecutionNotRunningException
org.springframework.batch.core.JobExecution abandon(java.lang.Long jobExecutionId)
throws org.springframework.batch.core.launch.NoSuchJobExecutionException,
org.springframework.batch.core.repository.JobExecutionAlreadyRunningException
JobExecution as ABANDONED. If a stop signal is ignored
because the process died this is the best way to mark a job as finished
with (as opposed to STOPPED). An abandoned job execution can be
restarted, but a stopping one cannot.
jobExecutionId - the job execution id to abort
JobExecution that was aborted
org.springframework.batch.core.launch.NoSuchJobExecutionException
org.springframework.batch.core.repository.JobExecutionAlreadyRunningException - if the job is running (it
should be stopped first)
java.util.Collection<java.lang.String> listJobs(int start,
int count)
JobRepository.
start - the start index of the job names to returncount - the maximum number of job names to return
int countJobs()
listJobs(int, int).
org.springframework.batch.core.JobInstance getJobInstance(long jobInstanceId)
throws org.springframework.batch.core.launch.NoSuchJobInstanceException
job instance by id.
jobInstanceId - the id of the instance
job instance
org.springframework.batch.core.launch.NoSuchJobException
org.springframework.batch.core.launch.NoSuchJobInstanceException
java.util.Collection<org.springframework.batch.core.JobInstance> listJobInstances(java.lang.String jobName,
int start,
int count)
throws org.springframework.batch.core.launch.NoSuchJobException
job instances in descending order of
creation (usually close to order of execution).
jobName - the name of the jobstart - the index of the first to returncount - the maximum number of instances to return
job instances
org.springframework.batch.core.launch.NoSuchJobException
int countJobInstances(java.lang.String jobName)
throws org.springframework.batch.core.launch.NoSuchJobException
job instances in the repository
for a given job name.
jobName - the name of the job
org.springframework.batch.core.launch.NoSuchJobException
java.util.Collection<org.springframework.batch.core.JobExecution> listJobExecutionsForJob(java.lang.String jobName,
int start,
int count)
throws org.springframework.batch.core.launch.NoSuchJobException
job executions for a job in descending
order of creation (usually close to execution order).
jobName - the job namestart - the start index of the first job executioncount - the maximum number of executions to return
JobExecution
org.springframework.batch.core.launch.NoSuchJobException
int countJobExecutionsForJob(java.lang.String jobName)
throws org.springframework.batch.core.launch.NoSuchJobException
jobName - the job name
org.springframework.batch.core.launch.NoSuchJobException
java.util.Collection<org.springframework.batch.core.JobExecution> getJobExecutionsForJobInstance(java.lang.String jobName,
java.lang.Long jobInstanceId)
throws org.springframework.batch.core.launch.NoSuchJobException
jobName - the name of the jobjobInstanceId - the id of the job instance
org.springframework.batch.core.launch.NoSuchJobException
java.util.Collection<org.springframework.batch.core.JobExecution> listJobExecutions(int start,
int count)
job executions in descending order of
creation (usually close to execution order).
start - the index of the first execution to returncount - the maximum number of executions
JobExecutionint countJobExecutions()
listJobExecutions(int, int).
org.springframework.batch.core.JobExecution getJobExecution(java.lang.Long jobExecutionId)
throws org.springframework.batch.core.launch.NoSuchJobExecutionException
JobExecution by id.
jobExecutionId - the job execution id
JobExecution
org.springframework.batch.core.launch.NoSuchJobExecutionException
java.util.Collection<org.springframework.batch.core.StepExecution> getStepExecutions(java.lang.Long jobExecutionId)
throws org.springframework.batch.core.launch.NoSuchJobExecutionException
step executions for a given job execution
(by id).
jobExecutionId - the parent job execution id
org.springframework.batch.core.launch.NoSuchJobExecutionException
java.util.Collection<org.springframework.batch.core.StepExecution> listStepExecutionsForStep(java.lang.String jobName,
java.lang.String stepName,
int start,
int count)
throws org.springframework.batch.core.step.NoSuchStepException
step executions for a step in descending
order of creation (usually close to execution order).
jobName - the name of the job associated with the step (or a pattern
with wildcards)stepName - the step name (or a pattern with wildcards)start - the start index of the first executioncount - the maximum number of executions to return
StepExecution
org.springframework.batch.core.step.NoSuchStepException
int countStepExecutionsForStep(java.lang.String jobName,
java.lang.String stepName)
throws org.springframework.batch.core.step.NoSuchStepException
jobName - the job name (or a pattern with wildcards)stepName - the step name (or a pattern with wildcards)
org.springframework.batch.core.step.NoSuchStepException
org.springframework.batch.core.StepExecution getStepExecution(java.lang.Long jobExecutionId,
java.lang.Long stepExecutionId)
throws NoSuchStepExecutionException,
org.springframework.batch.core.launch.NoSuchJobExecutionException
StepExecution from its id and that of its parent
JobExecution.
jobExecutionId - the job execution idstepExecutionId - the step execution id
StepExecution
NoSuchStepExecutionException
org.springframework.batch.core.launch.NoSuchJobExecutionExceptionint stopAll()
boolean isIncrementable(java.lang.String jobName)
JobParametersIncrementer.
jobName - the job name
java.util.Collection<java.lang.String> getStepNamesForJob(java.lang.String jobName)
throws org.springframework.batch.core.launch.NoSuchJobException
jobName - the name of the job
org.springframework.batch.core.launch.NoSuchJobException - if the job name cannot be located
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||