org.springframework.cloud.dataflow.rest.client

## Class TaskTemplate

- java.lang.Object
- - org.springframework.cloud.dataflow.rest.client.TaskTemplate

- All Implemented Interfaces:
    TaskOperations

      public class TaskTemplate
      extends Object
      implements TaskOperations

  Implementation for `TaskOperations`.
  Author:
    Glenn Renfro, Michael Minella, Gunnar Hillert, David Turanski

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cleanup(long id)` Cleanup any resources associated with the execution for the id specified.
    `void` | `cleanup(long id, boolean removeData)` Cleanup any resources associated with the execution for the id specified.
    `void` | `cleanupAllTaskExecutions(boolean completed, String taskName)` Cleanup any resources associated with the matching task executions.
    `TaskDefinitionResource` | `create(String name, String definition, String description)` Create a new task definition
    `Collection<CurrentTaskExecutionsResource>` | `currentTaskExecutions()` Return information including the count of currently executing tasks and task execution limits.
    `void` | `destroy(String name)` Destroy an existing task.
    `void` | `destroy(String name, boolean cleanup)` Destroy an existing task with the flag to cleanup task resources.
    `void` | `destroyAll()` Destroy all existing tasks.
    `TaskExecutionResource.Page` | `executionList()`
    `TaskExecutionResource.Page` | `executionListByTaskName(String taskName)` List task executions known to the system filtered by task name.
    `Integer` | `getAllTaskExecutionsCount(boolean completed, String taskName)` Get the task executions count with the option to filter only the completed task executions.
    `long` | `launch(String name, Map<String,String> properties, List<String> arguments)` Launch an already created task.
    `TaskDefinitionResource.Page` | `list()`
    `LauncherResource.Page` | `listPlatforms()`
    `void` | `stop(String ids)` Request the stop of a group `TaskExecution`s.
    `void` | `stop(String ids, String platform)` Request the stop of a group `TaskExecution`s.
    `String` | `taskExecutionLog(String externalExecutionId)` Return the task execution log.
    `String` | `taskExecutionLog(String externalExecutionId, String platform)` Return the task execution log.
    `TaskExecutionResource` | `taskExecutionStatus(long id)` Return the `TaskExecutionResource` for the id specified.
    `TaskAppStatusResource` | `validateTaskDefinition(String taskDefinitionName)` Return the validation status for the tasks in an definition.

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

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

- - ### Method Detail

    - #### list

          public TaskDefinitionResource.Page list()

      Specified by:
        `list` in interface `TaskOperations`
      Returns:
        the list tasks known to the system.

    - #### listPlatforms

          public LauncherResource.Page listPlatforms()

      Specified by:
        `listPlatforms` in interface `TaskOperations`
      Returns:
        the list of platform accounts for tasks.

    - #### create

          public TaskDefinitionResource create(String name,
                                               String definition,
                                               String description)

      Description copied from interface: `TaskOperations`
      Create a new task definition
      Specified by:
        `create` in interface `TaskOperations`
      Parameters:
        `name` - the name of the task
        `definition` - the task definition DSL
        `description` - the description of the task definition
      Returns:
        the task definition

    - #### launch

          public long launch(String name,
                             Map<String,String> properties,
                             List<String> arguments)

      Description copied from interface: `TaskOperations`
      Launch an already created task.
      Specified by:
        `launch` in interface `TaskOperations`
      Parameters:
        `name` - the name of the task
        `properties` - the deployment properties
        `arguments` - the command line arguments
      Returns:
        long containing the TaskExecutionId

    - #### stop

          public void stop(String ids)

      Description copied from interface: `TaskOperations`
      Request the stop of a group `TaskExecution`s.
      Specified by:
        `stop` in interface `TaskOperations`
      Parameters:
        `ids` - comma delimited set of `TaskExecution` ids to stop.

    - #### stop

          public void stop(String ids,
                           String platform)

      Description copied from interface: `TaskOperations`
      Request the stop of a group `TaskExecution`s.
      Specified by:
        `stop` in interface `TaskOperations`
      Parameters:
        `ids` - comma delimited set of `TaskExecution` ids to stop.
        `platform` - the platform name where the task is executing.

    - #### destroy

          public void destroy(String name)

      Description copied from interface: `TaskOperations`
      Destroy an existing task.
      Specified by:
        `destroy` in interface `TaskOperations`
      Parameters:
        `name` - the name of the task

    - #### destroy

          public void destroy(String name,
                              boolean cleanup)

      Description copied from interface: `TaskOperations`
      Destroy an existing task with the flag to cleanup task resources.
      Specified by:
        `destroy` in interface `TaskOperations`
      Parameters:
        `name` - the name of the task
        `cleanup` - flag indicates task execution cleanup

    - #### destroyAll

          public void destroyAll()

      Description copied from interface: `TaskOperations`
      Destroy all existing tasks.
      Specified by:
        `destroyAll` in interface `TaskOperations`

    - #### executionList

          public TaskExecutionResource.Page executionList()

      Specified by:
        `executionList` in interface `TaskOperations`
      Returns:
        the list task executions known to the system.

    - #### executionListByTaskName

          public TaskExecutionResource.Page executionListByTaskName(String taskName)

      Description copied from interface: `TaskOperations`
      List task executions known to the system filtered by task name.
      Specified by:
        `executionListByTaskName` in interface `TaskOperations`
      Parameters:
        `taskName` - of the executions.
      Returns:
        the paged list of task executions for the given task name

    - #### taskExecutionStatus

          public TaskExecutionResource taskExecutionStatus(long id)

      Description copied from interface: `TaskOperations`
      Return the `TaskExecutionResource` for the id specified.
      Specified by:
        `taskExecutionStatus` in interface `TaskOperations`
      Parameters:
        `id` - identifier of the task execution
      Returns:
        `TaskExecutionResource`

    - #### taskExecutionLog

          public String taskExecutionLog(String externalExecutionId)

      Description copied from interface: `TaskOperations`
      Return the task execution log. The platform from which to retrieve the log will be set to `default`.
      Specified by:
        `taskExecutionLog` in interface `TaskOperations`
      Parameters:
        `externalExecutionId` - the external execution identifier of the task execution.
      Returns:
        `String` containing the log.

    - #### taskExecutionLog

          public String taskExecutionLog(String externalExecutionId,
                                         String platform)

      Description copied from interface: `TaskOperations`
      Return the task execution log.
      Specified by:
        `taskExecutionLog` in interface `TaskOperations`
      Parameters:
        `externalExecutionId` - the external execution identifier of the task execution.
        `platform` - the platform from which to obtain the log.
      Returns:
        `String` containing the log.

    - #### currentTaskExecutions

          public Collection<CurrentTaskExecutionsResource> currentTaskExecutions()

      Description copied from interface: `TaskOperations`
      Return information including the count of currently executing tasks and task execution limits.
      Specified by:
        `currentTaskExecutions` in interface `TaskOperations`
      Returns:
        Collection of `CurrentTaskExecutionsResource`

    - #### cleanup

          public void cleanup(long id)

      Description copied from interface: `TaskOperations`
      Cleanup any resources associated with the execution for the id specified.
      Specified by:
        `cleanup` in interface `TaskOperations`
      Parameters:
        `id` - identifier of the task execution

    - #### cleanup

          public void cleanup(long id,
                              boolean removeData)

      Description copied from interface: `TaskOperations`
      Cleanup any resources associated with the execution for the id specified.
      Specified by:
        `cleanup` in interface `TaskOperations`
      Parameters:
        `id` - identifier of the task execution
        `removeData` - delete the history of the execution

    - #### cleanupAllTaskExecutions

          public void cleanupAllTaskExecutions(boolean completed,
                                               String taskName)

      Description copied from interface: `TaskOperations`
      Cleanup any resources associated with the matching task executions.
      Specified by:
        `cleanupAllTaskExecutions` in interface `TaskOperations`
      Parameters:
        `completed` - cleanup only completed task executions
        `taskName` - the name of the task to cleanup, if null then all the tasks are considered.

    - #### getAllTaskExecutionsCount

          public Integer getAllTaskExecutionsCount(boolean completed,
                                                   String taskName)

      Description copied from interface: `TaskOperations`
      Get the task executions count with the option to filter only the completed task executions.
      Specified by:
        `getAllTaskExecutionsCount` in interface `TaskOperations`
      Parameters:
        `completed` - cleanup only completed task executions
        `taskName` - the name of the task to cleanup, if null then all the tasks are considered.

    - #### validateTaskDefinition

          public TaskAppStatusResource validateTaskDefinition(String taskDefinitionName)
                                                       throws OperationNotSupportedException

      Description copied from interface: `TaskOperations`
      Return the validation status for the tasks in an definition.
      Specified by:
        `validateTaskDefinition` in interface `TaskOperations`
      Parameters:
        `taskDefinitionName` - The name of the task definition to be validated.
      Returns:
        `TaskAppStatusResource` containing the task app statuses.
      Throws:
        `OperationNotSupportedException` - if the server does not support task validation

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