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 ofFlowExecution
.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
FlowExecutionOwner.Executable
Marker interface for queue executables fromgetExecutable()
.
-
Constructor Summary
Constructors Constructor Description FlowExecutionOwner()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static FlowExecutionOwner
dummyOwner()
A placeholder implementation for use in compatibility stubs.abstract boolean
equals(Object o)
FlowExecutionOwner
s are equal to one another if and only if they point to the sameFlowExecution
object.abstract FlowExecution
get()
abstract Queue.Executable
getExecutable()
The executor slot running this flow, such as aRun
.TaskListener
getListener()
Gets a listener to which we may print general messages.FlowExecution
getOrNull()
Same asget()
but avoids throwing an exception or blocking.abstract File
getRootDir()
A directory (on the controller) where information may be persisted.abstract String
getUrl()
Returns the URL of the model object that ownsFlowExecution
, relative to the context root of Jenkins.String
getUrlOfExecution()
abstract int
hashCode()
Needs to be overridden as theequals(Object)
method is overridden.
-
-
-
Method Detail
-
get
@NonNull public abstract FlowExecution get() throws IOException
- Throws:
IOException
- if fails to findFlowExecution
.
-
getOrNull
@CheckForNull public FlowExecution getOrNull()
Same asget()
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:
Run.getRootDir()
-
getExecutable
public abstract Queue.Executable getExecutable() throws IOException
The executor slot running this flow, such as aRun
. The conceptual "owner" ofFlowExecution
. (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 ownsFlowExecution
, relative to the context root of Jenkins. This is usually not the same object as 'this'. This object must have thegetExecution()
method to bindFlowExecution
to the URL space (or otherwise overridegetUrlOfExecution()
).- 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)
FlowExecutionOwner
s are equal to one another if and only if they point to the sameFlowExecution
object.
-
hashCode
public abstract int hashCode()
Needs to be overridden as theequals(Object)
method is overridden.
-
getListener
@NonNull public TaskListener getListener() throws IOException
Gets a listener to which we may print general messages. NormallyStepContext.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>)
onTaskListener
.- Throws:
IOException
-
dummyOwner
public static FlowExecutionOwner dummyOwner()
A placeholder implementation for use in compatibility stubs.
-
-