apollo.Job
Interface Job

All Known Implementing Classes:
JobRecord

public interface Job

This is the Job interface. This interface is implemented by Jobs to be executed by the JobManager


Method Summary
 JobResult execute()
          This is the method which the JobManager will run when it tries to execute a job.
 java.lang.String getError()
          This method returns a string describing the error which occoured during Job Execution.
 java.lang.String getExtendedStatus()
          This field provides additional data as to the state of the job.
 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.util.Date getStartDate()
          This method should return the StartDate as set by the JobManager
 int getStatusID()
          This method returns the statusID of the Job.
 void setError(java.lang.String error)
          This sets the Error message.
 void setJobID(int jobID)
          This method is called by the JobManager when it issues the Job and JobID
 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.
 

Method Detail

execute

public JobResult execute()
                  throws java.lang.Exception
This is the method which the JobManager will run when it tries to execute a job. If an exception is thrown from this method, the JobManager will catch it. The Job will be placed into the FAILED state, and the stack trace is stored for later debugging.

getPercentage

public double getPercentage()
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

getStatusID

public int getStatusID()
This method returns the statusID of the Job. You may declare custom Status States.

setStatusID

public void setStatusID(int statusID)
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.

getExtendedStatus

public java.lang.String getExtendedStatus()
This field provides additional data as to the state of the job. This string may perhaps return what operation the job is currently performing.

getJobResult

public 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.

setJobID

public void setJobID(int jobID)
This method is called by the JobManager when it issues the Job and JobID

getJobID

public int getJobID()
This returns the JobID the Job was issued by the JobManager

getError

public java.lang.String getError()
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

setError

public void setError(java.lang.String error)
This sets the Error message. If no error message was supplied then the JobManager will put the exception stack trace in it's place

getJobName

public java.lang.String getJobName()
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

getStartDate

public java.util.Date getStartDate()
This method should return the StartDate as set by the JobManager

setStartDate

public void setStartDate(java.util.Date startDate)
When a Job is started by the JobManager it will attempt to set the startDate field