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
PauseFlowNode
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 Constructor Description PauseAction(String cause)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
endCurrentPause(org.jenkinsci.plugins.workflow.graph.FlowNode node)
String
getCause()
static PauseAction
getCurrentPause(org.jenkinsci.plugins.workflow.graph.FlowNode node)
long
getEndTime()
static List<PauseAction>
getPauseActions(org.jenkinsci.plugins.workflow.graph.FlowNode node)
Get thePauseAction
instances for the supplied node.long
getPauseDuration()
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
getStartTime()
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
setCause(String cause)
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 Detail
-
PauseAction
public PauseAction(String cause)
-
-
Method Detail
-
getCause
public String getCause()
-
setCause
public void setCause(String cause)
-
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.
-
-