Package 

Interface Task

  • All Implemented Interfaces:
    com.netflix.spinnaker.kork.plugins.api.internal.SpinnakerExtensionPoint , org.pf4j.ExtensionPoint

    @Beta() 
    public interface Task
     implements SpinnakerExtensionPoint
                        

    A discrete unit of work in a pipeline execution that does one thing and one thing only.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      @interface Task.Aliases

      Allows backwards compatibility of a task's "type", even through class renames / refactors.

    • Method Summary

      Modifier and Type Method Description
      abstract TaskResult execute(StageExecution stage) Execute the business logic of the task, using the provided stage execution state.
      TaskResult onTimeout(StageExecution stage) Behavior to be called on Task timeout.
      void onCancel(StageExecution stage) Behavior to be called on Task cancellation.
      TaskResult onCancelWithResult(StageExecution stage) Behavior to be called on Task cancellation.
      Collection<String> aliases() A collection of known aliases.
      • Methods inherited from class com.netflix.spinnaker.kork.plugins.api.internal.SpinnakerExtensionPoint

        getExtensionClass, getPluginId
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • execute

        @Nonnull() abstract TaskResult execute(StageExecution stage)

        Execute the business logic of the task, using the provided stage execution state.

        Parameters:
        stage - The running stage execution stage
      • onTimeout

        @Nullable() TaskResult onTimeout(StageExecution stage)

        Behavior to be called on Task timeout.

        This method should be used if you need to perform any cleanup operations in response to the task being aborted after taking too long to complete.

        Parameters:
        stage - The running state execution state
      • onCancel

        @Deprecated() void onCancel(StageExecution stage)

        Behavior to be called on Task cancellation.

        This method should be used if you need to perform cleanup in response to the task being cancelled before it was able to complete.

        Parameters:
        stage - The running state execution state
      • onCancelWithResult

        @Nullable() TaskResult onCancelWithResult(StageExecution stage)

        Behavior to be called on Task cancellation.

        This method should be used if you need to perform cleanup in response to the task being cancelled before it was able to complete.

        When returning a TaskResult , the ExecutionStatus will be ignored, as the resulting status will always be CANCELED .

        Parameters:
        stage - The running state execution state