BEAST
|
Factory for creating cron entries. More...
Public Member Functions | |
CronEntry | create (String expression, String jobName) |
Creates an entry from a cron expression and a job name. | |
CronEntry | create (String expression, String jobName, int id) |
Creates an entry from a cron expression, a job name and an id. | |
CronEntry | create (String seconds, String minute, String hour, String dayOfMonth, String month, String dayOfWeek, String jobName) |
Creates a cron entry. | |
CronEntry | create (String seconds, String minute, String hour, String dayOfMonth, String month, String dayOfWeek, String jobName, int id) |
Creates a cron entry. | |
CronEntry | create (String minute, String hour, String dayOfMonth, String month, String dayOfWeek, String jobName) |
Creates a cron entry. | |
CronEntry | create (String minute, String hour, String dayOfMonth, String month, String dayOfWeek, String jobName, int id) |
Creates a cron entry. | |
CronEntry | create (String hour, String dayOfMonth, String month, String dayOfWeek, String jobName) |
Creates a cron entry. | |
CronEntry | create (String hour, String dayOfMonth, String month, String dayOfWeek, String jobName, int id) |
Creates a cron entry. | |
CronEntry | create (String dayOfMonth, String month, String dayOfWeek, String jobName) |
Creates a cron entry. | |
CronEntry | create (String dayOfMonth, String month, String dayOfWeek, String jobName, int id) |
Creates a cron entry. | |
Protected Member Functions | |
void | validateExpression (String expression) |
Validates that an expression is valid. | |
Factory for creating cron entries.
A cron expression is either 6 or 7 fields with a space between the fields. This means that any special character in a field should never be separated by a space since that will be counted as the next field. The format of the expression is always.
<second> <minute> <hour> <day of month> <month> <day of week> (<year>)
field allowed special character seconds 0 - 59 , - * / minute 0 - 59 , - * / hour 0 - 23 , - * / day of month 0 - 31 , - * ? / L W month 1 - 12 , - * / day of week 1 - 7 or SUN-SAT , - * ? / L # year (optional) empty, 1970-2199 , - * /
If you want to specify all allowed values you can use asterisk (*) which will represent all values between first - last.
It is also possible to define both ranges and lists and a combination of both. Ranges are represented by a hyphen (-) and lists by a comma (,). This means that you could define all minutes between 0 and 10 with 0-10 and hour 0 - 6 and 18-23 with 0-6,18-23 but remember to not use spaces when defining a field since that will flow over to the next field.
You can also define step values by using <range> or * / <value> to indicate specific values. So if you want to execute a cron every second hour between 0 - 6 in the morning you could write 0-6/2 or if you want to specify every second hour the whole day you define it with */2.
L is defined as last which means that in day of month L would have the effect to specify last day in the current month. You can also specify a specific day which means that 6L would represent last friday of the month.
W represents weekdays (2-6) and can be used in conjunction with L which gives that LW represents the last weekday of the month.
gives that if you for example specify 6#3 it would mean the 3rd friday of the month.
Cron entries can also have a seventh field that defines the year but that is optional.
It is not possible to specify both day of week and day of month simultaneously so one of those two entries must be specified with a ? at any time.
For more information about the cron-scheduling, please refer to manual for Quartz.
|
inline |
Creates a cron entry.
dayOfMonth | - day of month pattern |
month | - month pattern |
dayOfWeek | - day of week pattern |
jobName | the name of the job |
|
inline |
Creates a cron entry.
dayOfMonth | - day of month pattern |
month | - month pattern |
dayOfWeek | - day of week pattern |
jobName | - the name of the job |
id | - the id |
|
inline |
Creates an entry from a cron expression and a job name.
expression | the expression |
jobName | the job name |
|
inline |
Creates an entry from a cron expression, a job name and an id.
expression | the expression |
jobName | the job name |
id | the id |
|
inline |
Creates a cron entry.
hour | - hour pattern |
dayOfMonth | - day of month pattern |
month | - month pattern |
dayOfWeek | - day of week pattern |
jobName | - the name of the job |
|
inline |
Creates a cron entry.
hour | - hour pattern |
dayOfMonth | - day of month pattern |
month | - month pattern |
dayOfWeek | - day of week pattern |
jobName | - the name of the job |
id | - the id |
|
inline |
Creates a cron entry.
minute | - minute pattern |
hour | - hour pattern |
dayOfMonth | - day of month pattern |
month | - month pattern |
dayOfWeek | - day of week pattern |
jobName | the name of the job |
|
inline |
Creates a cron entry.
minute | - minute pattern |
hour | - hour pattern |
dayOfMonth | - day of month pattern |
month | - month pattern |
dayOfWeek | - day of week pattern |
jobName | the name of the job |
id | - the id |
|
inline |
Creates a cron entry.
seconds | - second pattern |
minute | - minute pattern |
hour | - hour pattern |
dayOfMonth | - day of month pattern |
month | - month pattern |
dayOfWeek | - day of week pattern |
jobName | the name of the job |
|
inline |
Creates a cron entry.
seconds | - second pattern |
minute | - minute pattern |
hour | - hour pattern |
dayOfMonth | - day of month pattern |
month | - month pattern |
dayOfWeek | - day of week pattern |
jobName | - the name of the job |
id | - the id |
|
inlineprotected |
Validates that an expression is valid.
expression | the expression to validate |
SchedulerException | if the expression isn't valid |