atg.service.scheduler
Interface Schedule

All Known Implementing Classes:
AbsoluteSchedule, CalendarSchedule, PeriodicSchedule, RelativeSchedule

public interface Schedule

A Schedule is used to specify when a scheduled job is to take place. The Schedule is able to calculate the next time that its job will take place. The Schedule also indicates whether it is a repeating or one-shot job (a repeating job remains in a Scheduler after it occurs, a one-shot job is removed from the Scheduler after it occurs).

It is possible that some more complex Schedules will be unable to calculate the next time a scheduled job will occur. The Scheduler handling the Schedule is responsible for dealing with these Schedules. For example, the CalendarSchedule is unable to calculate its next job time unless its job will occur on the current date. The Scheduler can handle these by checking every midnight to see if any Schedulers that were unable to calculate their next times before will now be able to do so.

See Also:
AbsoluteSchedule, RelativeSchedule, PeriodicSchedule, CalendarSchedule

Field Summary
static java.lang.String CLASS_VERSION
           
 
Method Summary
 long getNextJobTime(long pLastOccurrenceTime)
          Returns the next time that the job Scheduled by this will take place.
 boolean isRepeating()
          Returns true if this is a repeating job, false if this is a one-shot job.
 boolean mustKnowFirstTime()
          If true, then the first time getNextJobTime is called it will be called with -1.
 java.lang.String scheduleString()
          Returns a Parseable representation of this Schedule.
 java.lang.String scheduleString(java.util.Locale pLocale)
          Returns a Parseable representation of this Schedule based on the locale.
 

Field Detail

CLASS_VERSION

static final java.lang.String CLASS_VERSION
See Also:
Constant Field Values
Method Detail

getNextJobTime

long getNextJobTime(long pLastOccurrenceTime)
Returns the next time that the job Scheduled by this will take place.

Parameters:
pLastOccurrenceTime - the last time the job occurred, or -1 if it has not yet occurred.
Returns:
the next time that the job will occur, or -1 if the job's next time could not be calculated.

mustKnowFirstTime

boolean mustKnowFirstTime()
If true, then the first time getNextJobTime is called it will be called with -1. Otherwise, the first time getNextJobTime is called it will be called with the current time.


isRepeating

boolean isRepeating()
Returns true if this is a repeating job, false if this is a one-shot job.


scheduleString

java.lang.String scheduleString()
Returns a Parseable representation of this Schedule.


scheduleString

java.lang.String scheduleString(java.util.Locale pLocale)
Returns a Parseable representation of this Schedule based on the locale.