Update javadoc for workflow state domain classes

This commit is contained in:
Greg Schueler 2014-01-18 10:33:12 -08:00
parent ba136cfc44
commit 6c1f93af49
6 changed files with 66 additions and 6 deletions

View file

@ -5,7 +5,7 @@ import java.util.List;
import java.util.Set; import java.util.Set;
/** /**
* $INTERFACE is ... User: greg Date: 1/17/14 Time: 11:26 AM * Base execution status for a step
*/ */
public class BaseState { public class BaseState {
private Date startTime; private Date startTime;
@ -13,6 +13,10 @@ public class BaseState {
private Date updateTime; private Date updateTime;
private RundeckWFExecState executionState; private RundeckWFExecState executionState;
/**
* Time that the execution of this step started
* @return
*/
public Date getStartTime() { public Date getStartTime() {
return startTime; return startTime;
} }
@ -21,6 +25,10 @@ public class BaseState {
this.startTime = startTime; this.startTime = startTime;
} }
/**
* Time that the execution of this step finished, or null if it has not completed
* @return
*/
public Date getEndTime() { public Date getEndTime() {
return endTime; return endTime;
} }
@ -29,6 +37,10 @@ public class BaseState {
this.endTime = endTime; this.endTime = endTime;
} }
/**
* Current state of the execution
* @return
*/
public RundeckWFExecState getExecutionState() { public RundeckWFExecState getExecutionState() {
return executionState; return executionState;
} }
@ -37,6 +49,10 @@ public class BaseState {
this.executionState = executionState; this.executionState = executionState;
} }
/**
* Time that this state was last updated
* @return
*/
public Date getUpdateTime() { public Date getUpdateTime() {
return updateTime; return updateTime;
} }

View file

@ -5,13 +5,17 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
/** /**
* $INTERFACE is ... User: greg Date: 1/16/14 Time: 5:41 PM * The state of an Execution
*/ */
public class RundeckExecutionState extends WorkflowState{ public class RundeckExecutionState extends WorkflowState{
private long executionId; private long executionId;
private Set<RundeckNodeIdentity> allNodes; private Set<RundeckNodeIdentity> allNodes;
private Map<String, List<WorkflowStepContextState>> nodeStates; private Map<String, List<WorkflowStepContextState>> nodeStates;
/**
* Return the set of all rundeck nodes targetted in this execution
* @return
*/
public Set<RundeckNodeIdentity> getAllNodes() { public Set<RundeckNodeIdentity> getAllNodes() {
return allNodes; return allNodes;
} }
@ -20,6 +24,10 @@ public class RundeckExecutionState extends WorkflowState{
this.allNodes = allNodes; this.allNodes = allNodes;
} }
/**
* Return the map of node name to step state list
* @return
*/
public Map<String, List<WorkflowStepContextState>> getNodeStates() { public Map<String, List<WorkflowStepContextState>> getNodeStates() {
return nodeStates; return nodeStates;
} }
@ -28,6 +36,10 @@ public class RundeckExecutionState extends WorkflowState{
this.nodeStates = nodeStates; this.nodeStates = nodeStates;
} }
/**
* Return this execution's ID
* @return
*/
public long getExecutionId() { public long getExecutionId() {
return executionId; return executionId;
} }

View file

@ -1,7 +1,7 @@
package org.rundeck.api.domain; package org.rundeck.api.domain;
/** /**
* $INTERFACE is ... User: greg Date: 1/17/14 Time: 11:27 AM * An execution state for a workflow or node step
*/ */
public enum RundeckWFExecState { public enum RundeckWFExecState {
/** /**

View file

@ -6,13 +6,17 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
/** /**
* $INTERFACE is ... User: greg Date: 1/16/14 Time: 5:44 PM * Represents the state of a workflow of steps
*/ */
public class WorkflowState extends BaseState { public class WorkflowState extends BaseState {
private int stepCount; private int stepCount;
private Set<RundeckNodeIdentity> targetNodes; private Set<RundeckNodeIdentity> targetNodes;
private List<WorkflowStepState> steps; private List<WorkflowStepState> steps;
/**
* Return the number of steps in this workflow
* @return
*/
public int getStepCount() { public int getStepCount() {
return stepCount; return stepCount;
} }
@ -21,6 +25,10 @@ public class WorkflowState extends BaseState{
this.stepCount = stepCount; this.stepCount = stepCount;
} }
/**
* Identify the target nodes of this workflow
* @return
*/
public Set<RundeckNodeIdentity> getTargetNodes() { public Set<RundeckNodeIdentity> getTargetNodes() {
return targetNodes; return targetNodes;
} }
@ -29,6 +37,10 @@ public class WorkflowState extends BaseState{
this.targetNodes = targetNodes; this.targetNodes = targetNodes;
} }
/**
* Return the list of steps for this workflow
* @return
*/
public List<WorkflowStepState> getSteps() { public List<WorkflowStepState> getSteps() {
return steps; return steps;
} }

View file

@ -7,6 +7,10 @@ public class WorkflowStepContextState extends BaseState {
private String stepContextId; private String stepContextId;
private String stepNum; private String stepNum;
/**
* The context id for the step in the form "#[/#[/#[...]]]" where "#" is a number
* @return
*/
public String getStepContextId() { public String getStepContextId() {
return stepContextId; return stepContextId;
} }
@ -15,6 +19,10 @@ public class WorkflowStepContextState extends BaseState {
this.stepContextId = stepContextId; this.stepContextId = stepContextId;
} }
/**
* The step number of this step in the current workflow, 1 indexed.
* @return
*/
public String getStepNum() { public String getStepNum() {
return stepNum; return stepNum;
} }

View file

@ -4,13 +4,17 @@ import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
* $INTERFACE is ... User: greg Date: 1/17/14 Time: 12:03 PM * Represents the state of a step in a workflow
*/ */
public class WorkflowStepState extends WorkflowStepContextState { public class WorkflowStepState extends WorkflowStepContextState {
private boolean nodeStep; private boolean nodeStep;
private WorkflowState subWorkflow; private WorkflowState subWorkflow;
private Map<String, WorkflowStepContextState> nodeStates; private Map<String, WorkflowStepContextState> nodeStates;
/**
* Return true if this step runs on each target node
* @return
*/
public boolean isNodeStep() { public boolean isNodeStep() {
return nodeStep; return nodeStep;
} }
@ -19,6 +23,10 @@ public class WorkflowStepState extends WorkflowStepContextState {
this.nodeStep = nodeStep; this.nodeStep = nodeStep;
} }
/**
* Return sub workflow if this step has one
* @return
*/
public WorkflowState getSubWorkflow() { public WorkflowState getSubWorkflow() {
return subWorkflow; return subWorkflow;
} }
@ -27,6 +35,10 @@ public class WorkflowStepState extends WorkflowStepContextState {
this.subWorkflow = subWorkflow; this.subWorkflow = subWorkflow;
} }
/**
* Return the state of each target node if this step runs on each target node
* @return
*/
public Map<String, WorkflowStepContextState> getNodeStates() { public Map<String, WorkflowStepContextState> getNodeStates() {
return nodeStates; return nodeStates;
} }