org.apache.oozie.client.rest
Class JsonCoordinatorJob

java.lang.Object
  extended by org.apache.oozie.client.rest.JsonCoordinatorJob
All Implemented Interfaces:
CoordinatorJob, JsonBean
Direct Known Subclasses:
CoordinatorJobBean

public class JsonCoordinatorJob
extends Object
implements CoordinatorJob, JsonBean


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.oozie.client.CoordinatorJob
CoordinatorJob.Execution, CoordinatorJob.Status, CoordinatorJob.Timeunit
 
Constructor Summary
JsonCoordinatorJob()
           
JsonCoordinatorJob(org.json.simple.JSONObject json)
           
 
Method Summary
static List<CoordinatorJob> fromJSONArray(org.json.simple.JSONArray applications)
          Convert a JSONArray into a application list.
 List<CoordinatorAction> getActions()
          Return list of coordinator actions.
 String getAppName()
          Return the name of the Oozie application (from the application definition).
 String getAppPath()
          Return the path to the Oozie application.
 String getBundleId()
          Return the BundleId.
 int getConcurrency()
          Return the concurrency for the coord job
 String getConf()
          Return the application configuration.
 String getConsoleUrl()
          Return the coordinate application console URL.
 Date getEndTime()
          Return the application end time.
 CoordinatorJob.Execution getExecutionOrder()
          Return the execution order policy for the coord job
 String getExternalId()
           
 int getFrequency()
          Return the frequency for the coord job in unit of minute
 String getGroup()
          Return the application group.
 String getId()
          Return the application ID.
 int getLastActionNumber()
           
 Date getLastActionTime()
          Return the date for the last action of the coord job
 Date getNextMaterializedTime()
          Return the application next materialized time.
 Date getPauseTime()
           
 Date getStartTime()
          Return the application start time.
 CoordinatorJob.Status getStatus()
          Return the application status.
 int getTimeout()
          Return the time out value for the coord job
 CoordinatorJob.Timeunit getTimeUnit()
          Return the timeUnit for the coord job, it could be, Timeunit enum, e.g.
 String getTimeZone()
          Return the time zone information for the coord job
 String getUser()
          Return the application user owner.
 void setActions(List<? extends JsonCoordinatorAction> nodes)
           
 void setAppName(String appName)
           
 void setAppPath(String appPath)
           
 void setBundleId(String bundleId)
           
 void setConcurrency(int concurrency)
           
 void setConf(String conf)
           
 void setConsoleUrl(String consoleUrl)
          Set the coordinate application console URL.
 void setEndTime(Date endTime)
           
 void setExecutionOrder(CoordinatorJob.Execution order)
           
 void setExternalId(String externalId)
           
 void setFrequency(int frequency)
           
 void setGroup(String group)
           
 void setId(String id)
           
 void setLastActionNumber(int lastActionNumber)
           
 void setLastActionTime(Date lastAction)
           
 void setNextMaterializedTime(Date nextMaterializedTime)
           
 void setPauseTime(Date pauseTime)
           
 void setStartTime(Date startTime)
           
 void setStatus(CoordinatorJob.Status status)
           
 void setTimeout(int timeOut)
           
 void setTimeUnit(CoordinatorJob.Timeunit timeUnit)
           
 void setTimeZone(String timeZone)
           
 void setUser(String user)
           
static org.json.simple.JSONArray toJSONArray(List<? extends JsonCoordinatorJob> applications)
          Convert a coordinator application 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

JsonCoordinatorJob

public JsonCoordinatorJob()

JsonCoordinatorJob

