Class StandardGraphLookupView
java.lang.Object
org.jenkinsci.plugins.workflow.graph.StandardGraphLookupView
- All Implemented Interfaces:
ExtensionPoint,GraphListener,GraphListener.Synchronous,GraphLookupView
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public final class StandardGraphLookupView
extends Object
implements GraphLookupView, GraphListener, GraphListener.Synchronous
Provides overall insight into the structure of a flow graph... but with limited visibility so we can change implementation.
Designed to work entirely on the basis of the
FlowNode.getId() rather than the FlowNodes themselves.-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudsonNested classes/interfaces inherited from interface org.jenkinsci.plugins.workflow.flow.GraphListener
GraphListener.SynchronousNested classes/interfaces inherited from interface org.jenkinsci.plugins.workflow.graph.GraphLookupView
GraphLookupView.EnclosingBlocksIterable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidReturn all enclosing block start nodes, as withGraphLookupView.findEnclosingBlockStart(FlowNode).Find the immediately enclosingBlockStartNodearound aFlowNodegetEndNode(BlockStartNode startNode) Find the end node corresponding to a start node, and can be used to tell if the block is completed.booleanTests if the node is a currently running head, or the start of a block that has not completed executingProvide anIterableover all enclosing blocks, which can be used similarly toGraphLookupView.findAllEnclosingBlockStarts(FlowNode)but does lazy fetches rather than materializing a full result.voidUpdate with a new node added to the flowgraph
-
Constructor Details
-
StandardGraphLookupView
public StandardGraphLookupView()Create a lookup view for an execution
-
-
Method Details
-
clearCache
public void clearCache() -
onNewHead
Update with a new node added to the flowgraph- Specified by:
onNewHeadin interfaceGraphListener
-
isActive
Description copied from interface:GraphLookupViewTests if the node is a currently running head, or the start of a block that has not completed executing- Specified by:
isActivein interfaceGraphLookupView
-
getEndNode
Description copied from interface:GraphLookupViewFind the end node corresponding to a start node, and can be used to tell if the block is completed.- Specified by:
getEndNodein interfaceGraphLookupView- Returns:
BlockEndNodematching the given start node, or null if block hasn't completed
-
findEnclosingBlockStart
Description copied from interface:GraphLookupViewFind the immediately enclosingBlockStartNodearound aFlowNode- Specified by:
findEnclosingBlockStartin interfaceGraphLookupView- Parameters:
node- Node to find block enclosing it - note that it this is a BlockStartNode, you will return the start of the block enclosing this one.- Returns:
- Null if node is a
FlowStartNodeorFlowEndNode
-
iterateEnclosingBlocks
Description copied from interface:GraphLookupViewProvide anIterableover all enclosing blocks, which can be used similarly toGraphLookupView.findAllEnclosingBlockStarts(FlowNode)but does lazy fetches rather than materializing a full result. Handy for for-each loops.Usage note:Prefer this to
GraphLookupView.findAllEnclosingBlockStarts(FlowNode)in most cases since it can evaluate lazily, unless you know you need all enclosing blocks.- Specified by:
iterateEnclosingBlocksin interfaceGraphLookupView- Parameters:
node- Node to find enclosing blocks for- Returns:
- Iterable over enclosing blocks, from the nearest-enclosing outward ("inside-out" order)
-
findAllEnclosingBlockStarts
Description copied from interface:GraphLookupViewReturn all enclosing block start nodes, as withGraphLookupView.findEnclosingBlockStart(FlowNode).Usage note:Prefer using
GraphLookupView.iterateEnclosingBlocks(FlowNode)unless you know you need ALL blocks, since that can lazy-load.- Specified by:
findAllEnclosingBlockStartsin interfaceGraphLookupView- Parameters:
node- Node to find enclosing blocks for- Returns:
- All enclosing block starts from the nearest-enclosing outward ("inside-out" order), or EMPTY_LIST if this is a start or end node
-