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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidendCurrentPause(org.jenkinsci.plugins.workflow.graph.FlowNode node) getCause()static PauseActiongetCurrentPause(org.jenkinsci.plugins.workflow.graph.FlowNode node) longstatic List<PauseAction>getPauseActions(org.jenkinsci.plugins.workflow.graph.FlowNode node) Get thePauseActioninstances for the supplied node.longGet the pause duration for this flow node.static longgetPauseDuration(org.jenkinsci.plugins.workflow.graph.FlowNode node) get the aggregate pause duration of the supplied flow node.longbooleanisPaused()static booleanisPaused(org.jenkinsci.plugins.workflow.graph.FlowNode node) Simple helper method to test if the supplied node is a pause node.voidvoidsetEndTime(long endTime) voidsetStartTime(long startTime) Methods inherited from class hudson.model.InvisibleAction
getDisplayName, getIconFileName, getUrlNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 thePauseActioninstances for the supplied node.- Parameters:
node- The node to be searched.- Returns:
- The
PauseActioninstances 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.
-