Interface TaskRepository

All Known Implementing Classes:
SimpleTaskRepository

public interface TaskRepository
TaskRepository interface offers methods that create and update task execution information.
Author:
Glenn Renfro, Michael Minella, Mahmoud Ben Hassine
  • Method Details

    • completeTaskExecution

      @Transactional("${spring.cloud.task.transaction-manager:springCloudTaskTransactionManager}") TaskExecution completeTaskExecution(long executionId, Integer exitCode, LocalDateTime endTime, String exitMessage)
      Notifies the repository that a taskExecution has completed.
      Parameters:
      executionId - to the task execution to be updated.
      exitCode - to be stored for this task.
      endTime - designated when the task completed.
      exitMessage - to be stored for the task.
      Returns:
      the updated TaskExecution
    • completeTaskExecution

      @Transactional("${spring.cloud.task.transaction-manager:springCloudTaskTransactionManager}") TaskExecution completeTaskExecution(long executionId, Integer exitCode, LocalDateTime endTime, String exitMessage, String errorMessage)
      Notifies the repository that a taskExecution has completed.
      Parameters:
      executionId - to the task execution to be updated.
      exitCode - to be stored for this task execution.
      endTime - designated when the task completed.
      exitMessage - to be stored for the task execution.
      errorMessage - to be stored for the task execution.
      Returns:
      the updated TaskExecution
      Since:
      1.1.0
    • createTaskExecution

      @Transactional("${spring.cloud.task.transaction-manager:springCloudTaskTransactionManager}") TaskExecution createTaskExecution(TaskExecution taskExecution)
      Notifies the repository that a taskExecution needs to be created.
      Parameters:
      taskExecution - a TaskExecution instance containing the startTime, arguments and externalExecutionId that will be stored in the repository. Only the values enumerated above will be stored for this TaskExecution.
      Returns:
      the TaskExecution that was stored in the repository. The TaskExecution's taskExecutionId will also contain the id that was used to store the TaskExecution.
    • createTaskExecution

      @Transactional("${spring.cloud.task.transaction-manager:springCloudTaskTransactionManager}") TaskExecution createTaskExecution(String name)
      Creates an empty TaskExecution with just an id and name provided. This is intended to be utilized in systems where the request of launching a task is separate from the actual start of a task (the underlying system may need to deploy the task prior to launching, etc).
      Parameters:
      name - task name to be associated with the task execution.
      Returns:
      the initial TaskExecution
    • createTaskExecution

      @Transactional("${spring.cloud.task.transaction-manager:springCloudTaskTransactionManager}") TaskExecution createTaskExecution()
      Creates an empty TaskExecution with just an id provided. This is intended to be utilized in systems where the request of launching a task is separate from the actual start of a task (the underlying system may need to deploy the task prior to launching, etc).
      Returns:
      the initial TaskExecution
    • startTaskExecution

      @Transactional("${spring.cloud.task.transaction-manager:springCloudTaskTransactionManager}") TaskExecution startTaskExecution(long executionid, String taskName, LocalDateTime startTime, List<String> arguments, String externalExecutionId)
      Notifies the repository that a taskExecution has has started.
      Parameters:
      executionid - to the task execution to be updated.
      taskName - the name that associated with the task execution.
      startTime - the time task began.
      arguments - list of key/value pairs that configure the task.
      externalExecutionId - id assigned to the task by the platform.
      Returns:
      TaskExecution created based on the parameters.
    • updateExternalExecutionId

      @Transactional("${spring.cloud.task.transaction-manager:springCloudTaskTransactionManager}") void updateExternalExecutionId(long executionid, String externalExecutionId)
      Notifies the repository to update the taskExecution's externalExecutionId.
      Parameters:
      executionid - to the task execution to be updated.
      externalExecutionId - id assigned to the task by the platform.
    • startTaskExecution

      @Transactional("${spring.cloud.task.transaction-manager:springCloudTaskTransactionManager}") TaskExecution startTaskExecution(long executionid, String taskName, LocalDateTime startTime, List<String> arguments, String externalExecutionId, Long parentExecutionId)
      Notifies the repository that a taskExecution has has started.
      Parameters:
      executionid - to the task execution to be updated.
      taskName - the name that associated with the task execution.
      startTime - the time task began.
      arguments - list of key/value pairs that configure the task.
      externalExecutionId - id assigned to the task by the platform.
      parentExecutionId - the parent task execution id.
      Returns:
      A TaskExecution that contains the information available at the beginning of a TaskExecution.