apollo.Job
Class JobRecord

java.lang.Object
  |
  +--apollo.Storable.Storable
        |
        +--apollo.Job.JobRecord
All Implemented Interfaces:
Job, java.io.Serializable

public class JobRecord
extends Storable
implements java.io.Serializable, Job

JobRecord Created from MysqlAdmin

See Also:
Serialized Form

Field Summary
static java.lang.String[] fieldPrimaryKey
           
static java.lang.Object[][] fieldType
           
 
Fields inherited from class apollo.Storable.Storable
AVERAGE, COUNT, CUSTOM, False, fieldIndex, fieldNames, MAX, MIN, NON_UNIQUE, SUM, True, UNIQUE
 
Constructor Summary
JobRecord(java.lang.Integer jobID, java.lang.String jobName, java.lang.Integer statusID, java.lang.String result, java.lang.Integer resultTypeID, java.lang.String filename, java.lang.String error, java.util.Date startDate)
           
 
Method Summary
 JobResult execute()
          Required for the Job interface
 java.lang.String getError()
          This method returns a string describing the error which occoured during Job Execution.
 java.lang.String getExtendedStatus()
          No extended status from the DB
 java.lang.Object[] getFieldValues()
          This must return the data the object is having stored.
 java.lang.String getFilename()
           
 int getJobID()
          This returns the JobID the Job was issued by the JobManager
 java.lang.String getJobName()
          It is often useful for naming a Job.
 JobResult getJobResult()
          This method queries the Job for the JobResult object; which is the object which stores the return results of the Job's execution cycle.
 double getPercentage()
          This method is useful for querying the Percentage Complete the job is.
 java.lang.String getResult()
           
 java.lang.Integer getResultType()
           
 java.util.Date getStartDate()
          This method should return the StartDate as set by the JobManager
 int getStatusID()
          This method returns the statusID of the Job.
static JobRecord[] loadArrayInstance(ManagerTracker MT, WhereStatement whereStatement)
           
static JobRecord loadInstance(ManagerTracker MT, java.lang.Object[] theLoadKey)
           
static java.util.Vector loadVectorInstance(ManagerTracker MT, WhereStatement whereStatement)
           
static void main(java.lang.String[] s)
           
protected  void setAutoIncrement(long l)
           
 void setError(java.lang.String error)
          This sets the Error message.
 void setFilename(java.lang.String filename)
           
 void setJobID(int jobID)
          This method is called by the JobManager when it issues the Job and JobID
 void setJobID(java.lang.Integer jobID)
           
 void setJobName(java.lang.String jobName)
           
 void setResult(java.lang.String result)
           
 void setResultType(java.lang.Integer resultTypeID)
           
 void setStartDate(java.util.Date startDate)
          When a Job is started by the JobManager it will attempt to set the startDate field
 void setStatusID(int statusID)
          This methos is most often used by the JobManager.
 void setStatusID(java.lang.Integer statusID)
           
 
Methods inherited from class apollo.Storable.Storable
addValueAtomic, begin, commit, equals, getFieldNames, getFieldPrimaryKey, getIndexForField, getPrimaryKeyValues, getPrimaryKeyValuesVector, insert, loadArrayInstance, loadArrayInstance, loadFunction, loadFunction, loadInstance, loadVectorInstance, loadVectorInstance, remove, rollback, setUpdatedField, SQLSanitize, synchronize, tableCreated, testStorableConfiguration, toString, update
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fieldType

public static final java.lang.Object[][] fieldType

fieldPrimaryKey

public static final java.lang.String[] fieldPrimaryKey
Constructor Detail

JobRecord

public JobRecord(java.lang.Integer jobID,
                 java.lang.String jobName,
                 java.lang.Integer statusID,
                 java.lang.String result,
                 java.lang.Integer resultTypeID,
                 java.lang.String filename,
                 java.lang.String error,
                 java.util.Date startDate)
