Class 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 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 the PauseAction 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.