com.sap.scheduler.runtime

Class Job

java.lang.Object
  extended by com.sap.scheduler.runtime.Job
All Implemented Interfaces:
Serializable

public class Job
extends Object
implements Serializable

This object represents a job. A job is an instance of a job definition and runs once. It is considered a new job if the job is restarted.

See Also:
Serialized Form

Constructor Summary
Job()
          Deprecated. Please use Job(JobID, JobDefinitionID, SchedulerID, String, JobStatus, Date, Date, Date, String, short, String, JobID, String, boolean, int, SchedulerTaskID) instead
Job(JobID id, JobDefinitionID defID, SchedulerID schedID, String name, JobStatus status, Date startDate, Date endDate, Date submitTime, String node, short returnCode, String userID, JobID parent, String vendorData, boolean cancelRequest, int retentionPeriod)
          Deprecated. Please use Job(JobID, JobDefinitionID, SchedulerID, String, JobStatus, Date, Date, Date, String, short, String, JobID, String, boolean, int, SchedulerTaskID) instead
Job(JobID id, JobDefinitionID defID, SchedulerID schedID, String name, JobStatus status, Date startDate, Date endDate, Date submitTime, String node, short returnCode, String userID, JobID parent, String vendorData, boolean cancelRequest, int retentionPeriod, SchedulerTaskID schedTaskID)
          Create a new job object from the parameters provided.
Job(JobID id, JobDefinitionID defID, SchedulerID schedID, String name, JobStatus status, Date startDate, Date endDate, Date submitTime, String node, short returnCode, String userID, JobID parent, String vendorData, boolean cancelRequest, int retentionPeriod, SchedulerTaskID schedTaskID, long cpuTime, long memoryAllocation)
          Create a new job object from the parameters provided.
 
Method Summary
 boolean getCancelRequest()
           
 long getCPUTime()
          Returns the CPU time required to run this job.
 Date getEndDate()
          Returns the date when this job finished
 JobID getId()
          Get the job id (unique identifier).
 JobDefinitionID getJobDefinitionId()
           
 JobStatus getJobStatus()
          Get the status.
 long getMemoryAllocation()
          Returns the overall memory allocated by this job.
 String getName()
          Get the name of the job definition.
 String getNode()
          Get the node which executes or has execute this job
 JobID getParent()
          Get the parent job, or null if it has no parent.
 int getRetentionPeriod()
           
 short getReturnCode()
          Get the return code of this job.
 SchedulerID getScheduler()
          Returns the name of the scheduler which controls this job.
 SchedulerTaskID getSchedulerTaskId()
           
 Date getStartDate()
          Returns the start date of this job.
 Date getSubmitDate()
          date when this job was submitted
 String getUser()
          User id which is used to run this job
 String getVendorData()
           
 void setCancelRequest(boolean value)
          Deprecated. use the constructor
 void setEndDate(Date end)
          Deprecated. use the constructor
 void setId(JobID id)
          Deprecated. use the constructor
 void setJobDefinitionId(JobDefinitionID id)
          Deprecated. use the constructor
 void setJobStatus(JobStatus jobStatus)
          Deprecated. use the constructor
 void setName(String name)
          Deprecated. use the constructor
 void setNode(String node)
          Deprecated. use the constructor
 void setParent(JobID parent)
          Deprecated. use the constructor
 void setReturnCode(short returnCode)
          Deprecated. use the constructor
 void setScheduler(SchedulerID scheduler)
          Deprecated. use the constructor
 void setStartDate(Date startDate)
          Deprecated. use the constructor
 void setSubmitDate(Date date)
          Deprecated. use the constructor
 void setUser(String userId)
          Deprecated. use the constructor
 void setVendorData(String value)
          Deprecated. use the constructor
 String toFormattedString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Job

public Job(JobID id,
           JobDefinitionID defID,
           SchedulerID schedID,
           String name,
           JobStatus status,
           Date startDate,
           Date endDate,
           Date submitTime,
           String node,
           short returnCode,
           String userID,
           JobID parent,
           String vendorData,
           boolean cancelRequest,
           int retentionPeriod)
Deprecated. Please use Job(JobID, JobDefinitionID, SchedulerID, String, JobStatus, Date, Date, Date, String, short, String, JobID, String, boolean, int, SchedulerTaskID) instead


Job

public Job(JobID id,
           JobDefinitionID defID,
           SchedulerID schedID,
           String name,
           JobStatus status,
           Date startDate,
           Date endDate,
           Date submitTime,
           String node,
           short returnCode,
           String userID,
           JobID parent,
           String vendorData,
           boolean cancelRequest,
           int retentionPeriod,
           SchedulerTaskID schedTaskID)
Create a new job object from the parameters provided.

