Class FlowExecutionOwner

java.lang.Object
org.jenkinsci.plugins.workflow.flow.FlowExecutionOwner
All Implemented Interfaces:
Serializable

public abstract class FlowExecutionOwner extends Object implements Serializable
We need something that's serializable in small moniker that helps us find THE instance of FlowExecution.
See Also:
  • Constructor Details

    • FlowExecutionOwner

      public FlowExecutionOwner()
  • Method Details

    • get

      @NonNull public abstract FlowExecution get() throws IOException
      Throws:
      IOException - if fails to find FlowExecution.
    • getOrNull

      @CheckForNull public FlowExecution getOrNull()
      Same as get() but avoids throwing an exception or blocking.
      Returns:
      a valid flow execution, or null if not ready or invalid
    • getRootDir

      public abstract File getRootDir() throws IOException
      A directory (on the controller) where information may be persisted.
      Throws:
      IOException
      See Also:
    • getExecutable

      public abstract Queue.Executable getExecutable() throws IOException
      The executor slot running this flow, such as a Run. The conceptual "owner" of FlowExecution. (For anything that runs for a long enough time that demands flow, it better occupies an executor. So this type restriction should still enable scriptler to use this.)
      Returns:
      preferably an FlowExecutionOwner.Executable
      Throws:
      IOException
    • getUrl

      public abstract String getUrl() throws IOException
      Returns the URL of the model object that owns FlowExecution, relative to the context root of Jenkins. This is usually not the same object as 'this'. This object must have the getExecution() method to bind FlowExecution to the URL space (or otherwise override getUrlOfExecution()).
      Returns:
      String like "job/foo/32/" with trailing slash but no leading slash.
      Throws:
      IOException
    • getUrlOfExecution

      public String getUrlOfExecution() throws IOException
      Throws:
      IOException
    • equals

      public abstract boolean equals(Object o)
      FlowExecutionOwners are equal to one another if and only if they point to the same FlowExecution object.
      Overrides:
      equals in class Object
    • hashCode

      public abstract int hashCode()
      Needs to be overridden as the equals(Object) method is overridden.
      Overrides:
      hashCode in class Object
    • getListener

      @NonNull public TaskListener getListener() throws IOException
      Gets a listener to which we may print general messages. Normally StepContext.get(java.lang.Class<T>) should be used, but in some cases there is no associated step.

      The listener should be remotable: if sent to an agent, messages printed to it should still appear in the log. The same will then apply to calls to StepContext.get(java.lang.Class<T>) on TaskListener.

      Throws:
      IOException
    • dummyOwner

      public static FlowExecutionOwner dummyOwner()
      A placeholder implementation for use in compatibility stubs.