Job (abstract)

Purpose: Represents a task to be completed that can be queued in the JobQueue.

Properties:

boolean scheduledJob

States whether this job's executeStart date is valid and the job should not be started until this specific date and time. If this is false, the job can be executed immediately.

Date executeStart

Date that will be used in determining when the job should be executed. Null if scheduledJob is false.

String errorMessage

Set if the job fails. Describes the error. May use an exception instead.

Boolean urgentJob

If set, job is put in very front of queue. Any urgent job cannot execute ahead of a previously defined urgent job.

Public Methods:

boolean executeJob() (abstract)

Overridden to provide the jobs functionality. This is what is called when it's this jobs turn to run. Returns false if the job fails, true if the job doesn't fail. If it fails, an error message is stored in errorMessage.

String getErrorMessage()

Returns errorMessage if the job has failed. Otherwise returns the empty string “”.

void setExecuteDateAndTime(Date dateAndTime)

Sets the data and time this job will be allowed to execute.

Private Methods:

abstract class. No private functions.

Note:

Someday, an exec command Job might be cool.

Do we need to worry about time zones.

How do we get time? Use z/Server time? Or User system time? Or maybe atomic clock??? yea right :-)

2004-02-29T11:12:51