public class DefaultTaskJobService extends Object implements TaskJobService
| Constructor and Description | 
|---|
| DefaultTaskJobService(org.springframework.batch.admin.service.JobService jobService,
                     org.springframework.cloud.task.repository.TaskExplorer taskExplorer,
                     TaskDefinitionRepository taskDefinitionRepository,
                     TaskService taskService) | 
| Modifier and Type | Method and Description | 
|---|---|
| int | countJobExecutions()Retrieves the total number of the job executions. | 
| int | countJobExecutionsForJob(String jobName)Retrieves the total number  JobExecutionthat match a specific job name. | 
| int | countJobInstances(String jobName)Retrieves the total number of job instances for a job name. | 
| TaskJobExecution | getJobExecution(long id)Retrieves a JobExecution from the JobRepository and matches it with a task id. | 
| JobInstanceExecutions | getJobInstance(long id)Retrieves a  JobInstancefrom the JobRepository and matches it with the
 associatedJobExecutions. | 
| List<TaskJobExecution> | listJobExecutions(org.springframework.data.domain.Pageable pageable)Retrieves Pageable list of  JobExecutions from the JobRepository and matches
 the data with a task id. | 
| List<TaskJobExecution> | listJobExecutionsForJob(org.springframework.data.domain.Pageable pageable,
                       String jobName)Retrieves Pageable list of  JobExecutionfrom the JobRepository with a
 specific jobName and matches the data with a task id. | 
| List<JobInstanceExecutions> | listTaskJobInstancesForJobName(org.springframework.data.domain.Pageable pageable,
                              String jobName)Retrieves Pageable list of  JobInstanceExecutionsfrom the JobRepository
 with a specific jobName and matches the data with the associated JobExecutions. | 
| void | restartJobExecution(long jobExecutionId)Restarts a  JobExecutionIF the respectiveJobExecutionis actually
 deemed restartable. | 
| void | stopJobExecution(long jobExecutionId)Requests a  JobExecutionto stop. | 
public DefaultTaskJobService(org.springframework.batch.admin.service.JobService jobService,
                             org.springframework.cloud.task.repository.TaskExplorer taskExplorer,
                             TaskDefinitionRepository taskDefinitionRepository,
                             TaskService taskService)
public List<TaskJobExecution> listJobExecutions(org.springframework.data.domain.Pageable pageable) throws org.springframework.batch.core.launch.NoSuchJobExecutionException
JobExecutions from the JobRepository and matches
 the data with a task id.listJobExecutions in interface TaskJobServicepageable - enumerates the data to be returned.TaskJobExecutions.org.springframework.batch.core.launch.NoSuchJobExecutionException - in the event that a job execution id specified
 is not present when looking up stepExecutions for the result.public List<TaskJobExecution> listJobExecutionsForJob(org.springframework.data.domain.Pageable pageable, String jobName) throws org.springframework.batch.core.launch.NoSuchJobException
JobExecution from the JobRepository with a
 specific jobName and matches the data with a task id.listJobExecutionsForJob in interface TaskJobServicepageable - enumerates the data to be returned.jobName - the name of the job for which to search.TaskJobExecutions.org.springframework.batch.core.launch.NoSuchJobException - if the job with the given name does not exist.public TaskJobExecution getJobExecution(long id) throws org.springframework.batch.core.launch.NoSuchJobExecutionException
getJobExecution in interface TaskJobServiceid - the id of the JobExecutionTaskJobExecutions associated with the id.org.springframework.batch.core.launch.NoSuchJobExecutionException - if the specified job execution for the id does
 not exist.public List<JobInstanceExecutions> listTaskJobInstancesForJobName(org.springframework.data.domain.Pageable pageable, String jobName) throws org.springframework.batch.core.launch.NoSuchJobException
JobInstanceExecutions from the JobRepository
 with a specific jobName and matches the data with the associated JobExecutions.listTaskJobInstancesForJobName in interface TaskJobServicepageable - enumerates the data to be returned.jobName - the name of the job for which to search.JobInstanceExecutions.org.springframework.batch.core.launch.NoSuchJobException - if the job for the jobName specified does not exist.public JobInstanceExecutions getJobInstance(long id) throws org.springframework.batch.core.launch.NoSuchJobInstanceException, org.springframework.batch.core.launch.NoSuchJobException
JobInstance from the JobRepository and matches it with the
 associated JobExecutions.getJobInstance in interface TaskJobServiceid - the id of the JobInstanceJobInstanceExecutions associated with the id.org.springframework.batch.core.launch.NoSuchJobInstanceException - if job instance id does not exist.org.springframework.batch.core.launch.NoSuchJobException - if the job for the job instance does not exist.public int countJobInstances(String jobName) throws org.springframework.batch.core.launch.NoSuchJobException
countJobInstances in interface TaskJobServicejobName - the name of the job instance.org.springframework.batch.core.launch.NoSuchJobException - if the job for jobName specified does not exist.public int countJobExecutions()
countJobExecutions in interface TaskJobServicepublic int countJobExecutionsForJob(String jobName) throws org.springframework.batch.core.launch.NoSuchJobException
JobExecution that match a specific job name.countJobExecutionsForJob in interface TaskJobServicejobName - the job name to search.JobExecutions that match the job name.org.springframework.batch.core.launch.NoSuchJobException - if the job with the given name is not availablepublic void restartJobExecution(long jobExecutionId)
                         throws org.springframework.batch.core.launch.NoSuchJobExecutionException
TaskJobServiceJobExecution IF the respective JobExecution is actually
 deemed restartable. Otherwise a JobNotRestartableException is being thrown.restartJobExecution in interface TaskJobServicejobExecutionId - The id of the JobExecution to restart.org.springframework.batch.core.launch.NoSuchJobExecutionException - if the JobExecution for the provided id does
 not exist.public void stopJobExecution(long jobExecutionId)
                      throws org.springframework.batch.core.launch.NoSuchJobExecutionException,
                             org.springframework.batch.core.launch.JobExecutionNotRunningException
TaskJobServiceJobExecution to stop.
 
 Please remember, that calling this method only requests a job execution to stop
 processing. This method does not guarantee a JobExecution to stop. It is
 the responsibility of the implementor of the Job to react to that request.
 Furthermore, this method does not interfere with the associated
 TaskExecution.
stopJobExecution in interface TaskJobServicejobExecutionId - The id of the JobExecution to stoporg.springframework.batch.core.launch.NoSuchJobExecutionException - if no job execution exists for the
 jobExecutionId.org.springframework.batch.core.launch.JobExecutionNotRunningException - if a stop is requested on a job that is not
 running.JobService.stop(Long)Copyright © 2017 Pivotal Software, Inc.. All rights reserved.