Class PauseAction
java.lang.Object
hudson.model.InvisibleAction
org.jenkinsci.plugins.workflow.support.actions.PauseAction
- All Implemented Interfaces:
Action
,ModelObject
,org.jenkinsci.plugins.workflow.actions.PersistentAction
public class PauseAction
extends InvisibleAction
implements org.jenkinsci.plugins.workflow.actions.PersistentAction
Pause
FlowNode
Action.
Simply marks the node as being a node that causes the build to pause e.g. an Input node.- Author:
- tom.fennelly@gmail.com
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
endCurrentPause
(org.jenkinsci.plugins.workflow.graph.FlowNode node) getCause()
static PauseAction
getCurrentPause
(org.jenkinsci.plugins.workflow.graph.FlowNode node) long
static List<PauseAction>
getPauseActions
(org.jenkinsci.plugins.workflow.graph.FlowNode node) Get thePauseAction
instances for the supplied node.long
Get the pause duration for this flow node.static long
getPauseDuration
(org.jenkinsci.plugins.workflow.graph.FlowNode node) get the aggregate pause duration of the supplied flow node.long
boolean
isPaused()
static boolean
isPaused
(org.jenkinsci.plugins.workflow.graph.FlowNode node) Simple helper method to test if the supplied node is a pause node.void
void
setEndTime
(long endTime) void
setStartTime
(long startTime) Methods inherited from class hudson.model.InvisibleAction
getDisplayName, getIconFileName, getUrlName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface hudson.model.Action
getDisplayName, getIconFileName, getUrlName
-
Constructor Details
-
PauseAction
-
-
Method Details
-
getCause
-
setCause
-
getStartTime
public long getStartTime() -
setStartTime
public void setStartTime(long startTime) -
getEndTime
public long getEndTime() -
setEndTime
public void setEndTime(long endTime) -
isPaused
public boolean isPaused() -
getPauseDuration
public long getPauseDuration()Get the pause duration for this flow node. If the node is paused, the duration will be calculated against the current time.- Returns:
- The pause duration in milliseconds.
-
getCurrentPause
@CheckForNull public static PauseAction getCurrentPause(@NonNull org.jenkinsci.plugins.workflow.graph.FlowNode node) -
endCurrentPause
public static void endCurrentPause(@NonNull org.jenkinsci.plugins.workflow.graph.FlowNode node) throws IOException - Throws:
IOException
-
isPaused
public static boolean isPaused(@NonNull org.jenkinsci.plugins.workflow.graph.FlowNode node) Simple helper method to test if the supplied node is a pause node.- Parameters:
node
- The node to test.- Returns:
- True if the node is pause node, otherwise false.
-
getPauseActions
@NonNull public static List<PauseAction> getPauseActions(@NonNull org.jenkinsci.plugins.workflow.graph.FlowNode node) Get thePauseAction
instances for the supplied node.- Parameters:
node
- The node to be searched.- Returns:
- The
PauseAction
instances for the supplied node. Returns an empty list if there are none.
-
getPauseDuration
public static long getPauseDuration(@NonNull org.jenkinsci.plugins.workflow.graph.FlowNode node) get the aggregate pause duration of the supplied flow node.- Parameters:
node
- The node to calculate on.- Returns:
- The pause duration in milliseconds.
-