public JsonCoordinatorJob(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: CoordinatorJob
Return the path to the Oozie application.

Specified by:
getAppPath in interface CoordinatorJob
Returns:
the path to the Oozie application.

setAppPath

public void setAppPath(String appPath)

getAppName

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

Specified by:
getAppName in interface CoordinatorJob
Returns:
the name of the Oozie application.

setAppName

public void setAppName(String appName)

getId

public String getId()
Description copied from interface: CoordinatorJob
Return the application ID.

Specified by:
getId in interface CoordinatorJob
Returns:
the application 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: CoordinatorJob
Return the application configuration.

Specified by:
getConf in interface CoordinatorJob
Returns:
the application configuration.

setConf

public void setConf(String conf)

getStatus

public CoordinatorJob.Status getStatus()
Description copied from interface: CoordinatorJob
Return the application status.

Specified by:
getStatus in interface CoordinatorJob
Returns:
the application status.

setStatus

public void setStatus(CoordinatorJob.Status status)

setFrequency

public void setFrequency(int frequency)

getFrequency

public int getFrequency()
Description copied from interface: CoordinatorJob
Return the frequency for the coord job in unit of minute

Specified by:
getFrequency in interface CoordinatorJob
Returns:
the frequency for the coord job in unit of minute

setTimeUnit

public void setTimeUnit(CoordinatorJob.Timeunit timeUnit)

getTimeUnit

public CoordinatorJob.Timeunit getTimeUnit()
Description copied from interface: CoordinatorJob
Return the timeUnit for the coord job, it could be, Timeunit enum, e.g. MINUTE, HOUR, DAY, WEEK or MONTH

Specified by:
getTimeUnit in interface CoordinatorJob
Returns:
the time unit for the coord job

setTimeZone

public void setTimeZone(String timeZone)

getTimeZone

public String getTimeZone()
Description copied from interface: CoordinatorJob
Return the time zone information for the coord job

Specified by:
getTimeZone in interface CoordinatorJob
Returns:
the time zone information for the coord job

setConcurrency

public void setConcurrency(int concurrency)

getConcurrency

public int getConcurrency()
Description copied from interface: CoordinatorJob
Return the concurrency for the coord job

Specified by:
getConcurrency in interface CoordinatorJob
Returns:
the concurrency for the coord job

setExecutionOrder

public void setExecutionOrder(CoordinatorJob.Execution order)

getExecutionOrder

public CoordinatorJob.Execution getExecutionOrder()
Description copied from interface: CoordinatorJob
Return the execution order policy for the coord job

Specified by:
getExecutionOrder in interface CoordinatorJob
Returns:
the execution order policy for the coord job

setTimeout

public void setTimeout(int timeOut)

getTimeout

public int getTimeout()
Description copied from interface: CoordinatorJob
Return the time out value for the coord job

Specified by:
getTimeout in interface CoordinatorJob
Returns:
the time out value for the coord job

setLastActionTime

public void setLastActionTime(Date lastAction)

getLastActionTime

public Date getLastActionTime()
Description copied from interface: CoordinatorJob
Return the date for the last action of the coord job

Specified by:
getLastActionTime in interface CoordinatorJob
Returns:
the date for the last action of the coord job

getNextMaterializedTime

public Date getNextMaterializedTime()
Description copied from interface: CoordinatorJob
Return the application next materialized time.

Specified by:
getNextMaterializedTime in interface CoordinatorJob
Returns:
the application next materialized time.

setNextMaterializedTime

public void setNextMaterializedTime(Date nextMaterializedTime)

getStartTime

public Date getStartTime()
Description copied from interface: CoordinatorJob
Return the application start time.

Specified by:
getStartTime in interface CoordinatorJob
Returns:
the application start time.

setStartTime

public void setStartTime(Date startTime)

getEndTime

public Date getEndTime()
Description copied from interface: CoordinatorJob
Return the application end time.

Specified by:
getEndTime in interface CoordinatorJob
Returns:
the application end time.

setEndTime

public void setEndTime(Date endTime)

getPauseTime

public Date getPauseTime()

setPauseTime

public void setPauseTime(Date pauseTime)

getUser

public String getUser()
Description copied from interface: CoordinatorJob
Return the application user owner.

Specified by:
getUser in interface CoordinatorJob
Returns:
the application user owner.

setUser

public void setUser(String user)

getGroup

public String getGroup()
Description copied from interface: CoordinatorJob
Return the application group.

Specified by:
getGroup in interface CoordinatorJob
Returns:
the application group.

setGroup

public void setGroup(String group)

getBundleId

public String getBundleId()
Description copied from interface: CoordinatorJob
Return the BundleId.

Specified by:
getBundleId in interface CoordinatorJob
Returns:
the BundleId.

setBundleId

public void setBundleId(String bundleId)

getConsoleUrl

public String getConsoleUrl()
Return the coordinate application console URL.

Specified by:
getConsoleUrl in interface CoordinatorJob
Returns:
the coordinate application console URL.

setConsoleUrl

public void setConsoleUrl(String consoleUrl)
Set the coordinate application console URL.

Parameters:
consoleUrl - the coordinate application console URL.

toString

public String toString()
Overrides:
toString in class Object

setActions

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

getActions

public List<CoordinatorAction> getActions()
Description copied from interface: CoordinatorJob
Return list of coordinator actions.

Specified by:
getActions in interface CoordinatorJob
Returns:
the list of coordinator actions.

toJSONArray

public static org.json.simple.JSONArray toJSONArray(List<? extends JsonCoordinatorJob> applications)
Convert a coordinator application list into a JSONArray.

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

fromJSONArray

public static List<CoordinatorJob> fromJSONArray(org.json.simple.JSONArray applications)
Convert a JSONArray into a application list.

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

getLastActionNumber

public int getLastActionNumber()

setLastActionNumber

public void setLastActionNumber(int lastActionNumber)


Copyright © 2011 Yahoo. All Rights Reserved.