Interface TaskAbortContext

All Known Subinterfaces:
TaskExecutionContext

public interface TaskAbortContext
The read-only view of a task that TaskExecutorExtension.onAbort(com.xebialabs.xlrelease.osgi.api.tasks.TaskAbortContext) receives — everything an extension may need to release external resources (correlation ids it stored in output properties, connection details from input properties), and nothing it could mutate: the task is already failed by the time this is called, so writes would have nowhere to go.

TaskExecutionContext extends this interface, so the read methods behave identically during execution and during abort notification.

  • Method Details

    • getTaskId

      String getTaskId()
      The id of the task — useful for logging and for correlating with an external system.
    • getReleaseId

      String getReleaseId()
      The id of the release the task belongs to.
    • getTaskType

      String getTaskType()
      The name of the configuration type of this task, in prefix.Name form.
    • getInputProperty

      <T> Optional<T> getInputProperty(String name, Class<T> type)
      An input property declared on the task's configuration type, converted to type.
      Throws:
      IllegalArgumentException - if no such property is declared on this type
      ClassCastException - if the declared property cannot be viewed as type
    • getInputProperty

      default Optional<String> getInputProperty(String name)
      Convenience for the common case of a text input.
    • getInputProperties

      Map<String,Object> getInputProperties()
      All declared input properties by name. Unset properties are absent rather than null-valued. The returned map is a snapshot and is immutable.
    • getOutputProperty

      <T> Optional<T> getOutputProperty(String name, Class<T> type)
      Reads an output property — typically correlation state the extension itself wrote before suspending.
      Throws:
      IllegalArgumentException - if no such property is declared on this type