org.springframework.cloud.dataflow.server.service

## Interface TaskExecutionService

- All Known Implementing Classes:
    DefaultTaskExecutionService

      public interface TaskExecutionService

  Provides Task related services.
  Author:
    Michael Minella, Marius Bogoevici, Glenn Renfro, Mark Fisher, Janne Valkealahti, Gunnar Hillert, David Turanski, Daniel Serleg

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `executeTask(String taskName, Map<String,String> taskDeploymentProperties, List<String> commandLineArgs)` Execute a task with the provided task name and optional runtime properties.
    `TaskManifest` | `findTaskManifestById(Long id)` Retrieve the TaskManifest for the execution id provided
    `Set<Long>` | `getAllTaskExecutionIds(boolean onlyCompleted, String taskName)` Returns all the task execution IDs with the option to include only the completed task executions.
    `Integer` | `getAllTaskExecutionsCount(boolean onlyCompleted, String taskName)` Returns the count of all the task execution IDs with the option to include only the completed task executions.
    `String` | `getLog(String platformName, String taskId)` Retrieve logs for the task application.
    `void` | `stopTaskExecution(Set<Long> ids)` Request the platform to stop the task executions for the ids provided.
    `void` | `stopTaskExecution(Set<Long> ids, String platform)` Request the platform to stop the task executions for the ids provided.

- - ### Method Detail

    - #### executeTask

          long executeTask(String taskName,
                           Map<String,String> taskDeploymentProperties,
                           List<String> commandLineArgs)

      Execute a task with the provided task name and optional runtime properties.
      Parameters:
        `taskName` - Name of the task. Must not be null or empty.
        `taskDeploymentProperties` - Optional deployment properties. Must not be null.
        `commandLineArgs` - Optional runtime commandline argument
      Returns:
        the taskExecutionId for the executed task.

    - #### getLog

          String getLog(String platformName,
                        String taskId)

      Retrieve logs for the task application.
      Parameters:
        `platformName` - the name of the platform
        `taskId` - the ID that uniquely identifies the task
      Returns:
        the logs of the task application.

    - #### stopTaskExecution

          void stopTaskExecution(Set<Long> ids)

      Request the platform to stop the task executions for the ids provided.
      Parameters:
        `ids` - a set of ids for the task executions to be stopped.

    - #### stopTaskExecution

          void stopTaskExecution(Set<Long> ids,
                                 String platform)

      Request the platform to stop the task executions for the ids provided.
      Parameters:
        `ids` - a set of ids for the task executions to be stopped.
        `platform` - The name of the platform where the tasks are executing.

    - #### findTaskManifestById

          TaskManifest findTaskManifestById(Long id)

      Retrieve the TaskManifest for the execution id provided
      Parameters:
        `id` - task exectution id
      Returns:
        `TaskManifest` or null if not found.

    - #### getAllTaskExecutionIds

          Set<Long> getAllTaskExecutionIds(boolean onlyCompleted,
                                           String taskName)

      Returns all the task execution IDs with the option to include only the completed task executions.
      Parameters:
        `onlyCompleted` - filter by completed task executions
        `taskName` - the task name, if null then retrieve all the tasks
      Since:
        2.8

    - #### getAllTaskExecutionsCount

          Integer getAllTaskExecutionsCount(boolean onlyCompleted,
                                            String taskName)

      Returns the count of all the task execution IDs with the option to include only the completed task executions.
      Parameters:
        `onlyCompleted` - filter by completed task executions
        `taskName` - the task name, if null then retrieve all the tasks
      Since:
        2.8

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