Package com.scalagent.scheduler
Class CronEvent
- java.lang.Object
-
- com.scalagent.scheduler.ScheduleEvent
-
- com.scalagent.scheduler.CronEvent
-
- All Implemented Interfaces:
Serializable
public class CronEvent extends ScheduleEvent
Event requesting a recurrent scheduling to aScheduler. The recurring occurrence time is described in a cron like syntax, that is : <minutes> <hours> <days of month> <months> <days of week> <minutes> = [ 0-59 | * ] <hours> = [ 0-23 | * ] <days of month> = [ 1-31 | * ] <months> = [ 0-11 | * ] <days of week> = [ 0-6 | * ]- See Also:
Scheduler,ScheduleEvent, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static intCRON_DOMdays of monthprivate static intCRON_DOWdays of weekprivate static intCRON_Hhours of dayprivate static intCRON_MAXmax value (+1) forCRON_*constantsprivate static intCRON_MNminutes of hourprivate static intCRON_MOYmonths of yearprivate static int[]maxmaximum for values designed byCRON_*constantsprivate static int[]minminimum for values designed byCRON_*constantsprivate BitSet[]rangescron dates for this eventprivate static longserialVersionUIDdefine serialVersionUID for interoperabilityprivate static String[]valuesstring image forCRON_*constants, by index in the table-
Fields inherited from class com.scalagent.scheduler.ScheduleEvent
date, name, outdatedRestart
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DatenextDate(Date now)Returns the next scheduling date after current date given as parameter.StringBuffertoString(StringBuffer output)Provides a string image for this object.-
Methods inherited from class com.scalagent.scheduler.ScheduleEvent
toString
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
define serialVersionUID for interoperability- See Also:
- Constant Field Values
-
CRON_MN
private static final int CRON_MN
minutes of hour- See Also:
- Constant Field Values
-
CRON_H
private static final int CRON_H
hours of day- See Also:
- Constant Field Values
-
CRON_DOM
private static final int CRON_DOM
days of month- See Also:
- Constant Field Values
-
CRON_MOY
private static final int CRON_MOY
months of year- See Also:
- Constant Field Values
-
CRON_DOW
private static final int CRON_DOW
days of week- See Also:
- Constant Field Values
-
CRON_MAX
private static final int CRON_MAX
max value (+1) forCRON_*constants- See Also:
- Constant Field Values
-
values
private static final String[] values
string image forCRON_*constants, by index in the table
-
min
private static final int[] min
minimum for values designed byCRON_*constants
-
max
private static final int[] max
maximum for values designed byCRON_*constants
-
ranges
private BitSet[] ranges
cron dates for this event
-
-
Constructor Detail
-
CronEvent
public CronEvent(String name, String date) throws IllegalArgumentException
Creates an item.- Parameters:
name- event namedate- event scheduling date as a cron like string- Throws:
IllegalArgumentException- when date is misformed
-
-
Method Detail
-
toString
public StringBuffer toString(StringBuffer output)
Provides a string image for this object.- Overrides:
toStringin classScheduleEvent- Returns:
- a string image for this object
-
nextDate
protected Date nextDate(Date now)
Returns the next scheduling date after current date given as parameter. The new date must be strictly greater than the current date. Anulldate leads to the scheduler deleting the event.- Overrides:
nextDatein classScheduleEvent- Parameters:
now- current date- Returns:
- next scheduling date after now
-
-