Parameters:
id - id of the job
defID - id of the job definition
schedID - id of the scheduler that triggered this job
name - name of this job
status - current status of the job
startDate - date when the job was started
endDate - date when the job ended
submitTime - date when the job was submitted
node - node where this job is running
returnCode - return code of the job
userID - user which was used to run this job
parent - parent job (if any)
vendorData - vendor specific data
cancelRequest - indicates whether there is a cancel request for this job
retentionPeriod - time this record will be kept after the job has ended
schedTaskID - task id from which this job was scheduled

Job

public Job(JobID id,
           JobDefinitionID defID,
           SchedulerID schedID,
           String name,
           JobStatus status,
           Date startDate,
           Date endDate,
           Date submitTime,
           String node,
           short returnCode,
           String userID,
           JobID parent,
           String vendorData,
           boolean cancelRequest,
           int retentionPeriod,
           SchedulerTaskID schedTaskID,
           long cpuTime,
           long memoryAllocation)
Create a new job object from the parameters provided.

Parameters:
id - id of the job
defID - id of the job definition
schedID - id of the scheduler that triggered this job
name - name of this job
status - current status of the job
startDate - date when the job was started
endDate - date when the job ended
submitTime - date when the job was submitted
node - node where this job is running
returnCode - return code of the job
userID - user which was used to run this job
parent - parent job (if any)
vendorData - vendor specific data
cancelRequest - indicates whether there is a cancel request for this job
retentionPeriod - time this record will be kept after the job has ended
schedTaskID - task id from which this job was scheduled
cpuTime - CPU time for this job
memoryAllocation - memory allocated by this job

Job

public Job()
Deprecated. Please use Job(JobID, JobDefinitionID, SchedulerID, String, JobStatus, Date, Date, Date, String, short, String, JobID, String, boolean, int, SchedulerTaskID) instead

Method Detail

getId

public JobID getId()
Get the job id (unique identifier).

Returns:
the job id.

setId

public void setId(JobID id)
Deprecated. use the constructor


getJobStatus

public JobStatus getJobStatus()
Get the status.

Returns:
the status code.

setJobStatus

public void setJobStatus(JobStatus jobStatus)
Deprecated. use the constructor


getNode

public String getNode()
Get the node which executes or has execute this job

Returns:
Node or null if this job has not been executed

setNode

public void setNode(String node)
Deprecated. use the constructor


getParent

public JobID getParent()
Get the parent job, or null if it has no parent.

Returns:
the parent job.

setParent

public void setParent(JobID parent)
Deprecated. use the constructor


getReturnCode

public short getReturnCode()
Get the return code of this job.

Returns:
the return code.

setReturnCode

public void setReturnCode(short returnCode)
Deprecated. use the constructor


getScheduler

public SchedulerID getScheduler()
Returns the name of the scheduler which controls this job.


setScheduler

public void setScheduler(SchedulerID scheduler)
Deprecated. use the constructor


getStartDate

public Date getStartDate()
Returns the start date of this job.

Returns:
the date when this job was started or null if it has not been started

setStartDate

public void setStartDate(Date startDate)
Deprecated. use the constructor


getEndDate

public Date getEndDate()
Returns the date when this job finished

Returns:
date when this job is finished of null if it has not finished

setEndDate

public void setEndDate(Date end)
Deprecated. use the constructor


getSubmitDate

public Date getSubmitDate()
date when this job was submitted

Returns:
a Date object representing the time when this job was submitted

setSubmitDate

public void setSubmitDate(Date date)
Deprecated. use the constructor


getUser

public String getUser()
User id which is used to run this job

Returns:
user id

setUser

public void setUser(String userId)
Deprecated. use the constructor


getJobDefinitionId

public JobDefinitionID getJobDefinitionId()

setJobDefinitionId

public void setJobDefinitionId(JobDefinitionID id)
Deprecated. use the constructor


getName

public String getName()
Get the name of the job definition.

Returns:
the job name.

setName

public void setName(String name)
Deprecated. use the constructor


getVendorData

public String getVendorData()

setVendorData

public void setVendorData(String value)
Deprecated. use the constructor


setCancelRequest

public void setCancelRequest(boolean value)
Deprecated. use the constructor


getCancelRequest

public boolean getCancelRequest()

getRetentionPeriod

public int getRetentionPeriod()

getSchedulerTaskId

public SchedulerTaskID getSchedulerTaskId()

getCPUTime

public long getCPUTime()
Returns the CPU time required to run this job. It is 0 if the job has not finished.

Returns:
CPU time in microseconds

getMemoryAllocation

public long getMemoryAllocation()
Returns the overall memory allocated by this job. Memory freed by the garbage collector is not considered.

Returns:
memory allocated by the job in bytes

toFormattedString

public String toFormattedString()
Access Rights

This class can be accessed from:


SC DC
[sap.com] ENGFACADE [sap.com] tc/je/scheduler/api


Copyright 2010 SAP AG Complete Copyright Notice