public class WorkflowsClient extends Object
Constructor and Description |
---|
WorkflowsClient(com.sun.jersey.api.client.WebResource webResource) |
Modifier and Type | Method and Description |
---|---|
Long |
getWorkflowDefinition(String workflowName)
Retrieve the command workflow definition with the given name.
|
String |
getWorkflowDefinitionTargetType(Long workflowDefinitionId)
Retrieve the command workflow target type for the specified workflow definition ID.
|
String |
runCommandWorkflow(Long workflowId,
String targetType,
String targetName)
Run a Command Workflow in vCommander.
|
Long |
waitForWorkflowToBeCompleted(String taskId,
long timeout,
long polling,
PrintStream logger)
Waits until the workflow is completed or failed.
|
public WorkflowsClient(com.sun.jersey.api.client.WebResource webResource)
public Long getWorkflowDefinition(String workflowName) throws org.codehaus.jettison.json.JSONException, VCommanderException
workflowName
- The name of the workflow definitionorg.codehaus.jettison.json.JSONException
- If there is a syntax errorVCommanderException
- If something goes wrongpublic String getWorkflowDefinitionTargetType(Long workflowDefinitionId) throws org.codehaus.jettison.json.JSONException, VCommanderException
workflowDefinitionId
- The ID of the workflow definitionorg.codehaus.jettison.json.JSONException
- If there is a syntax errorVCommanderException
- If something goes wrongpublic String runCommandWorkflow(Long workflowId, String targetType, String targetName) throws org.codehaus.jettison.json.JSONException, VCommanderException
workflowId
- The ID of the workflow definitiontargetType
- The type of the targettargetName
- The name of the targetorg.codehaus.jettison.json.JSONException
- If there is a syntax errorVCommanderException
- If something goes wrongpublic Long waitForWorkflowToBeCompleted(String taskId, long timeout, long polling, PrintStream logger) throws org.codehaus.jettison.json.JSONException, InterruptedException, VCommanderException
taskId
- The response received when the workflow was submittedtimeout
- Timeout in minutespolling
- Polling interval in secondslogger
- A PrintStream, used for loggingorg.codehaus.jettison.json.JSONException
- If there is a syntax errorInterruptedException
- If the wait is interruptedVCommanderException
- If something goes wrongCopyright © 2016–2021. All rights reserved.