|
||||||||||
| 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 | |
|---|---|
JobExecution |
abandon(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(String jobName)
Count the job executions in the repository for a job. |
int |
countJobInstances(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(String jobName,
String stepName)
Count the step executions in the repository for a given step name (or pattern). |
JobExecution |
getJobExecution(Long jobExecutionId)
Get a JobExecution by id. |
Collection<JobExecution> |
getJobExecutionsForJobInstance(String jobName,
Long jobInstanceId)
Get all the job executions for a given job instance. |
JobInstance |
getJobInstance(long jobInstanceId)
Get a job instance by id. |
JobParameters |
getLastJobParameters(String jobName)
Get the last JobParameters used to execute a job successfully. |
StepExecution |
getStepExecution(Long jobExecutionId,
Long stepExecutionId)
Locate a StepExecution from its id and that of its parent
JobExecution. |
Collection<StepExecution> |
getStepExecutions(Long jobExecutionId)
Get the step executions for a given job execution
(by id). |
Collection<String> |
getStepNamesForJob(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(String jobName)
Check if a job has a JobParametersIncrementer. |
boolean |
isLaunchable(String jobName)
Convenience method to determine if a job is available for launching. |
JobExecution |
launch(String jobName,
JobParameters params)
Launch a job with the parameters provided. |
Collection<JobExecution> |
listJobExecutions(int start,
int count)
List the job executions in descending order of
creation (usually close to execution order). |
Collection<JobExecution> |
listJobExecutionsForJob(String jobName,
int start,
int count)
List the job executions for a job in descending
order of creation (usually close to execution order). |
Collection<JobInstance> |
listJobInstances(String jobName,
int start,
int count)
List the job instances in descending order of
creation (usually close to order of execution). |
Collection<String> |
listJobs(int start,
int count)
Query the job names in the system, either launchable or not. |
Collection<StepExecution> |
listStepExecutionsForStep(String jobName,
String stepName,
int start,
int count)
List the step executions for a step in descending
order of creation (usually close to execution order). |
JobExecution |
restart(Long jobExecutionId)
Launch a job with the parameters provided. |
JobExecution |
stop(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(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
JobExecution launch(String jobName,
JobParameters params)
throws NoSuchJobException,
JobExecutionAlreadyRunningException,
JobRestartException,
JobInstanceAlreadyCompleteException,
JobParametersInvalidException
jobName - the job nameparams - the JobParameters
JobExecution if successful
NoSuchJobException
JobExecutionAlreadyRunningException
JobRestartException
JobInstanceAlreadyCompleteException
JobParametersInvalidException
JobParameters getLastJobParameters(String jobName)
throws NoSuchJobException
JobParameters used to execute a job successfully.
jobName - the name of the job
NoSuchJobException
JobExecution restart(Long jobExecutionId)
throws NoSuchJobExecutionException,
JobExecutionAlreadyRunningException,
JobRestartException,
JobInstanceAlreadyCompleteException,
NoSuchJobException,
JobParametersInvalidException
jobExecutionId - the job execution to restart
JobExecution if successful
NoSuchJobExecutionException
JobExecutionAlreadyRunningException
JobRestartException
JobInstanceAlreadyCompleteException
NoSuchJobException
JobParametersInvalidException
JobExecution stop(Long jobExecutionId)
throws NoSuchJobExecutionException,
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
NoSuchJobExecutionException
JobExecutionNotRunningException
JobExecution abandon(Long jobExecutionId)
throws NoSuchJobExecutionException,
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
NoSuchJobExecutionException
JobExecutionAlreadyRunningException - if the job is running (it
should be stopped first)
Collection<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).
JobInstance getJobInstance(long jobInstanceId)
throws NoSuchJobInstanceException
job instance by id.
jobInstanceId - the id of the instance
job instance
NoSuchJobException
NoSuchJobInstanceException
Collection<JobInstance> listJobInstances(String jobName,
int start,
int count)
throws 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
NoSuchJobException
int countJobInstances(String jobName)
throws NoSuchJobException
job instances in the repository
for a given job name.
jobName - the name of the job
NoSuchJobException
Collection<JobExecution> listJobExecutionsForJob(String jobName,
int start,
int count)
throws 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
NoSuchJobException
int countJobExecutionsForJob(String jobName)
throws NoSuchJobException
jobName - the job name
NoSuchJobException
Collection<JobExecution> getJobExecutionsForJobInstance(String jobName,
Long jobInstanceId)
throws NoSuchJobException
jobName - the name of the jobjobInstanceId - the id of the job instance
NoSuchJobException
Collection<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).
JobExecution getJobExecution(Long jobExecutionId)
throws NoSuchJobExecutionException
JobExecution by id.
jobExecutionId - the job execution id
JobExecution
NoSuchJobExecutionException
Collection<StepExecution> getStepExecutions(Long jobExecutionId)
throws NoSuchJobExecutionException
step executions for a given job execution
(by id).
jobExecutionId - the parent job execution id
NoSuchJobExecutionException
Collection<StepExecution> listStepExecutionsForStep(String jobName,
String stepName,
int start,
int count)
throws 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
NoSuchStepException
int countStepExecutionsForStep(String jobName,
String stepName)
throws NoSuchStepException
jobName - the job name (or a pattern with wildcards)stepName - the step name (or a pattern with wildcards)
NoSuchStepException
StepExecution getStepExecution(Long jobExecutionId,
Long stepExecutionId)
throws NoSuchStepExecutionException,
NoSuchJobExecutionException
StepExecution from its id and that of its parent
JobExecution.
jobExecutionId - the job execution idstepExecutionId - the step execution id
StepExecution
NoSuchStepExecutionException
NoSuchJobExecutionExceptionint stopAll()
boolean isIncrementable(String jobName)
JobParametersIncrementer.
jobName - the job name
Collection<String> getStepNamesForJob(String jobName)
throws NoSuchJobException
jobName - the name of the job
NoSuchJobException - if the job name cannot be located
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||