Interface TaskJobService

All Known Implementing Classes:
DefaultTaskJobService

public interface TaskJobService
Repository that retrieves Tasks and JobExecutions/Instances and the associations between them.
Author:
Glenn Renfro., Gunnar Hillert, Corneil du Plessis
  • Method Details

    • listJobExecutions

      org.springframework.data.domain.Page<TaskJobExecution> listJobExecutions(org.springframework.data.domain.Pageable pageable) throws org.springframework.batch.core.launch.NoSuchJobExecutionException
      Retrieves Pageable list of JobExecutions from the JobRepository and matches the data with a task id.
      Parameters:
      pageable - enumerates the data to be returned.
      Returns:
      List containing TaskJobExecutions.
      Throws:
      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.
    • listJobExecutionsForJobWithStepCount

      org.springframework.data.domain.Page<TaskJobExecution> listJobExecutionsForJobWithStepCount(org.springframework.data.domain.Pageable pageable, String jobName) throws org.springframework.batch.core.launch.NoSuchJobException
      Retrieves Pageable list of JobExecutionWithStepCount from the JobRepository with a specific jobName and matches the data with a task id.
      Parameters:
      pageable - enumerates the data to be returned.
      jobName - the name of the job for which to findByTaskNameContains.
      Returns:
      List containing JobExecutionWithStepCounts.
      Throws:
      org.springframework.batch.core.launch.NoSuchJobException - if the job with the given name does not exist.
    • getJobExecution

      TaskJobExecution getJobExecution(long id) throws org.springframework.batch.core.launch.NoSuchJobExecutionException
      Retrieves a JobExecution from the JobRepository and matches it with a task id.
      Parameters:
      id - the id of the JobExecution
      Returns:
      the TaskJobExecutions associated with the id.
      Throws:
      org.springframework.batch.core.launch.NoSuchJobExecutionException - if the specified job execution for the id does not exist.
    • listTaskJobInstancesForJobName

      org.springframework.data.domain.Page<JobInstanceExecutions> listTaskJobInstancesForJobName(org.springframework.data.domain.Pageable pageable, String jobName) throws org.springframework.batch.core.launch.NoSuchJobException
      Retrieves Pageable list of JobInstanceExecutions from the JobRepository with a specific jobName and matches the data with the associated JobExecutions.
      Parameters:
      pageable - enumerates the data to be returned.
      jobName - the name of the job for which to findByTaskNameContains.
      Returns:
      List containing JobInstanceExecutions.
      Throws:
      org.springframework.batch.core.launch.NoSuchJobException - if the job for the jobName specified does not exist.
    • getJobInstance

      JobInstanceExecutions getJobInstance(long id) throws org.springframework.batch.core.launch.NoSuchJobInstanceException, org.springframework.batch.core.launch.NoSuchJobException
      Retrieves a JobInstance from the JobRepository and matches it with the associated JobExecutions.
      Parameters:
      id - the id of the JobInstance
      Returns:
      the JobInstanceExecutions associated with the id.
      Throws:
      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.
    • restartJobExecution

      void restartJobExecution(long jobExecutionId) throws org.springframework.batch.core.launch.NoSuchJobExecutionException
      Restarts a JobExecution if the respective JobExecution is actually deemed restartable. Otherwise a JobNotRestartableException is being thrown. The system will use TaskConfigurationProperties.isUseJsonJobParameters() to determine the JobParameter serializer.
      Parameters:
      jobExecutionId - The id of the JobExecution to restart.
      Throws:
      org.springframework.batch.core.launch.NoSuchJobExecutionException - if the JobExecution for the provided id does not exist.
    • restartJobExecution

      void restartJobExecution(long jobExecutionId, Boolean useJsonJobParameters) throws org.springframework.batch.core.launch.NoSuchJobExecutionException
      Restarts a JobExecution if the respective JobExecution is actually deemed restartable. Otherwise, a JobNotRestartableException is being thrown.
      Parameters:
      jobExecutionId - The id of the JobExecution to restart.
      useJsonJobParameters - if set to true, dataflow will serialize job parameters to the command line using the format provided by JsonJobParametersConverter. If set to false dataflow will use DefaultParametersConverter. If null dataflow will use TaskConfigurationProperties.isUseJsonJobParameters() to determine the JobParameter serializer.
      Throws:
      org.springframework.batch.core.launch.NoSuchJobExecutionException - if the JobExecution for the provided id does not exist.
    • stopJobExecution

      void stopJobExecution(long jobExecutionId) throws org.springframework.batch.core.launch.NoSuchJobExecutionException, org.springframework.batch.core.launch.JobExecutionNotRunningException
      Requests a JobExecution 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.

      Parameters:
      jobExecutionId - The id of the JobExecution to stop.
      Throws:
      org.springframework.batch.core.launch.NoSuchJobExecutionException - thrown if no job execution exists for the jobExecutionId.
      org.springframework.batch.core.launch.JobExecutionNotRunningException - thrown if a stop is requested on a job that is not running.
      See Also:
    • listJobExecutionsWithStepCount

      org.springframework.data.domain.Page<TaskJobExecution> listJobExecutionsWithStepCount(org.springframework.data.domain.Pageable pageable) throws org.springframework.batch.core.launch.NoSuchJobExecutionException
      Retrieves Pageable list of JobExecutionWithStepCounts from the JobRepository and matches the data with a task id but excludes the step executions.
      Parameters:
      pageable - enumerates the data to be returned.
      Returns:
      List containing TaskJobExecutions.
      Throws:
      org.springframework.batch.core.launch.NoSuchJobExecutionException - thrown if the job execution specified does not exist.
    • listJobExecutionsForJob

      org.springframework.data.domain.Page<TaskJobExecution> listJobExecutionsForJob(org.springframework.data.domain.Pageable pageable, String jobName, org.springframework.batch.core.BatchStatus status) throws org.springframework.batch.core.launch.NoSuchJobException, org.springframework.batch.core.launch.NoSuchJobExecutionException
      Retrieves Pageable list of JobExecution from the JobRepository with a specific jobName, status and matches the data with a task id.
      Parameters:
      pageable - enumerates the data to be returned.
      jobName - the name of the job for which to findByTaskNameContains.
      status - the BatchStatus of the job execution.
      Returns:
      List containing TaskJobExecutions.
      Throws:
      org.springframework.batch.core.launch.NoSuchJobException - if the job with the given name does not exist.
      org.springframework.batch.core.launch.NoSuchJobExecutionException - the job execution with the given name doesn't exist.
    • listJobExecutionsForJobWithStepCount

      org.springframework.data.domain.Page<TaskJobExecution> listJobExecutionsForJobWithStepCount(org.springframework.data.domain.Pageable pageable, Date fromDate, Date toDate) throws org.springframework.batch.core.launch.NoSuchJobException
      Retrieves Pageable list of JobExecutionWithStepCount from the JobRepository filtered by the date range.
      Parameters:
      pageable - enumerates the data to be returned.
      fromDate - the date which start date must be greater than.
      toDate - the date which start date must be less than.
      Returns:
      List containing JobExecutionWithStepCounts.
      Throws:
      org.springframework.batch.core.launch.NoSuchJobException - if the job with the given name does not exist.
    • listJobExecutionsForJobWithStepCountFilteredByJobInstanceId

      org.springframework.data.domain.Page<TaskJobExecution> listJobExecutionsForJobWithStepCountFilteredByJobInstanceId(org.springframework.data.domain.Pageable pageable, int jobInstanceId) throws org.springframework.batch.core.launch.NoSuchJobException
      Retrieves Pageable list of JobExecutionWithStepCount from the JobRepository filtered by the job instance id.
      Parameters:
      pageable - enumerates the data to be returned.
      jobInstanceId - the job instance id associated with the execution.
      Returns:
      List containing JobExecutionWithStepCounts.
      Throws:
      org.springframework.batch.core.launch.NoSuchJobException - if the job with the given name does not exist.
    • listJobExecutionsForJobWithStepCountFilteredByTaskExecutionId

      org.springframework.data.domain.Page<TaskJobExecution> listJobExecutionsForJobWithStepCountFilteredByTaskExecutionId(org.springframework.data.domain.Pageable pageable, int taskExecutionId) throws org.springframework.batch.core.launch.NoSuchJobException
      Retrieves Pageable list of JobExecutionWithStepCount from the JobRepository filtered by the task execution id.
      Parameters:
      pageable - enumerates the data to be returned.
      taskExecutionId - the task execution id associated with the execution.
      Returns:
      List containing JobExecutionWithStepCounts.
      Throws:
      org.springframework.batch.core.launch.NoSuchJobException - if the job with the given name does not exist.
    • getJobExecutionIdsByTaskExecutionIds

      Map<Long,Set<Long>> getJobExecutionIdsByTaskExecutionIds(Collection<Long> taskExecutionIds)