|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lokahi.core.common.interfaces.RestObject org.apache.lokahi.core.common.interfaces.TMCDao org.apache.lokahi.core.api.job.Job
public class Job
A Job is an action that the controller needs to instruct the agent to perform
Constructor Summary | |
---|---|
Job()
|
|
Job(int id,
int poolId,
java.lang.String name,
java.sql.Blob result,
int serverId,
java.util.Date startTime,
java.util.Date finishTime,
int parentId,
int stateId,
java.lang.String options,
int instanceId,
int functionId)
|
|
Job(int parentId,
State state,
java.lang.String options,
Hardware h,
Function func,
JobPool jp)
|
|
Job(Job parent,
java.lang.String options,
Hardware h,
Function f,
JobPool jp)
|
|
Job(java.lang.String options,
Hardware h,
Function f,
JobPool jp)
|
|
Job(java.lang.String name,
int state,
java.lang.String result,
java.lang.String options,
java.lang.String server,
java.lang.String command)
|
Method Summary | |
---|---|
java.lang.StringBuilder |
buildShortXMLRepresentation()
Builds a short xml representation of this object containing name, and primary key. |
java.lang.StringBuilder |
buildXMLRepresention()
Builds a xml representation of this object |
boolean |
equals(java.lang.Object o)
|
Job |
fillObject(java.sql.ResultSet r)
Creates the Dao from the passed resultset, internally calling the appriate constructor. |
java.lang.String |
generateName()
|
Job |
get(int id)
|
java.util.Date |
getFinishTime()
|
Function |
getFunction()
|
int |
getFunctionId()
|
Hardware |
getHardware()
|
int |
getHardwareId()
|
Instance |
getInstance()
|
int |
getInstanceId()
|
static Job |
getJob(int id)
|
static Job |
getJob(java.lang.String name)
|
JobPool |
getJobPool()
|
static java.util.Collection<Job> |
getJobs()
|
static java.util.Collection<Job> |
getJobs(Instance i,
State s)
|
static java.util.Collection<Job> |
getJobs(int poolId)
Returns a collection of ints that are the ids of the jobs in the job pool. |
java.lang.String |
getName()
Gets the name. |
java.lang.String |
getOptions()
|
Job |
getParent()
|
int |
getParentId()
|
int |
getPk()
Gets the primary key |
int |
getPoolId()
|
java.lang.String |
getResult()
|
java.util.Date |
getStartTime()
|
State |
getState()
|
int |
getStateId()
|
int |
hashCode()
|
java.lang.String |
receiveResponse(java.lang.String key,
java.lang.String JobName,
java.lang.String parentJob,
int jobState,
java.lang.String jobResult,
java.lang.String server)
|
java.lang.String |
receiveResponse(java.lang.String key,
java.lang.String jobName,
java.lang.String jobParent,
int state,
java.lang.String result,
java.lang.String server,
java.lang.String command,
java.lang.String options,
java.lang.String user)
|
boolean |
send()
|
void |
setFinishTime(java.util.Date finishTime)
|
void |
setFunction(Function function)
|
void |
setFunctionId(int id)
|
void |
setHardware(Hardware hardware)
|
void |
setHardwareId(int containerId)
|
void |
setInstanceId(int instanceId)
|
void |
setJobPool(JobPool jobPool)
|
void |
setName(java.lang.String name)
|
void |
setOptions(java.lang.String options)
|
void |
setParent(Job parent)
|
void |
setParentId(int parentId)
|
void |
setPk(int pk)
|
void |
setPoolId(int poolId)
|
void |
setResult(java.sql.Blob content)
|
void |
setResult(java.lang.String result)
|
void |
setStartTime(java.util.Date startTime)
|
void |
setState(State state)
|
void |
setStateId(int stateId)
|
static Job |
store(Job j)
|
java.lang.String |
toString()
|
static boolean |
update(Job j)
This method stores the job into the database, so the user can keep checking his 'Recent Jobs' to see if the request is processed |
Methods inherited from class org.apache.lokahi.core.common.interfaces.RestObject |
---|
elementBuilder, elementBuilder |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Job()
public Job(int parentId, State state, java.lang.String options, Hardware h, Function func, JobPool jp)
public Job(java.lang.String options, Hardware h, Function f, JobPool jp)
public Job(Job parent, java.lang.String options, Hardware h, Function f, JobPool jp)
public Job(java.lang.String name, int state, java.lang.String result, java.lang.String options, java.lang.String server, java.lang.String command) throws java.sql.SQLException
java.sql.SQLException
public Job(int id, int poolId, java.lang.String name, java.sql.Blob result, int serverId, java.util.Date startTime, java.util.Date finishTime, int parentId, int stateId, java.lang.String options, int instanceId, int functionId) throws java.sql.SQLException
java.sql.SQLException
Method Detail |
---|
public JobPool getJobPool()
public void setJobPool(JobPool jobPool)
public State getState()
public void setState(State state)
public Hardware getHardware()
public void setHardware(Hardware hardware)
public Function getFunction()
public void setFunction(Function function)
public Job getParent() throws java.sql.SQLException
java.sql.SQLException
public void setParent(Job parent)
public int getPk()
Collectable
getPk
in interface Collectable
int
primary keypublic void setPk(int pk)
public int getPoolId()
public void setPoolId(int poolId)
public java.lang.String getName()
Collectable
getName
in interface Collectable
String
name.public void setName(java.lang.String name)
public java.lang.String getResult()
public void setResult(java.lang.String result)
public void setResult(java.sql.Blob content) throws java.sql.SQLException
java.sql.SQLException
public int getHardwareId()
public void setHardwareId(int containerId)
public java.util.Date getStartTime()
public void setStartTime(java.util.Date startTime)
public java.util.Date getFinishTime()
public void setFinishTime(java.util.Date finishTime)
public int getParentId()
public void setParentId(int parentId)
public int getStateId()
public void setStateId(int stateId)
public java.lang.String getOptions()
public void setOptions(java.lang.String options)
public int getInstanceId()
public void setInstanceId(int instanceId)
public int getFunctionId()
public void setFunctionId(int id)
public Instance getInstance()
public java.lang.String generateName()
public java.lang.String receiveResponse(java.lang.String key, java.lang.String JobName, java.lang.String parentJob, int jobState, java.lang.String jobResult, java.lang.String server)
public java.lang.String receiveResponse(java.lang.String key, java.lang.String jobName, java.lang.String jobParent, int state, java.lang.String result, java.lang.String server, java.lang.String command, java.lang.String options, java.lang.String user)
public static Job store(Job j) throws java.sql.SQLException, java.io.IOException
java.sql.SQLException
java.io.IOException
public static boolean update(Job j) throws java.sql.SQLException, java.io.IOException
j
- - Job to update
java.sql.SQLException
java.io.IOException
public Job get(int id) throws java.sql.SQLException
get
in class TMCDao
java.sql.SQLException
public static Job getJob(int id) throws java.sql.SQLException
java.sql.SQLException
public static java.util.Collection<Job> getJobs() throws java.sql.SQLException
java.sql.SQLException
public static Job getJob(java.lang.String name) throws java.sql.SQLException
java.sql.SQLException
public static java.util.Collection<Job> getJobs(Instance i, State s) throws java.sql.SQLException
java.sql.SQLException
public static java.util.Collection<Job> getJobs(int poolId) throws java.sql.SQLException
poolId
- - pool id of the jobs to look for.
java.sql.SQLException
public Job fillObject(java.sql.ResultSet r) throws java.sql.SQLException
Dao
fillObject
in interface Dao
r
- the resultset from a database call,
should include the entire object
java.sql.SQLException
public boolean send()
send
in interface TMCMessage
public java.lang.StringBuilder buildShortXMLRepresentation()
Restable
buildShortXMLRepresentation
in interface Restable
public java.lang.StringBuilder buildXMLRepresention()
Restable
buildXMLRepresention
in interface Restable
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |