Class StateUtils


  • public class StateUtils
    extends java.lang.Object
    $INTERFACE is ... User: greg Date: 10/17/13 Time: 12:36 PM
    • Constructor Detail

      • StateUtils

        public StateUtils()
    • Method Detail

      • stepState

        public static StepState stepState​(ExecutionState state,
                                          java.util.Map metadata,
                                          java.lang.String errorMessage)
      • stepState

        public static StepState stepState​(ExecutionState state,
                                          java.util.Map metadata,
                                          java.lang.String errorMessage,
                                          java.util.Date startTime,
                                          java.util.Date updateTime,
                                          java.util.Date endTime)
      • parameterString

        public static java.lang.String parameterString​(StepContextId contextId)
        Generate string for a context id's parameter section, if present
        Parameters:
        contextId - context id
        Returns:
        parameter string, or blank string
      • parameterString

        public static java.lang.String parameterString​(java.util.Map<java.lang.String,​java.lang.String> params)
        Parameters:
        params - params
        Returns:
        Generate the parameter string for a map of parameters
      • stepIdentifierToString

        public static java.lang.String stepIdentifierToString​(StepIdentifier ident)
        Parameters:
        ident - ident
        Returns:
        Generate a string representing the step identifier
      • stepIdentifierFromString

        public static StepIdentifier stepIdentifierFromString​(java.lang.String input)
        Parameters:
        input - identifier string
        Returns:
        Parse a step identifier from a string
      • stepContextIdToString

        public static java.lang.String stepContextIdToString​(StepContextId context)
      • stepContextIdFromString

        public static StepContextId stepContextIdFromString​(java.lang.String s)
        Parameters:
        s - context id
        Returns:
        Generate a step context id from a string
      • parseParameterString

        public static java.util.Map<java.lang.String,​java.lang.String> parseParameterString​(java.lang.String t)
        Parameters:
        t - parameter
        Returns:
        Parse a paramter string to a parameter map
      • isMatchedIdentifier

        public static boolean isMatchedIdentifier​(java.lang.String parent,
                                                  java.lang.String child,
                                                  boolean substep)
        Parameters:
        parent - parent identifier
        child - child identifier
        substep - if true, allow the child identifier to be longer than the parent, otherwise require exact same length
        Returns:
        true if the identifier represents a subcontext context of the parent identifier, optionally allowing sub steps
      • isMatchedIdentifier

        public static boolean isMatchedIdentifier​(StepIdentifier parent,
                                                  StepIdentifier child,
                                                  boolean substep)
        Parameters:
        parent - parent identifier
        child - child identifier
        substep - if true, allow the child identifier to be longer than the parent, otherwise require exact same length
        Returns:
        true if the identifier is a subcontext of the parent identifier, optionally allowing sub steps
      • stepContextId

        public static StepContextId stepContextId​(int step,
                                                  boolean errorhandler)
      • stepContextId

        public static StepContextId stepContextId​(int step,
                                                  boolean errorhandler,
                                                  java.util.Map<java.lang.String,​java.lang.String> params)
      • stepIdentifier

        public static StepIdentifier stepIdentifier​(int id)
      • stepIdentifier

        public static StepIdentifier stepIdentifier​(int... ids)
      • workflowState

        public static WorkflowState workflowState​(java.util.List<java.lang.String> nodeSet,
                                                  java.util.List<java.lang.String> allNodes,
                                                  long stepCount,
                                                  ExecutionState executionState,
                                                  java.util.Date updateTime,
                                                  java.util.Date startTime,
                                                  java.util.Date endTime,
                                                  java.lang.String serverNode,
                                                  java.util.List<WorkflowStepState> stepStates,
                                                  boolean setupNodeStates)
      • workflowState

        public static WorkflowState workflowState​(java.util.List<java.lang.String> nodeSet,
                                                  java.util.List<java.lang.String> allNodes,
                                                  long stepCount,
                                                  ExecutionState executionState,
                                                  java.util.Date timestamp,
                                                  java.util.Date startTime,
                                                  java.util.Date endTime,
                                                  java.lang.String serverNode,
                                                  java.util.List<WorkflowStepState> stepStates,
                                                  java.util.Map<java.lang.String,​WorkflowNodeState> nodeStates)
      • setupNodeStates

        public static void setupNodeStates​(WorkflowStateImpl current)
        Configure the nodeStates map for the workflow, by visiting each step in the workflow, and connecting the step+node state for nodeSteps to the nodeStates map
        Parameters:
        current - workflow to visit