| java.lang.Object com.jcorporate.expresso.services.crontab.CrontabEntry
CrontabEntry | public class CrontabEntry implements Comparable,java.io.Serializable(Code) | | CrontabEntry represents a repeatable 'action' that can take place at a given
date and time.
A crontab entry's sort order creates differences between Comparable and
equals(). the objects are compared by the execution time. They are tested
for equality by testing time AND the listeners
author: Mike Dubman |
Constructor Summary | |
public | CrontabEntry(Date date, CrontabListenerI listener) Constructs a Crontab Entry class. | public | CrontabEntry(int delay, boolean isRepetitive, CrontabListenerI listener) | public | CrontabEntry(int minute, int hour, int dayOfMonth, int month, int dayOfWeek, int year, CrontabListenerI listener) Construct a Crontab entry. | public | CrontabEntry(int minute, int hour, int dayOfMonth, int month, int dayOfWeek, int year, String jobLabel, CrontabListenerI listener) Construct a Crontab entry. |
TIME_UNUSED | final public static int TIME_UNUSED(Code) | | Constant that represents a 'time' value that is unused.
|
alarmTime | protected long alarmTime(Code) | | When is the next time for the alarm
|
counterValue | protected long counterValue(Code) | | Unique id for sorting.
|
dayOfMonth | protected int dayOfMonth(Code) | | day of month for the crontab
|
dayOfWeek | protected int dayOfWeek(Code) | | day of week for the crontab
|
globalCounter | protected static long globalCounter(Code) | | |
hour | protected int hour(Code) | | Hours for the crontab
|
isRelative | protected boolean isRelative(Code) | | Is the crontab a 'relative' time?
|
isRepetitive | protected boolean isRepetitive(Code) | | Is the crontab a repetitive job
|
jobNumber | protected String jobNumber(Code) | | Job Number for this CrontabEntry's associated JobQueue entry
|
minute | protected int minute(Code) | | The minutes for the crontab
|
month | protected int month(Code) | | month for the crontab
|
year | protected int year(Code) | | year for the crontab
|
CrontabEntry | public CrontabEntry(Date date, CrontabListenerI listener) throws CronException(Code) | | Constructs a Crontab Entry class.
Parameters: date - The date to execute the crontab listener Parameters: listener - The class to execute when the alarm 'rings' throws: CronException - upon error |
CrontabEntry | public CrontabEntry(int delay, boolean isRepetitive, CrontabListenerI listener)(Code) | | Construct a new crontab entry with a given delay
Parameters: delay - the job until the number of minutes in the next hour Parameters: isRepetitive - set if the job should be executed every X amount oftime Parameters: listener - the interface to notify when the cron 'rings' throws: IllegalArgumentException - if the delay is less than 1 |
CrontabEntry | public CrontabEntry(int minute, int hour, int dayOfMonth, int month, int dayOfWeek, int year, CrontabListenerI listener) throws CronException(Code) | | Construct a Crontab entry.
Parameters: minute - Minute of the hour to execute Parameters: hour - Hour of the day to execute Parameters: dayOfMonth - The day of the month to execute Parameters: month - The month of the year to execute Parameters: dayOfWeek - The day of the week to execute Parameters: year - to execute OR TIME_UNUSED if this is a repetative crontabentry Parameters: listener - The class that gets called when the crontab 'rings' throws: CronException - upon error |
CrontabEntry | public CrontabEntry(int minute, int hour, int dayOfMonth, int month, int dayOfWeek, int year, String jobLabel, CrontabListenerI listener) throws CronException(Code) | | Construct a Crontab entry.
Parameters: minute - Minute of the hour to execute Parameters: hour - Hour of the day to execute Parameters: dayOfMonth - The day of the month to execute Parameters: month - The month of the year to execute Parameters: dayOfWeek - The day of the week to execute Parameters: year - to execute OR TIME_UNUSED if this is a repetative crontabentry Parameters: jobLabel - - The label of the crontab entry. Parameters: listener - The class that gets called when the crontab 'rings' throws: CronException - upon error |
adjustExecutionTime | protected synchronized void adjustExecutionTime(Calendar now, Calendar alarm)(Code) | | Adjusts the execution time so that the next execution time is proper
ie.. all cron rules should be followed and the next cron execution
should be greater than now.
Parameters: now - 'now' calendar instance Parameters: alarm - the next instance that the calendar should execute. |
compareTo | public synchronized int compareTo(Object obj)(Code) | | Standard comparison operator. Checks against the alarm entry time.
compareTo and equals behave differently. compareTo only sorts by alarm
time. Equals checks alarm times and listeners
Parameters: obj - The object to compare against. integer as per standard Object.compareTo values See Also: java.lang.Comparable.compareTo |
equals | public synchronized boolean equals(Object obj)(Code) | | Returns true if the two alarm times of the comparing crontab entries are
equal.
Parameters: obj - The CrontabEntry to compare against. true if the two objects are equal |
getAlarmTime | public long getAlarmTime()(Code) | | Get the alarm time in system time.
long integer. |
getCounter | public long getCounter()(Code) | | Retrieve an incrementing id value unique across crontab instances
long value. |
getDayOfMonth | public int getDayOfMonth()(Code) | | Retrieve the day of month setting
integer |
getDayOfWeek | public int getDayOfWeek()(Code) | | Return day of week setting
integer |
getHour | public int getHour()(Code) | | Retrieve hour setting
integer |
getJobNumber | public String getJobNumber()(Code) | | Return Job Number for this CrontabEntry's associated JobQueue entry
Job Number for this CrontabEntry's associated JobQueue entry |
getLabel | public String getLabel()(Code) | | Retrieve the label of the entry
java.lang.String |
getMinute | public int getMinute()(Code) | | Retrieve the minutes of the entry
integer |
getMonth | public int getMonth()(Code) | | Return the month value of the entry
integer |
getYear | public int getYear()(Code) | | Return the year value of the entry
integer |
isIsRelative | public boolean isIsRelative()(Code) | | Return isRelative value
boolean |
isIsRepetitive | public boolean isIsRepetitive()(Code) | | Retrieve the isRepetitive value
boolean |
setCounterValue | protected void setCounterValue()(Code) | | Sets the counter so that order is guaranteed
|
setJobNumber | public void setJobNumber(String s)(Code) | | Set Job Number for this CrontabEntry's associated JobQueue entry
Parameters: s - Job Number for this CrontabEntry's associated JobQueue entry |
toString | public synchronized String toString()(Code) | | Returns the class as a string. Useful for debugging purposes
a String representing this class. |
updateEntryTime | public synchronized void updateEntryTime()(Code) | | Set the new/latest time. For example, if it's a repeatable and the last
alarm time is passed, then we calculate the next one.
|
|
|