org.apache.oozie.client.rest
Class JsonBundleJob

java.lang.Object
  extended by org.apache.oozie.client.rest.JsonBundleJob
All Implemented Interfaces:
org.apache.oozie.client.BundleJob, org.apache.oozie.client.Job, JsonBean
Direct Known Subclasses:
BundleJobBean

@Entity
public class JsonBundleJob
extends Object
implements org.apache.oozie.client.BundleJob, JsonBean


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.oozie.client.BundleJob
org.apache.oozie.client.BundleJob.Timeunit
 
Nested classes/interfaces inherited from interface org.apache.oozie.client.Job
org.apache.oozie.client.Job.Status
 
Constructor Summary
JsonBundleJob()
           
 
Method Summary
 String getAcl()
           
 String getAppName()
           
 String getAppPath()
           
 String getConf()
           
 String getConsoleUrl()
           
 List<org.apache.oozie.client.CoordinatorJob> getCoordinators()
           
 Date getCreatedTime()
          Get createdTime
 Date getEndTime()
           
 String getExternalId()
          Return externalId
 String getGroup()
          Deprecated. 
 String getId()
           
 Date getKickoffTime()
           
 Date getPauseTime()
          Get pauseTime
 Date getStartTime()
           
 org.apache.oozie.client.Job.Status getStatus()
           
 int getTimeout()
           
 org.apache.oozie.client.BundleJob.Timeunit getTimeUnit()
           
 String getUser()
           
 void resetPending()
          Set pending to false
 void setAppName(String bundleName)
          Set bundleName
 void setAppPath(String bundlePath)
          Set bundlePath
 void setConf(String conf)
          Set conf
 void setConsoleUrl(String consoleUrl)
          Set consoleUrl
 void setCoordJobs(List<? extends JsonCoordinatorJob> coordJobs)
          Set coordJobs
 void setCreatedTime(Date createdTime)
          Set createdTime
 void setEndTime(Date endTime)
          Set endTime
 void setExternalId(String externalId)
          Set externalId
 void setGroup(String group)
          Set group
 void setId(String id)
          Set id
 void setKickoffTime(Date kickoffTime)
          Set kickoffTime
 void setPauseTime(Date pauseTime)
          Set pauseTime
 void setPending()
          Set pending to true
 void setStartTime(Date startTime)
          Set startTime
 void setStatus(org.apache.oozie.client.Job.Status status)
          Set status
 void setTimeOut(int timeOut)
          Set timeOut
 void setTimeUnit(org.apache.oozie.client.BundleJob.Timeunit timeUnit)
          Set timeUnit
 void setUser(String user)
          Set user
static org.json.simple.JSONArray toJSONArray(List<? extends JsonBundleJob> applications, String timeZoneId)
          Convert a Bundle job list into a JSONArray.
 org.json.simple.JSONObject toJSONObject()
          Get the value from the json object.
 org.json.simple.JSONObject toJSONObject(String timeZoneId)
          Return the JSONObject for the bean with the given time zone.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JsonBundleJob

public JsonBundleJob()
Method Detail

toJSONObject

public org.json.simple.JSONObject toJSONObject()
Get the value from the json object.

Specified by:
toJSONObject in interface JsonBean
Parameters:
json - public JsonBundleJob(JSONObject json) { appPath = (String) json.get(JsonTags.BUNDLE_JOB_PATH); appName = (String) json.get(JsonTags.BUNDLE_JOB_NAME); id = (String) json.get(JsonTags.BUNDLE_JOB_ID); externalId = (String) json.get(JsonTags.BUNDLE_JOB_EXTERNAL_ID); conf = (String) json.get(JsonTags.BUNDLE_JOB_CONF); status = Status.valueOf((String) json.get(JsonTags.BUNDLE_JOB_STATUS)); kickoffTime = JsonUtils.parseDateRfc822((String) json.get(JsonTags.BUNDLE_JOB_KICKOFF_TIME)); startTime = JsonUtils.parseDateRfc822((String) json.get(JsonTags.BUNDLE_JOB_START_TIME)); endTime = JsonUtils.parseDateRfc822((String) json.get(JsonTags.BUNDLE_JOB_END_TIME)); pauseTime = JsonUtils.parseDateRfc822((String) json.get(JsonTags.BUNDLE_JOB_PAUSE_TIME)); createdTime = JsonUtils.parseDateRfc822((String) json.get(JsonTags.BUNDLE_JOB_CREATED_TIME)); timeUnit = Timeunit.valueOf((String) json.get(JsonTags.BUNDLE_JOB_TIMEUNIT)); timeOut = (int) JsonUtils.getLongValue(json, JsonTags.BUNDLE_JOB_TIMEOUT); user = (String) json.get(JsonTags.BUNDLE_JOB_USER); group = (String) json.get(JsonTags.BUNDLE_JOB_GROUP); consoleUrl = (String) json.get(JsonTags.BUNDLE_JOB_CONSOLE_URL); coordJobs = JsonCoordinatorJob.fromJSONArray((JSONArray) json.get(JsonTags.BUNDLE_COORDINATOR_JOBS)); }
Returns:
the JSONObject for the bean with GMT time zone.

toJSONObject

public org.json.simple.JSONObject toJSONObject(String timeZoneId)
Description copied from interface: JsonBean
Return the JSONObject for the bean with the given time zone.

