org.apache.oozie.client.rest
Class JsonWorkflowAction

java.lang.Object
  extended by org.apache.oozie.client.rest.JsonWorkflowAction
All Implemented Interfaces:
JsonBean, WorkflowAction
Direct Known Subclasses:
WorkflowActionBean

public class JsonWorkflowAction
extends Object
implements WorkflowAction, JsonBean

Json Bean that represents an Oozie workflow node.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.oozie.client.WorkflowAction
WorkflowAction.Status
 
Constructor Summary
JsonWorkflowAction()
           
JsonWorkflowAction(org.json.simple.JSONObject jsonObject)
           
 
Method Summary
static List<JsonWorkflowAction> fromJSONArray(org.json.simple.JSONArray array)
          Convert a JSONArray into a nodes list.
 String getConf()
          Return the action configuration.
 String getConsoleUrl()
          Return the URL to the web console of the system executing the action.
 String getData()
          Return the action data.
 Date getEndTime()
          Return the end time of the action action.
 String getErrorCode()
          Return the error code of the action, if it ended in ERROR.
 String getErrorMessage()
          Return the error message of the action, if it ended in ERROR.
 String getExternalId()
          Return the external ID of the action.
 String getExternalStatus()
          Return the external status of the action.
 String getId()
          Return the action action ID.
 String getName()
          Return the action name.
 int getRetries()
          Return the number of retries of the action.
 Date getStartTime()
          Return the start time of the action action.
 WorkflowAction.Status getStatus()
          Return the current status of the action action.
 String getTrackerUri()
          Return the URL to programmatically track the status of the action.
 String getTransition()
          Return the transition a action took.
 String getType()
          Return the action type.
 void setConf(String conf)
           
 void setConsoleUrl(String consoleUrl)
           
 void setData(String data)
           
 void setEndTime(Date endTime)
           
 void setErrorInfo(String errorCode, String errorMessage)
           
 void setExternalId(String externalId)
           
 void setExternalStatus(String externalStatus)
           
 void setId(String id)
           
 void setName(String name)
           
 void setRetries(int retries)
           
 void setStartTime(Date startTime)
           
 void setStatus(WorkflowAction.Status status)
           
 void setTrackerUri(String trackerUri)
           
 void setTransition(String transition)
           
 void setType(String type)
           
static org.json.simple.JSONArray toJSONArray(List<? extends JsonWorkflowAction> nodes)
          Convert a nodes list into a JSONArray.
 org.json.simple.JSONObject toJSONObject()
          Return the JSONObject for the bean.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JsonWorkflowAction

public JsonWorkflowAction()

JsonWorkflowAction

public JsonWorkflowAction(org.json.simple.JSONObject jsonObject)
Method Detail

toJSONObject

public org.json.simple.JSONObject toJSONObject()
Description copied from interface: JsonBean
Return the JSONObject for the bean.

Specified by:
toJSONObject in interface JsonBean
Returns:
the JSONObject for the bean.

getId

public String getId()
Description copied from interface: WorkflowAction
Return the action action ID.

Specified by:
getId in interface WorkflowAction
Returns:
the action action ID.

setId

public void setId(String id)

getName

public String getName()
Description copied from interface: WorkflowAction
Return the action name.

Specified by:
getName in interface WorkflowAction
Returns:
the action name.

setName

public void setName(String name)

getType

public String getType()
Description copied from interface: WorkflowAction
Return the action type.

Specified by:
getType in interface WorkflowAction
Returns:
the action type.

setType

public void setType(String type)

getConf

public String getConf()
Description copied from interface: WorkflowAction
Return the action configuration.

Specified by:
getConf in interface WorkflowAction
Returns:
the action configuration.

setConf

public void setConf(String conf)

getStatus

public WorkflowAction.Status getStatus()
Description copied from interface: WorkflowAction
Return the current status of the action action.

Specified by:
getStatus in interface WorkflowAction
Returns:
the current status of the action action.

setStatus

public void setStatus(WorkflowAction.Status status)

getRetries

public int getRetries()
Description copied from interface: WorkflowAction
Return the number of retries of the action.

Specified by:
getRetries in interface WorkflowAction
Returns:
the number of retries of the action.

setRetries

public void setRetries(int retries)

getStartTime

public Date getStartTime()
Description copied from interface: WorkflowAction
Return the start time of the action action.

Specified by:
getStartTime in interface WorkflowAction
Returns:
the start time of the action action.

setStartTime

public void setStartTime(Date startTime)

getEndTime

public Date getEndTime()
Description copied from interface: WorkflowAction
Return the end time of the action action.

Specified by:
getEndTime in interface WorkflowAction
Returns:
the end time of the action action.

setEndTime

public void setEndTime(Date endTime)

getTransition

public String getTransition()
Description copied from interface: WorkflowAction
Return the transition a action took.

Specified by:
getTransition in interface WorkflowAction
Returns:
the transition a action took.

setTransition

public void setTransition(String transition)

getData

public String getData()
Description copied from interface: WorkflowAction
Return the action data.

Specified by:
getData in interface WorkflowAction
Returns:
the action data.

setData

public void setData(String data)

getExternalId

public String getExternalId()
Description copied from interface: WorkflowAction
Return the external ID of the action.

Specified by:
getExternalId in interface WorkflowAction
Returns:
the external ID of the action.

setExternalId

public void setExternalId(String externalId)

getExternalStatus

public String getExternalStatus()
Description copied from interface: WorkflowAction
Return the external status of the action.

Specified by:
getExternalStatus in interface WorkflowAction
Returns:
the external status of the action.

setExternalStatus

public void setExternalStatus(String externalStatus)

getTrackerUri

public String getTrackerUri()
Description copied from interface: WorkflowAction
Return the URL to programmatically track the status of the action.

Specified by:
getTrackerUri in interface WorkflowAction
Returns:
the URL to programmatically track the status of the action.

setTrackerUri

public void setTrackerUri(String trackerUri)

getConsoleUrl

public String getConsoleUrl()
Description copied from interface: WorkflowAction
Return the URL to the web console of the system executing the action.

Specified by:
getConsoleUrl in interface WorkflowAction
Returns:
the URL to the web console of the system executing the action.

setConsoleUrl

public void setConsoleUrl(String consoleUrl)

getErrorCode

public String getErrorCode()
Description copied from interface: WorkflowAction
Return the error code of the action, if it ended in ERROR.

Specified by:
getErrorCode in interface WorkflowAction
Returns:
the error code of the action.

getErrorMessage

public String getErrorMessage()
Description copied from interface: WorkflowAction
Return the error message of the action, if it ended in ERROR.

Specified by:
getErrorMessage in interface WorkflowAction
Returns:
the error message of the action.

setErrorInfo

public void setErrorInfo(String errorCode,
                         String errorMessage)

toString

public String toString()
Overrides:
toString in class Object

toJSONArray

public static org.json.simple.JSONArray toJSONArray(List<? extends JsonWorkflowAction> nodes)
Convert a nodes list into a JSONArray.

Parameters:
nodes - nodes list.
Returns:
the corresponding JSON array.

fromJSONArray

public static List<JsonWorkflowAction> fromJSONArray(org.json.simple.JSONArray array)
Convert a JSONArray into a nodes list.

Parameters:
array - JSON array.
Returns:
the corresponding nodes list.


Copyright © 2011 Yahoo. All Rights Reserved.