org.apache.lokahi.core.agent.dao
Class AgentJob

java.lang.Object
  extended by org.apache.lokahi.core.agent.dao.AgentJob
All Implemented Interfaces:
Collectable, Dao
Direct Known Subclasses:
MonitoringJob, ScheduledJob

public class AgentJob
extends java.lang.Object
implements Dao, Collectable

Version:
$Id: AgentJob.java,v 1.4 2006/03/07 20:18:45 drtobes Exp $
Author:
Stephen Toback

Constructor Summary
AgentJob()
           
AgentJob(int pk, int type, java.lang.String name, java.lang.String parentName, int stateId, int functionId, java.lang.String options, java.lang.String returnTo, java.lang.String returnEndpoint, java.lang.String returnMethod, java.util.Date runtime, java.lang.String attachment, java.lang.String result)
           
AgentJob(int type, java.lang.String name, java.lang.String parentName, int stateId, int functionId, java.lang.String options, java.lang.String returnTo, java.lang.String returnEndpoint, java.lang.String returnMethod, java.util.Date runtime, java.lang.String attachment, java.lang.String result)
           
 
Method Summary
 AgentJob fillObject(java.sql.ResultSet r)
          Creates the Dao from the passed resultset, internally calling the appriate constructor.
 java.lang.String getAttachment()
           
 Function getFunction()
           
static java.util.Collection<AgentJob> getJobs(State s)
           
 java.lang.String getName()
          Gets the name.
 java.lang.String[] getOptions()
           
 java.lang.String getParentName()
           
 int getPk()
          Gets the primary key
 java.lang.String getResult()
           
 java.lang.String getReturnEndpoint()
           
 java.lang.String getReturnMethod()
           
 java.lang.String getReturnTo()
           
 java.util.Date getRunTime()
           
 State getStatus()
           
 TaskType getType()
           
 void setAttachment(java.lang.String attachment)
           
 void setFunction(Function function)
           
 void setName(java.lang.String name)
           
 void setOptions(java.lang.String[] options)
           
 void setParentName(java.lang.String parentName)
           
 void setPk(int pk)
           
 void setResult(java.lang.String result)
           
 void setReturnEndpoint(java.lang.String returnEndpoint)
           
 void setReturnMethod(java.lang.String returnMethod)
           
 void setReturnTo(java.lang.String returnTo)
           
 void setRunTime(java.util.Date runTime)
           
 void setStatus(State status)
           
 void setType(TaskType type)
           
static AgentJob store(AgentJob j)
           
 void update()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentJob

public AgentJob()

AgentJob

public AgentJob(int type,
                java.lang.String name,
                java.lang.String parentName,
                int stateId,
                int functionId,
                java.lang.String options,
                java.lang.String returnTo,
                java.lang.String returnEndpoint,
                java.lang.String returnMethod,
                java.util.Date runtime,
                java.lang.String attachment,
                java.lang.String result)

AgentJob

public AgentJob(int pk,
                int type,
                java.lang.String name,
                java.lang.String parentName,
                int stateId,
                int functionId,
                java.lang.String options,
                java.lang.String returnTo,
                java.lang.String returnEndpoint,
                java.lang.String returnMethod,
                java.util.Date runtime,
                java.lang.String attachment,
                java.lang.String result)
Method Detail

getPk

public int getPk()
Description copied from interface: Collectable
Gets the primary key

Specified by:
getPk in interface Collectable
Returns:
the int primary key

setType

public void setType(TaskType type)

getType

public TaskType getType()

setPk

public void setPk(int pk)

getName

public java.lang.String getName()
Description copied from interface: Collectable
Gets the name.

Specified by:
getName in interface Collectable
Returns:
the String name.

setName

public void setName(java.lang.String name)

getAttachment

public java.lang.String getAttachment()

setAttachment

public void setAttachment(java.lang.String attachment)

getOptions

public java.lang.String[] getOptions()

setOptions

public void setOptions(java.lang.String[] options)

getParentName

public java.lang.String getParentName()

setParentName

public void setParentName(java.lang.String parentName)

getReturnTo

public java.lang.String getReturnTo()

setReturnTo

public void setReturnTo(java.lang.String returnTo)

getReturnEndpoint

public java.lang.String getReturnEndpoint()

setReturnEndpoint

public void setReturnEndpoint(java.lang.String returnEndpoint)

getReturnMethod

public java.lang.String getReturnMethod()

setReturnMethod

public void setReturnMethod(java.lang.String returnMethod)

getRunTime

public java.util.Date getRunTime()

setRunTime

public void setRunTime(java.util.Date runTime)

getFunction

public Function getFunction()

setFunction

public void setFunction(Function function)

getResult

public java.lang.String getResult()

setResult

public void setResult(java.lang.String result)

getStatus

public State getStatus()

setStatus

public void setStatus(State status)

store

public static AgentJob store(AgentJob j)
                      throws java.sql.SQLException
Throws:
java.sql.SQLException

getJobs

public static java.util.Collection<AgentJob> getJobs(State s)

update

public void update()
            throws java.sql.SQLException
Throws:
java.sql.SQLException

fillObject

public AgentJob fillObject(java.sql.ResultSet r)
                    throws java.sql.SQLException
Description copied from interface: Dao
Creates the Dao from the passed resultset, internally calling the appriate constructor.

Specified by:
fillObject in interface Dao
Parameters:
r - the resultset from a database call, should include the entire object
Returns:
Object populated from the resultset
Throws:
java.sql.SQLException