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, Corneil du Plessis
  • Method Details

    • executeTask

      LaunchResponse 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.
    • findTaskManifestByIds

      Map<Long,TaskManifest> findTaskManifestByIds(Set<Long> ids)
      Parameters:
      ids - A set of task execution ids.
      Returns:
      collection of manifests mapped by the relevant task execution id.
    • 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
      Returns:
      the set of execution ids.
      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 - whether to include only completed task executions
      taskName - the task name, if null then retrieve all the tasks
      Returns:
      the number of executions
      Since:
      2.8
    • getAllTaskExecutionsCount

      Integer getAllTaskExecutionsCount(boolean onlyCompleted, String taskName, Integer includeTasksEndedMinDaysAgo)
      Returns the count of all the task execution IDs with the option to include only the completed task executions.
      Parameters:
      onlyCompleted - whether to include only completed task executions (ignored when includeTasksEndedMinDaysAgo is specified)
      taskName - the task name, if null then retrieve all the tasks
      includeTasksEndedMinDaysAgo - only include tasks that have ended at least this many days ago
      Returns:
      the number of executions, 0 if no data, never null
      Since:
      2.11.0