Method Detail

getFieldValues

public java.lang.Object[] getFieldValues()
Description copied from class: Storable
This must return the data the object is having stored. This is returned in the form of an Objects array. You must turn your primitives into objects. They will be converted back. NOTE: This must return in the order of fieldNames, fieldTypes, fieldCanBeNull and fieldPrimaryKey.
Overrides:
getFieldValues in class Storable

setAutoIncrement

protected void setAutoIncrement(long l)
Overrides:
setAutoIncrement in class Storable

getJobID

public int getJobID()
Description copied from interface: Job
This returns the JobID the Job was issued by the JobManager
Specified by:
getJobID in interface Job

setJobID

public void setJobID(java.lang.Integer jobID)

getJobName

public java.lang.String getJobName()
Description copied from interface: Job
It is often useful for naming a Job. The name of the job is stored in the JobRecord; it is helpful for determinig what Job was running
Specified by:
getJobName in interface Job

setJobName

public void setJobName(java.lang.String jobName)

getStatusID

public int getStatusID()
Description copied from interface: Job
This method returns the statusID of the Job. You may declare custom Status States.
Specified by:
getStatusID in interface Job

setStatusID

public void setStatusID(java.lang.Integer statusID)

setStatusID

public void setStatusID(int statusID)
Description copied from interface: Job
This methos is most often used by the JobManager. The JobManager may attempt to set the StatusID of a Job when it has detected the Job has failed.
Specified by:
setStatusID in interface Job

getResult

public java.lang.String getResult()

setResult

public void setResult(java.lang.String result)

getResultType

public java.lang.Integer getResultType()

setResultType

public void setResultType(java.lang.Integer resultTypeID)

getFilename

public java.lang.String getFilename()

setFilename

public void setFilename(java.lang.String filename)

getError

public java.lang.String getError()
Description copied from interface: Job
This method returns a string describing the error which occoured during Job Execution. This method is queried by the JobManager when a Job has failed
Specified by:
getError in interface Job

setError

public void setError(java.lang.String error)
Description copied from interface: Job
This sets the Error message. If no error message was supplied then the JobManager will put the exception stack trace in it's place
Specified by:
setError in interface Job

setStartDate

public void setStartDate(java.util.Date startDate)
Description copied from interface: Job
When a Job is started by the JobManager it will attempt to set the startDate field
Specified by:
setStartDate in interface Job

getStartDate

public java.util.Date getStartDate()
Description copied from interface: Job
This method should return the StartDate as set by the JobManager
Specified by:
getStartDate in interface Job

loadInstance

public static JobRecord loadInstance(ManagerTracker MT,
                                     java.lang.Object[] theLoadKey)

loadArrayInstance

public static JobRecord[] loadArrayInstance(ManagerTracker MT,
                                            WhereStatement whereStatement)

loadVectorInstance

public static java.util.Vector loadVectorInstance(ManagerTracker MT,
                                                  WhereStatement whereStatement)

execute

public JobResult execute()
                  throws java.lang.Exception
Required for the Job interface
Specified by:
execute in interface Job

getPercentage

public double getPercentage()
Description copied from interface: Job
This method is useful for querying the Percentage Complete the job is. This may be useful if the user is presented with a progress meter showing how complete the Job is. The programmer must set the value to return here
Specified by:
getPercentage in interface Job

getExtendedStatus

public java.lang.String getExtendedStatus()
No extended status from the DB
Specified by:
getExtendedStatus in interface Job

main

public static void main(java.lang.String[] s)

getJobResult

public JobResult getJobResult()
Description copied from interface: Job
This method queries the Job for the JobResult object; which is the object which stores the return results of the Job's execution cycle.
Specified by:
getJobResult in interface Job

setJobID

public void setJobID(int jobID)
Description copied from interface: Job
This method is called by the JobManager when it issues the Job and JobID
Specified by:
setJobID in interface Job