org.apache.oozie.client.rest
Class JsonWorkflowJob

java.lang.Object
  extended by org.apache.oozie.client.rest.JsonWorkflowJob
All Implemented Interfaces:
JsonBean, WorkflowJob
Direct Known Subclasses:
WorkflowJobBean

public class JsonWorkflowJob
extends Object
implements WorkflowJob, JsonBean

Json Bean that represents an Oozie workflow job.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.oozie.client.WorkflowJob
WorkflowJob.Status
 
Constructor Summary
JsonWorkflowJob()
           
JsonWorkflowJob(org.json.simple.JSONObject json)
           
 
Method Summary
static List<WorkflowJob> fromJSONArray(org.json.simple.JSONArray array)
          Convert a JSONArray into a workflows list.
 List<WorkflowAction> getActions()
          Return the workflow nodes that already executed and are executing.
 String getAppName()
          Return the name of the workflow application (from the workflow definition).
 String getAppPath()
          Return the path to the workflow application for the workflow job.
 String getConf()
          Return the job configuration.
 String getConsoleUrl()
          Return the workflow job console URL.
 Date getCreatedTime()
          Return the workflow job creation time.
 Date getEndTime()
          Return the workflow job end time.
 String getExternalId()
           
 String getGroup()
          Return the workflow job group.
 String getId()
          Return the workflow job ID.
 Date getLastModifiedTime()
          Return the workflow job last modified time.
 int getRun()
          Return the workflow job run number.
 Date getStartTime()
          Return the workflow job start time.
 WorkflowJob.Status getStatus()
          Return the workflow job status.
 String getUser()
          Return the workflow job user owner.
 void setActions(List<? extends JsonWorkflowAction> nodes)
           
 void setAppName(String appName)
           
 void setAppPath(String appPath)
           
 void setConf(String conf)
           
 void setConsoleUrl(String consoleUrl)
          Set the workflow job console URL.
 void setCreatedTime(Date createdTime)
           
 void setEndTime(Date endTime)
           
 void setExternalId(String externalId)
           
 void setGroup(String group)
           
 void setId(String id)
           
 void setLastModifiedTime(Date lastModTime)
           
 void setRun(int run)
           
 void setStartTime(Date startTime)
           
 void setStatus(WorkflowJob.Status status)
           
 void setUser(String user)
           
static org.json.simple.JSONArray toJSONArray(List<? extends JsonWorkflowJob> workflows)
          Convert a workflows 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

JsonWorkflowJob

public JsonWorkflowJob()

JsonWorkflowJob

public JsonWorkflowJob(org.json.simple.JSONObject json)
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.

getAppPath

public String getAppPath()
Description copied from interface: WorkflowJob
Return the path to the workflow application for the workflow job.

Specified by:
getAppPath in interface WorkflowJob
Returns:
the path to the workflow application for the workflow job.

setAppPath

public void setAppPath(String appPath)

getAppName

public String getAppName()
Description copied from interface: WorkflowJob
Return the name of the workflow application (from the workflow definition).

Specified by:
getAppName in interface WorkflowJob
Returns:
the name of the workflow application.

setAppName

public void setAppName(String appName)

getId

public String getId()
Description copied from interface: WorkflowJob
Return the workflow job ID.

Specified by:
getId in interface WorkflowJob
Returns:
the workflow job ID.

setId

public void setId(String id)

setExternalId

public void setExternalId(String externalId)

getExternalId

public String getExternalId()

getConf

public String getConf()
Description copied from interface: WorkflowJob
Return the job configuration.

Specified by:
getConf in interface WorkflowJob
Returns:
the job configuration.

setConf

public void setConf(String conf)

getStatus

public WorkflowJob.Status getStatus()
Description copied from interface: WorkflowJob
Return the workflow job status.

Specified by:
getStatus in interface WorkflowJob
Returns:
the workflow job status.

setStatus

public void setStatus(WorkflowJob.Status status)

getLastModifiedTime

public Date getLastModifiedTime()
Description copied from interface: WorkflowJob
Return the workflow job last modified time.

Specified by:
getLastModifiedTime in interface WorkflowJob
Returns:
the workflow job last modified time.

setLastModifiedTime

public void setLastModifiedTime(Date lastModTime)

getCreatedTime

public Date getCreatedTime()
Description copied from interface: WorkflowJob
Return the workflow job creation time.

Specified by:
getCreatedTime in interface WorkflowJob
Returns:
the workflow job creation time.

setCreatedTime

public void setCreatedTime(Date createdTime)

getStartTime

public Date getStartTime()
Description copied from interface: WorkflowJob
Return the workflow job start time.

Specified by:
getStartTime in interface WorkflowJob
Returns:
the workflow job start time.

setStartTime

public void setStartTime(Date startTime)

getEndTime

public Date getEndTime()
Description copied from interface: WorkflowJob
Return the workflow job end time.

Specified by:
getEndTime in interface WorkflowJob
Returns:
the workflow job end time.

setEndTime

public void setEndTime(Date endTime)

getUser

public String getUser()
Description copied from interface: WorkflowJob
Return the workflow job user owner.

Specified by:
getUser in interface WorkflowJob
Returns:
the workflow job user owner.

setUser

public void setUser(String user)

getGroup

public String getGroup()
Description copied from interface: WorkflowJob
Return the workflow job group.

Specified by:
getGroup in interface WorkflowJob
Returns:
the workflow job group.

setGroup

public void setGroup(String group)

getRun

public int getRun()
Description copied from interface: WorkflowJob
Return the workflow job run number.

Except for reruns, this property is always 1.

Specified by:
getRun in interface WorkflowJob
Returns:
the workflow job run number.

setRun

public void setRun(int run)

getConsoleUrl

public String getConsoleUrl()
Return the workflow job console URL.

Specified by:
getConsoleUrl in interface WorkflowJob
Returns:
the workflow job console URL.

setConsoleUrl

public void setConsoleUrl(String consoleUrl)
Set the workflow job console URL.

Parameters:
consoleUrl - the workflow job console URL.

getActions

public List<WorkflowAction> getActions()
Description copied from interface: WorkflowJob
Return the workflow nodes that already executed and are executing.

Specified by:
getActions in interface WorkflowJob
Returns:
the workflow nodes that already executed and are executing.

setActions

public void setActions(List<? extends JsonWorkflowAction> nodes)

toString

public String toString()
Overrides:
toString in class Object

toJSONArray

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

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

fromJSONArray

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

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


Copyright © 2011 Yahoo. All Rights Reserved.