org.springframework.cloud.dataflow.server.service.impl

## Class DefaultTaskDeleteService

- java.lang.Object
- - org.springframework.cloud.dataflow.server.service.impl.DefaultTaskDeleteService

- All Implemented Interfaces:
    TaskDeleteService

      public class DefaultTaskDeleteService
      extends Object
      implements 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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected org.springframework.cloud.dataflow.audit.service.AuditRecordService` | `auditRecordService`
    `protected DataflowJobExecutionDao` | `dataflowJobExecutionDao`
    `protected DataflowTaskExecutionDao` | `dataflowTaskExecutionDao`
    `protected DataflowTaskExecutionMetadataDao` | `dataflowTaskExecutionMetadataDao`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultTaskDeleteService(org.springframework.cloud.task.repository.TaskExplorer taskExplorer, LauncherRepository launcherRepository, TaskDefinitionRepository taskDefinitionRepository, TaskDeploymentRepository taskDeploymentRepository, org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService, DataflowTaskExecutionDao dataflowTaskExecutionDao, DataflowJobExecutionDao dataflowJobExecutionDao, DataflowTaskExecutionMetadataDao dataflowTaskExecutionMetadataDao, SchedulerService schedulerService)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cleanupExecution(long id)` Cleanup the resources that resulted from running the task with the given execution id.
    `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` | `deleteAll()` Destroy all task definitions.
    `void` | `deleteTaskDefinition(String name)` Destroy the task definition.
    `void` | `deleteTaskDefinition(String name, boolean cleanup)` Destroy the task definition.
    `void` | `deleteTaskExecutions(Set<Long> taskExecutionIds)` Delete one or more Task executions.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### auditRecordService

          protected final org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService

    - #### dataflowTaskExecutionDao

          protected final DataflowTaskExecutionDao dataflowTaskExecutionDao

    - #### dataflowJobExecutionDao

          protected final DataflowJobExecutionDao dataflowJobExecutionDao

    - #### dataflowTaskExecutionMetadataDao

          protected final DataflowTaskExecutionMetadataDao dataflowTaskExecutionMetadataDao

  - ### Constructor Detail

    - #### DefaultTaskDeleteService

          public DefaultTaskDeleteService(org.springframework.cloud.task.repository.TaskExplorer taskExplorer,
                                          LauncherRepository launcherRepository,
                                          TaskDefinitionRepository taskDefinitionRepository,
                                          TaskDeploymentRepository taskDeploymentRepository,
                                          org.springframework.cloud.dataflow.audit.service.AuditRecordService auditRecordService,
                                          DataflowTaskExecutionDao dataflowTaskExecutionDao,
                                          DataflowJobExecutionDao dataflowJobExecutionDao,
                                          DataflowTaskExecutionMetadataDao dataflowTaskExecutionMetadataDao,
                                          SchedulerService schedulerService)

  - ### Method Detail

    - #### cleanupExecution

          public void cleanupExecution(long id)

      Description copied from interface: `TaskDeleteService`
      Cleanup the resources that resulted from running the task with the given execution id.
      Specified by:
        `cleanupExecution` in interface `TaskDeleteService`
      Parameters:
        `id` - the execution id

    - #### cleanupExecutions

          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 interface `TaskDeleteService`
      Parameters:
        `actionsAsSet` - the actions
        `ids` - the id's

    - #### deleteTaskExecutions

          @Transactional
          public void deleteTaskExecutions(Set<Long> taskExecutionIds)

      Description copied from interface: `TaskDeleteService`
      Delete one or more Task executions.
      Specified by:
        `deleteTaskExecutions` in interface `TaskDeleteService`
      Parameters:
        `taskExecutionIds` - Collection of task execution ids to delete. Must contain at least 1 id.

    - #### deleteTaskDefinition

          public void deleteTaskDefinition(String name)

      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 interface `TaskDeleteService`
      Parameters:
        `name` - The name of the task.

    - #### deleteTaskDefinition

          public void deleteTaskDefinition(String name,
                                           boolean cleanup)

      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 interface `TaskDeleteService`
      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 interface `TaskDeleteService`

Copyright © 2021 Pivotal Software, Inc.. All rights reserved.