com.raritantechnologies.searchApp.scheduler
Class JobSchedule

java.lang.Object
  extended bycom.raritantechnologies.searchApp.scheduler.JobSchedule
All Implemented Interfaces:
IConfigurable, IJobProcessListener
Direct Known Subclasses:
OnDemandSchedule, SimpleJobSchedule, SingleJobSchedule, TimedJobSchedule

public abstract class JobSchedule
extends java.lang.Object
implements IConfigurable, IJobProcessListener

Abstract base class for JobSchedule classes. JobSchedule classes which define the timing of scheduling of a job. These classes extend this abstract base class and implement methods used by the Scheduler to determine if a job is ready to be run at a given date and time.


Developed by Raritan Technologies .

Author:
Ted Sullivan

Field Summary
static int COMPLETED
           
static int COMPLETED_NORMALLY
           
protected  int completedJobStatus
           
protected  java.util.Date completedTime
           
protected  int jobStatus
           
static int REMOTED
           
static int SCHEDULED
           
protected  java.util.Date scheduledTime
           
static int STARTED
           
protected  java.util.Date startedTime
           
static int UNSCHEDULED
           
 
Constructor Summary
JobSchedule()
           
 
Method Summary
 java.lang.Integer addListener(IJobProcessListener listener)
           
protected  void didRun(java.util.Date at)
          didRun should be removed since it sets the lastTime the job was run.
 int getCompletedJobStatus()
           
 int getCompletedStatus()
           
 java.util.Date getCompletedTime()
           
 java.util.Date getJobCompletedTime()
          Returns time at which the Job process executeJob( ) method completed.
 java.util.Date getJobScheduledTime()
          Returns time at which the Scheduler added the Job to the queue.
 java.util.Date getJobStartTime()
          Returns time at which the JobDispatcher initiated the job process.
 int getJobStatus()
           
 java.util.Date getScheduledTime()
           
 java.util.Date getStartedTime()
           
 void initialize(org.w3c.dom.Element elem)
          Initializes the object from an XML tag or element.
 void jobCompleted(java.lang.Object process, java.util.Date at, int status)
          set status = 0 for normal completion.
 void jobScheduled(java.util.Date at)
           
 void jobStarting(java.util.Date at)
           
 void removeListener(java.lang.Integer listenerID)
           
 void setCompletedJobStatus(int completedJobStatus)
           
 void setCompletedTime(java.util.Date completedTime)
           
 void setJobStatus(int jobStatus)
           
 void setScheduledTime(java.util.Date scheduledTime)
           
 void setStartedTime(java.util.Date startedTime)
           
 boolean shouldRun(java.util.Date now)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNSCHEDULED

public static final int UNSCHEDULED
See Also:
Constant Field Values

SCHEDULED

public static final int SCHEDULED
See Also:
Constant Field Values

STARTED

public static final int STARTED
See Also:
Constant Field Values

COMPLETED

public static final int COMPLETED
See Also:
Constant Field Values

REMOTED

public static final int REMOTED
See Also:
Constant Field Values

COMPLETED_NORMALLY

public static final int COMPLETED_NORMALLY
See Also:
Constant Field Values

jobStatus

protected int jobStatus

completedJobStatus

protected int completedJobStatus

scheduledTime

protected java.util.Date scheduledTime

startedTime

protected java.util.Date startedTime

completedTime

protected java.util.Date completedTime
Constructor Detail

JobSchedule

public JobSchedule()
Method Detail

shouldRun

public boolean shouldRun(java.util.Date now)

initialize

public void initialize(org.w3c.dom.Element elem)
Description copied from interface: IConfigurable
Initializes the object from an XML tag or element. This method is called by the Framework as part of the application initializtion. see ConfigurationManager, XMLConfigurationManager, XMLSearchFieldMapFactory, XMLSearchSourceFactory. Configurable objects that are owned or contained by other configurable objects will be initialized in by the parent object.

Specified by:
initialize in interface IConfigurable

getJobStatus

public int getJobStatus()
Specified by:
getJobStatus in interface IJobProcessListener

setJobStatus

public void setJobStatus(int jobStatus)

getCompletedJobStatus

public int getCompletedJobStatus()

setCompletedJobStatus

public void setCompletedJobStatus(int completedJobStatus)

getScheduledTime

public java.util.Date getScheduledTime()

setScheduledTime

public void setScheduledTime(java.util.Date scheduledTime)

getStartedTime

public java.util.Date getStartedTime()

setStartedTime

public void setStartedTime(java.util.Date startedTime)

getCompletedTime

public java.util.Date getCompletedTime()

setCompletedTime

public void setCompletedTime(java.util.Date completedTime)

jobScheduled

public void jobScheduled(java.util.Date at)
Specified by:
jobScheduled in interface IJobProcessListener

jobStarting

public void jobStarting(java.util.Date at)
Specified by:
jobStarting in interface IJobProcessListener

jobCompleted

public void jobCompleted(java.lang.Object process,
                         java.util.Date at,
                         int status)
set status = 0 for normal completion.

Specified by:
jobCompleted in interface IJobProcessListener

getCompletedStatus

public int getCompletedStatus()
Specified by:
getCompletedStatus in interface IJobProcessListener

getJobScheduledTime

public java.util.Date getJobScheduledTime()
Returns time at which the Scheduler added the Job to the queue.

Specified by:
getJobScheduledTime in interface IJobProcessListener

getJobStartTime

public java.util.Date getJobStartTime()
Returns time at which the JobDispatcher initiated the job process.

Specified by:
getJobStartTime in interface IJobProcessListener

getJobCompletedTime

public java.util.Date getJobCompletedTime()
Returns time at which the Job process executeJob( ) method completed.

Specified by:
getJobCompletedTime in interface IJobProcessListener

didRun

protected void didRun(java.util.Date at)
didRun should be removed since it sets the lastTime the job was run. The last job run time is set at the same time as the startTime


addListener

public java.lang.Integer addListener(IJobProcessListener listener)

removeListener

public void removeListener(java.lang.Integer listenerID)