@Transactional public class DefaultTaskJobService extends Object implements TaskJobService
Constructor and Description |
---|
DefaultTaskJobService(JobServiceContainer jobServiceContainer,
org.springframework.cloud.dataflow.aggregate.task.AggregateTaskExplorer taskExplorer,
TaskDefinitionRepository taskDefinitionRepository,
TaskExecutionService taskExecutionService,
LauncherRepository launcherRepository,
org.springframework.cloud.dataflow.aggregate.task.AggregateExecutionSupport aggregateExecutionSupport,
AggregateJobQueryDao aggregateJobQueryDao,
org.springframework.cloud.dataflow.aggregate.task.TaskDefinitionReader taskDefinitionReader) |
Modifier and Type | Method and Description |
---|---|
TaskJobExecution |
getJobExecution(long id,
String schemaTarget)
Retrieves a JobExecution from the JobRepository and matches it with a task id.
|
JobInstanceExecutions |
getJobInstance(long id,
String schemaTarget)
Retrieves a
JobInstance from the JobRepository and matches it with the
associated JobExecution s. |
org.springframework.data.domain.Page<TaskJobExecution> |
listJobExecutions(org.springframework.data.domain.Pageable pageable)
Retrieves Pageable list of
JobExecution s from the JobRepository and matches the
data with a task id. |
org.springframework.data.domain.Page<TaskJobExecution> |
listJobExecutionsForJob(org.springframework.data.domain.Pageable pageable,
String jobName,
org.springframework.batch.core.BatchStatus status)
Retrieves Pageable list of
JobExecution from the JobRepository with a specific
jobName, status and matches the data with a task id. |
org.springframework.data.domain.Page<TaskJobExecution> |
listJobExecutionsForJobWithStepCount(org.springframework.data.domain.Pageable pageable,
Date fromDate,
Date toDate)
Retrieves Pageable list of
JobExecutionWithStepCount from the JobRepository
filtered by the date range. |
org.springframework.data.domain.Page<TaskJobExecution> |
listJobExecutionsForJobWithStepCount(org.springframework.data.domain.Pageable pageable,
String jobName)
Retrieves Pageable list of
JobExecutionWithStepCount from the JobRepository
with a specific jobName and matches the data with a task id. |
org.springframework.data.domain.Page<TaskJobExecution> |
listJobExecutionsForJobWithStepCountFilteredByJobInstanceId(org.springframework.data.domain.Pageable pageable,
int jobInstanceId,
String schemaTarget)
Retrieves Pageable list of
JobExecutionWithStepCount from the JobRepository
filtered by the job instance id. |
org.springframework.data.domain.Page<TaskJobExecution> |
listJobExecutionsForJobWithStepCountFilteredByTaskExecutionId(org.springframework.data.domain.Pageable pageable,
int taskExecutionId,
String schemaTarget)
Retrieves Pageable list of
JobExecutionWithStepCount from the JobRepository
filtered by the task execution id. |
org.springframework.data.domain.Page<TaskJobExecution> |
listJobExecutionsWithStepCount(org.springframework.data.domain.Pageable pageable)
Retrieves Pageable list of
JobExecutionWithStepCount s from the JobRepository
and matches the data with a task id but excludes the step executions. |
org.springframework.data.domain.Page<JobInstanceExecutions> |
listTaskJobInstancesForJobName(org.springframework.data.domain.Pageable pageable,
String jobName)
Retrieves Pageable list of
JobInstanceExecutions from the JobRepository with a
specific jobName and matches the data with the associated JobExecutions. |
void |
restartJobExecution(long jobExecutionId,
String schemaTarget)
Restarts a
JobExecution IF the respective JobExecution is actually
deemed restartable. |
void |
stopJobExecution(long jobExecutionId,
String schemaTarget)
Requests a
JobExecution to stop. |
public DefaultTaskJobService(JobServiceContainer jobServiceContainer, org.springframework.cloud.dataflow.aggregate.task.AggregateTaskExplorer taskExplorer, TaskDefinitionRepository taskDefinitionRepository, TaskExecutionService taskExecutionService, LauncherRepository launcherRepository, org.springframework.cloud.dataflow.aggregate.task.AggregateExecutionSupport aggregateExecutionSupport, AggregateJobQueryDao aggregateJobQueryDao, org.springframework.cloud.dataflow.aggregate.task.TaskDefinitionReader taskDefinitionReader)
public org.springframework.data.domain.Page<TaskJobExecution> listJobExecutions(org.springframework.data.domain.Pageable pageable) throws org.springframework.batch.core.launch.NoSuchJobExecutionException
TaskJobService
JobExecution
s from the JobRepository and matches the
data with a task id.listJobExecutions
in interface TaskJobService
pageable
- enumerates the data to be returned.TaskJobExecution
s.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 org.springframework.data.domain.Page<TaskJobExecution> listJobExecutionsWithStepCount(org.springframework.data.domain.Pageable pageable)
TaskJobService
JobExecutionWithStepCount
s from the JobRepository
and matches the data with a task id but excludes the step executions.listJobExecutionsWithStepCount
in interface TaskJobService
pageable
- enumerates the data to be returned.TaskJobExecution
s.public 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
TaskJobService
JobExecution
from the JobRepository with a specific
jobName, status and matches the data with a task id.listJobExecutionsForJob
in interface TaskJobService
pageable
- enumerates the data to be returned.jobName
- the name of the job for which to findByTaskNameContains.status
- the BatchStatus of the job execution.TaskJobExecution
s.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.public org.springframework.data.domain.Page<TaskJobExecution> listJobExecutionsForJobWithStepCount(org.springframework.data.domain.Pageable pageable, Date fromDate, Date toDate)
TaskJobService
JobExecutionWithStepCount
from the JobRepository
filtered by the date range.listJobExecutionsForJobWithStepCount
in interface TaskJobService
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.JobExecutionWithStepCount
s.public org.springframework.data.domain.Page<TaskJobExecution> listJobExecutionsForJobWithStepCountFilteredByJobInstanceId(org.springframework.data.domain.Pageable pageable, int jobInstanceId, String schemaTarget)
TaskJobService
JobExecutionWithStepCount
from the JobRepository
filtered by the job instance id.listJobExecutionsForJobWithStepCountFilteredByJobInstanceId
in interface TaskJobService
pageable
- enumerates the data to be returned.jobInstanceId
- the job instance id associated with the execution.schemaTarget
- the schema target of the job instance.JobExecutionWithStepCount
s.public org.springframework.data.domain.Page<TaskJobExecution> listJobExecutionsForJobWithStepCountFilteredByTaskExecutionId(org.springframework.data.domain.Pageable pageable, int taskExecutionId, String schemaTarget)
TaskJobService
JobExecutionWithStepCount
from the JobRepository
filtered by the task execution id.listJobExecutionsForJobWithStepCountFilteredByTaskExecutionId
in interface TaskJobService
pageable
- enumerates the data to be returned.taskExecutionId
- the task execution id associated with the execution.schemaTarget
- the schema target of the task execution.JobExecutionWithStepCount
s.public org.springframework.data.domain.Page<TaskJobExecution> listJobExecutionsForJobWithStepCount(org.springframework.data.domain.Pageable pageable, String jobName) throws org.springframework.batch.core.launch.NoSuchJobException
TaskJobService
JobExecutionWithStepCount
from the JobRepository
with a specific jobName and matches the data with a task id.listJobExecutionsForJobWithStepCount
in interface TaskJobService
pageable
- enumerates the data to be returned.jobName
- the name of the job for which to findByTaskNameContains.JobExecutionWithStepCount
s.org.springframework.batch.core.launch.NoSuchJobException
- if the job with the given name does not exist.public TaskJobExecution getJobExecution(long id, String schemaTarget) throws org.springframework.batch.core.launch.NoSuchJobExecutionException
TaskJobService
getJobExecution
in interface TaskJobService
id
- the id of the JobExecution
schemaTarget
- the schema target of the task job execution.TaskJobExecution
s associated with the id.org.springframework.batch.core.launch.NoSuchJobExecutionException
- if the specified job execution for the id does not
exist.public org.springframework.data.domain.Page<JobInstanceExecutions> listTaskJobInstancesForJobName(org.springframework.data.domain.Pageable pageable, String jobName)
TaskJobService
JobInstanceExecutions
from the JobRepository with a
specific jobName and matches the data with the associated JobExecutions.listTaskJobInstancesForJobName
in interface TaskJobService
pageable
- enumerates the data to be returned.jobName
- the name of the job for which to findByTaskNameContains.JobInstanceExecutions
.public JobInstanceExecutions getJobInstance(long id, String schemaTarget) throws org.springframework.batch.core.launch.NoSuchJobInstanceException, org.springframework.batch.core.launch.NoSuchJobException
TaskJobService
JobInstance
from the JobRepository and matches it with the
associated JobExecution
s.getJobInstance
in interface TaskJobService
id
- the id of the JobInstance
schemaTarget
- the schema target of the job instance.JobInstanceExecutions
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 void restartJobExecution(long jobExecutionId, String schemaTarget) throws org.springframework.batch.core.launch.NoSuchJobExecutionException
TaskJobService
JobExecution
IF the respective JobExecution
is actually
deemed restartable. Otherwise a JobNotRestartableException
is being thrown.restartJobExecution
in interface TaskJobService
jobExecutionId
- The id of the JobExecution to restart.schemaTarget
- the schema target of the job execution.org.springframework.batch.core.launch.NoSuchJobExecutionException
- if the JobExecution for the provided id does not
exist.public void stopJobExecution(long jobExecutionId, String schemaTarget) throws org.springframework.batch.core.launch.NoSuchJobExecutionException, org.springframework.batch.core.launch.JobExecutionNotRunningException
TaskJobService
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
.
stopJobExecution
in interface TaskJobService
jobExecutionId
- The id of the JobExecution
to stop.schemaTarget
- the schema target of the job execution.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.JobService.stop(Long)
Copyright © 2023 Pivotal Software, Inc.. All rights reserved.