|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.gridbus.broker.farming.common.Job
This class represents a Job. A job consists of the Task from which it was derived, a Hashtable of the variable values for this job, a status string
| Field Summary | |
static int |
ACTIVE
|
static int |
DONE
|
static int |
FAILED
|
static int |
PENDING
|
static int |
SUBMITTED
|
static int |
UNSUBMITTED
|
| Constructor Summary | |
Job()
Constructor |
|
Job(java.lang.String id)
Constructor - with unique job id passed as a parameter. |
|
| Method Summary | |
void |
addVariable(SingleVariable var)
Add a Variable to the variables list |
void |
clearVariables()
Clear the variable list for this job |
float |
getDonetime()
Returns the time when the job was completed. |
java.lang.String |
getJobCompletedTimestamp()
Returns the timestamp for job completion in the format "dd/MM/yyyy hh:mm:ss" |
JobOut |
getJobError()
Returns the job error |
java.lang.String |
getJobHandle()
Get the unique handle for the job (middleware-dependent) |
java.lang.String |
getJobID()
Returns the Identification String for this job |
JobOut |
getJobOutput()
Returns the job output |
int |
getJobStatus()
Returns the integer value of the job status. |
java.lang.String |
getJobSubmittedTimestamp()
Returns the timestamp for job submission in the format "dd/MM/yyyy hh:mm:ss" |
java.lang.Object |
getJobWrapper()
Returns the Job Wrapper for this job. |
java.lang.StringBuffer |
getOutputBuffer()
The Output Buffer stores the console error and output at the remote node for the job This functions returns the output buffer. |
ComputeServer |
getServer()
Returns the server to which the job is allocated |
java.lang.String |
getStatusString()
Returns the status in the form of a string. |
java.lang.Object |
getSubmitRecord()
Returns the submit record object |
Task |
getTask()
Task is the sequence of commands that describe what a job has to do. |
java.util.Hashtable |
getVariableTable()
Returns the hashtable containing variables and their values for this job. |
java.lang.String |
getVariableValue(java.lang.String name)
returns the value of the variable name passed. |
java.util.Hashtable |
getVariableValueTable()
Returns the table of variables(values) |
void |
removeVariable(SingleVariable var)
Remove the variable name passed and its corresponding values from the list of variables |
long |
returnWallClockTimeTaken()
This function returns the difference between the job completed timestamp and the job submitted timestamp It throws exception if the timestamps cannot be parsed or if they are null. |
void |
setDonetime(float f)
Sets the done time |
void |
setJobCompletedTimestamp()
This function sets a time stamp in the format DateFormat.MEDIUM,DateFormat.MEDIUM It should be called after the job completion. |
void |
setJobCompletedTimestamp(java.lang.String string)
Sets the job completed timestamp as the one that is passed as the parameter. |
void |
setJobError(JobOut out)
Sets the job error |
void |
setJobHandle(java.lang.String string)
Sets the unique handle for the job which comes from the middleware.. |
void |
setJobID(java.lang.String string)
Sets the job identifier |
void |
setJobOutput(JobOut out)
Sets the job output |
void |
setJobStatus(int status)
Sets the job status |
void |
setJobSubmittedTimestamp()
This function sets a time stamp in the format "MMM dd, yyyy hh:mm:ss" using DateFormat classes |
void |
setJobSubmittedTimestamp(java.lang.String string)
Sets the job submitted timestamp as the one that is passed as the parameter. |
void |
setJobWrapper(JobWrapper wrapper)
Sets the job wrapper for this job, to take care of submission, etc.. |
void |
setOutputBuffer(java.lang.StringBuffer buffer)
Sets the output buffer. |
void |
setServer(ComputeServer server)
Sets the server to which the job is to be allocated. |
void |
setSubmitRecord(java.lang.Object object)
Sets the submit record object |
void |
setTask(Task task)
This sets the task for this job |
void |
setVariableTable(java.util.Hashtable hashtable)
The variable values for the job are stord in a hashtable in the form of name value pairs This function passes a hashtable to be used as the variable storage.. |
java.lang.String |
submit(ComputeServer server)
Submits a job to the server that is set within this job Throws exception if the server is null. |
java.lang.String |
terminate()
Terminates this job |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int UNSUBMITTED
public static final int SUBMITTED
public static final int ACTIVE
public static final int PENDING
public static final int DONE
public static final int FAILED
| Constructor Detail |
public Job()
public Job(java.lang.String id)
id - | Method Detail |
public java.lang.String getJobID()
public void setJobID(java.lang.String string)
string - public ComputeServer getServer()
public void setServer(ComputeServer server)
server - public void setJobSubmittedTimestamp()
It should be called after the job submission.public void setJobSubmittedTimestamp(java.lang.String string)
string - public void setJobCompletedTimestamp()
public void setJobCompletedTimestamp(java.lang.String string)
string -
public long returnWallClockTimeTaken()
throws java.lang.Exception
java.lang.Exceptionpublic float getDonetime()
public java.lang.String getJobSubmittedTimestamp()
DateFormatpublic java.lang.String getJobCompletedTimestamp()
DateFormatpublic int getJobStatus()
public void setJobStatus(int status)
status - public java.lang.String getStatusString()
public java.lang.Object getJobWrapper()
public Task getTask()
public void setTask(Task task)
task - public java.util.Hashtable getVariableTable()
public void setVariableTable(java.util.Hashtable hashtable)
hashtable - public void addVariable(SingleVariable var)
var - - a Variable object which contains the variable name and the variable valuepublic java.lang.String getVariableValue(java.lang.String name)
name -
public java.util.Hashtable getVariableValueTable()
public void removeVariable(SingleVariable var)
var - public void clearVariables()
public void setJobWrapper(JobWrapper wrapper)
wrapper -
public java.lang.String submit(ComputeServer server)
throws java.lang.Exception
server -
java.lang.Exception
public java.lang.String terminate()
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.StringBuffer getOutputBuffer()
public void setOutputBuffer(java.lang.StringBuffer buffer)
buffer - public java.lang.String getJobHandle()
public void setJobHandle(java.lang.String string)
string - public JobOut getJobError()
public JobOut getJobOutput()
public void setJobError(JobOut out)
out - public void setJobOutput(JobOut out)
out - public void setDonetime(float f)
f - public java.lang.Object getSubmitRecord()
public void setSubmitRecord(java.lang.Object object)
object - - submit record
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||