Class DefaultTaskDeleteService
java.lang.Object
org.springframework.cloud.dataflow.server.service.impl.DefaultTaskDeleteService
- All Implemented Interfaces:
TaskDeleteService
Default implementation of the
TaskDeleteService
interface. Provide service
methods for Task deletion.- Author:
- Michael Minella, Marius Bogoevici, Glenn Renfro, Mark Fisher, Janne Valkealahti, Gunnar Hillert, Thomas Risberg, Ilayaperumal Gopinathan, Michael Wirth, David Turanski, Daniel Serleg, Corneil du Plessis, Joe O'Brien
-
Field Summary
Modifier and TypeFieldDescriptionprotected final org.springframework.cloud.dataflow.audit.service.AuditRecordService
protected final DataflowJobExecutionDao
protected final DataflowTaskExecutionDao
protected final DataflowTaskExecutionMetadataDao
-
Constructor Summary
ConstructorDescriptionDefaultTaskDeleteService
(DataflowTaskExplorer taskExplorer, LauncherRepository launcherRepository, TaskDefinitionRepository taskDefinitionRepository, TaskDeploymentRepository taskDeploymentRepository, org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService, DataflowTaskExecutionDao dataflowTaskExecutionDao, DataflowJobExecutionDao dataflowJobExecutionDao, DataflowTaskExecutionMetadataDao dataflowTaskExecutionMetadataDao, SchedulerService schedulerService, TaskConfigurationProperties taskConfigurationProperties, DataSource dataSource) -
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanupExecution
(long id) Cleanup the resources that resulted from running the task with the given execution id.void
cleanupExecutions
(Set<TaskExecutionControllerDeleteAction> actionsAsSet, String taskName, boolean completed) Clean up the resources that resulted from running the task with the given name.void
cleanupExecutions
(Set<TaskExecutionControllerDeleteAction> actionsAsSet, String taskName, boolean completed, Integer days) Clean up the resources that resulted from running the task with the given name.void
cleanupExecutions
(Set<TaskExecutionControllerDeleteAction> actionsAsSet, Set<Long> ids) Cleanup the resources that resulted from running the task with the given execution ids and actions.void
Destroy all task definitions.void
deleteTaskDefinition
(String name) Destroy the task definition.void
deleteTaskDefinition
(String name, boolean cleanup) Destroy the task definition.void
deleteTaskExecutions
(String taskName, boolean onlyCompleted) Delete task executions by name and execution state.void
deleteTaskExecutions
(Set<Long> taskExecutionIds) Delete one or more Task executions.
-
Field Details
-
auditRecordService
protected final org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService -
dataflowTaskExecutionDao
-
dataflowJobExecutionDao
-
dataflowTaskExecutionMetadataDao
-
-
Constructor Details
-
DefaultTaskDeleteService
public DefaultTaskDeleteService(DataflowTaskExplorer taskExplorer, LauncherRepository launcherRepository, TaskDefinitionRepository taskDefinitionRepository, TaskDeploymentRepository taskDeploymentRepository, org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService, DataflowTaskExecutionDao dataflowTaskExecutionDao, DataflowJobExecutionDao dataflowJobExecutionDao, DataflowTaskExecutionMetadataDao dataflowTaskExecutionMetadataDao, SchedulerService schedulerService, TaskConfigurationProperties taskConfigurationProperties, DataSource dataSource)
-
-
Method Details
-
cleanupExecution
Description copied from interface:TaskDeleteService
Cleanup the resources that resulted from running the task with the given execution id.- Specified by:
cleanupExecution
in interfaceTaskDeleteService
- Parameters:
id
- the execution id
-
cleanupExecutions
@Transactional public void cleanupExecutions(Set<TaskExecutionControllerDeleteAction> actionsAsSet, String taskName, boolean completed) Description copied from interface:TaskDeleteService
Clean up the resources that resulted from running the task with the given name.- Specified by:
cleanupExecutions
in interfaceTaskDeleteService
- Parameters:
actionsAsSet
- the actions to performtaskName
- the task namecompleted
- whether to include only completed tasks
-
cleanupExecutions
@Transactional public void cleanupExecutions(Set<TaskExecutionControllerDeleteAction> actionsAsSet, String taskName, boolean completed, Integer days) Description copied from interface:TaskDeleteService
Clean up the resources that resulted from running the task with the given name.- Specified by:
cleanupExecutions
in interfaceTaskDeleteService
- Parameters:
actionsAsSet
- the actions to performtaskName
- the task namecompleted
- whether to include only completed tasks (ignored whenincludeTasksEndedMinDaysAgo
is specified)days
- only include tasks that have ended at least this many days ago
-
cleanupExecutions
@Transactional public void cleanupExecutions(Set<TaskExecutionControllerDeleteAction> actionsAsSet, Set<Long> ids) Description copied from interface:TaskDeleteService
Cleanup the resources that resulted from running the task with the given execution ids and actions.- Specified by:
cleanupExecutions
in interfaceTaskDeleteService
- Parameters:
actionsAsSet
- the actionsids
- the id's
-
deleteTaskExecutions
Description copied from interface:TaskDeleteService
Delete one or more Task executions.- Specified by:
deleteTaskExecutions
in interfaceTaskDeleteService
- Parameters:
taskExecutionIds
- Collection of task execution ids to delete. Must contain at least 1 id.
-
deleteTaskExecutions
Description copied from interface:TaskDeleteService
Delete task executions by name and execution state.- Specified by:
deleteTaskExecutions
in interfaceTaskDeleteService
- Parameters:
taskName
- the name of the task executionsonlyCompleted
- indicator to delete only completed tasks
-
deleteTaskDefinition
Description copied from interface:TaskDeleteService
Destroy the task definition. If it is a Composed Task then the task definitions required for a ComposedTaskRunner task are also destroyed.- Specified by:
deleteTaskDefinition
in interfaceTaskDeleteService
- Parameters:
name
- The name of the task.
-
deleteTaskDefinition
Description copied from interface:TaskDeleteService
Destroy the task definition. If it is a Composed Task then the task definitions required for a ComposedTaskRunner task are also destroyed. If the cleanup flag is set to true, delete all the task executions associated with the task definition.- Specified by:
deleteTaskDefinition
in interfaceTaskDeleteService
- Parameters:
name
- The name of the task.cleanup
- the flag to indicate the cleanup of the task executions for the task definition.
-
deleteAll
public void deleteAll()Description copied from interface:TaskDeleteService
Destroy all task definitions. If it is a Composed Task then the task definitions required for a ComposedTaskRunner tasks are also destroyed.- Specified by:
deleteAll
in interfaceTaskDeleteService
-