Specified by:
toJSONObject in interface JsonBean
Parameters:
timeZoneId - the time zone to use
Returns:
the JSONObject for the bean with the given time zone.

getAppName

public String getAppName()
Specified by:
getAppName in interface org.apache.oozie.client.Job

getAppPath

public String getAppPath()
Specified by:
getAppPath in interface org.apache.oozie.client.Job

getConf

public String getConf()
Specified by:
getConf in interface org.apache.oozie.client.Job

getConsoleUrl

public String getConsoleUrl()
Specified by:
getConsoleUrl in interface org.apache.oozie.client.Job

getCoordinators

public List<org.apache.oozie.client.CoordinatorJob> getCoordinators()
Specified by:
getCoordinators in interface org.apache.oozie.client.BundleJob

getEndTime

public Date getEndTime()
Specified by:
getEndTime in interface org.apache.oozie.client.Job

getGroup

@Deprecated
public String getGroup()
Deprecated. 

Specified by:
getGroup in interface org.apache.oozie.client.Job

getAcl

public String getAcl()
Specified by:
getAcl in interface org.apache.oozie.client.Job

getId

public String getId()
Specified by:
getId in interface org.apache.oozie.client.Job

getKickoffTime

public Date getKickoffTime()
Specified by:
getKickoffTime in interface org.apache.oozie.client.BundleJob

getStatus

public org.apache.oozie.client.Job.Status getStatus()
Specified by:
getStatus in interface org.apache.oozie.client.Job

getTimeUnit

public org.apache.oozie.client.BundleJob.Timeunit getTimeUnit()
Specified by:
getTimeUnit in interface org.apache.oozie.client.BundleJob

getTimeout

public int getTimeout()
Specified by:
getTimeout in interface org.apache.oozie.client.BundleJob

getUser

public String getUser()
Specified by:
getUser in interface org.apache.oozie.client.Job

setId

public void setId(String id)
Set id

Parameters:
id - the id to set

setAppPath

public void setAppPath(String bundlePath)
Set bundlePath

Parameters:
bundlePath - the bundlePath to set

setAppName

public void setAppName(String bundleName)
Set bundleName

Parameters:
bundleName - the bundleName to set

getExternalId

public String getExternalId()
Return externalId

Specified by:
getExternalId in interface org.apache.oozie.client.Job
Returns:
externalId

setExternalId

public void setExternalId(String externalId)
Set externalId

Parameters:
externalId - the externalId to set

setConf

public void setConf(String conf)
Set conf

Parameters:
conf - the conf to set

setStatus

public void setStatus(org.apache.oozie.client.Job.Status status)
Set status

Specified by:
setStatus in interface org.apache.oozie.client.Job
Parameters:
status - the status to set

setKickoffTime

public void setKickoffTime(Date kickoffTime)
Set kickoffTime

Parameters:
kickoffTime - the kickoffTime to set

setStartTime

public void setStartTime(Date startTime)
Set startTime

Parameters:
kickoffTime - the kickoffTime to set

setEndTime

public void setEndTime(Date endTime)
Set endTime

Parameters:
endTime - the endTime to set

getPauseTime

public Date getPauseTime()
Get pauseTime

Specified by:
getPauseTime in interface org.apache.oozie.client.Job
Returns:
pauseTime

setPauseTime

public void setPauseTime(Date pauseTime)
Set pauseTime

Parameters:
pauseTime - the pauseTime to set

getCreatedTime

public Date getCreatedTime()
Get createdTime

Specified by:
getCreatedTime in interface org.apache.oozie.client.BundleJob
Returns:
createdTime

setCreatedTime

public void setCreatedTime(Date createdTime)
Set createdTime

Parameters:
createdTime - the createdTime to set

setTimeUnit

public void setTimeUnit(org.apache.oozie.client.BundleJob.Timeunit timeUnit)
Set timeUnit

Parameters:
timeUnit - the timeUnit to set

setTimeOut

public void setTimeOut(int timeOut)
Set timeOut

Parameters:
timeOut - the timeOut to set

setUser

public void setUser(String user)
Set user

Parameters:
user - the user to set

setGroup

public void setGroup(String group)
Set group

Parameters:
group - the group to set

setConsoleUrl

public void setConsoleUrl(String consoleUrl)
Set consoleUrl

Parameters:
consoleUrl - the consoleUrl to set

setCoordJobs

public void setCoordJobs(List<? extends JsonCoordinatorJob> coordJobs)
Set coordJobs

Parameters:
coordJobs - the coordJobs to set

toJSONArray

public static org.json.simple.JSONArray toJSONArray(List<? extends JsonBundleJob> applications,
                                                    String timeZoneId)
Convert a Bundle job list into a JSONArray.

Parameters:
application - list.
timeZoneId - time zone to use for dates in the JSON array.
Returns:
the corresponding JSON array.

getStartTime

public Date getStartTime()
Specified by:
getStartTime in interface org.apache.oozie.client.Job

setPending

public void setPending()
Set pending to true

Specified by:
setPending in interface org.apache.oozie.client.Job
Parameters:
pending - set pending to true

resetPending

public void resetPending()
Set pending to false

Specified by:
resetPending in interface org.apache.oozie.client.Job
Parameters:
pending - set pending to false

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 Apache Software Foundation. All Rights Reserved.