BEAST
eu.baltrad.beast.scheduler.CronEntryFactory Class Reference

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.
 

Detailed Description

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 , - &#42; / minute 0 - 59 , - &#42; / hour 0 - 23 , - &#42; / day of month 0 - 31 , - &#42; ? / L W month 1 - 12 , - &#42; / day of week 1 - 7 or SUN-SAT , - &#42; ? / L # year (optional) empty, 1970-2199 , - &#42; /

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 &#42; / <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 &#42;/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.

is another special character that represents the n-th y-th day in the month, which

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.

Author
Anders Henja

Member Function Documentation

◆ create() [1/10]

CronEntry eu.baltrad.beast.scheduler.CronEntryFactory.create ( String dayOfMonth,
String month,
String dayOfWeek,
String jobName )
inline

Creates a cron entry.

Parameters
dayOfMonth- day of month pattern
month- month pattern
dayOfWeek- day of week pattern
jobNamethe name of the job
Returns
a cron entry

◆ create() [2/10]

CronEntry eu.baltrad.beast.scheduler.CronEntryFactory.create ( String dayOfMonth,
String month,
String dayOfWeek,
String jobName,
int id )
inline

Creates a cron entry.

Parameters
dayOfMonth- day of month pattern
month- month pattern
dayOfWeek- day of week pattern
jobName- the name of the job
id- the id
Returns
a cron entry

◆ create() [3/10]

CronEntry eu.baltrad.beast.scheduler.CronEntryFactory.create ( String expression,
String jobName )
inline

Creates an entry from a cron expression and a job name.

Parameters
expressionthe expression
jobNamethe job name
Returns
the cron entry

◆ create() [4/10]

CronEntry eu.baltrad.beast.scheduler.CronEntryFactory.create ( String expression,
String jobName,
int id )
inline

Creates an entry from a cron expression, a job name and an id.

Parameters
expressionthe expression
jobNamethe job name
idthe id
Returns
the cron entry

◆ create() [5/10]

CronEntry eu.baltrad.beast.scheduler.CronEntryFactory.create ( String hour,
String dayOfMonth,
String month,
String dayOfWeek,
String jobName )
inline

Creates a cron entry.

Parameters
hour- hour pattern
dayOfMonth- day of month pattern
month- month pattern
dayOfWeek- day of week pattern
jobName- the name of the job
Returns
a cron entry

◆ create() [6/10]

CronEntry eu.baltrad.beast.scheduler.CronEntryFactory.create ( String hour,
String dayOfMonth,
String month,
String dayOfWeek,
String jobName,
int id )
inline

Creates a cron entry.

Parameters
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
Returns
a cron entry

◆ create() [7/10]

CronEntry eu.baltrad.beast.scheduler.CronEntryFactory.create ( String minute,
String hour,
String dayOfMonth,
String month,
String dayOfWeek,
String jobName )
inline

Creates a cron entry.

Parameters
minute- minute pattern
hour- hour pattern
dayOfMonth- day of month pattern
month- month pattern
dayOfWeek- day of week pattern
jobNamethe name of the job
Returns
a cron entry

◆ create() [8/10]

CronEntry eu.baltrad.beast.scheduler.CronEntryFactory.create ( String minute,
String hour,
String dayOfMonth,
String month,
String dayOfWeek,
String jobName,
int id )
inline

Creates a cron entry.

Parameters
minute- minute pattern
hour- hour pattern
dayOfMonth- day of month pattern
month- month pattern
dayOfWeek- day of week pattern
jobNamethe name of the job
id- the id
Returns
a cron entry

◆ create() [9/10]

CronEntry eu.baltrad.beast.scheduler.CronEntryFactory.create ( String seconds,
String minute,
String hour,
String dayOfMonth,
String month,
String dayOfWeek,
String jobName )
inline

Creates a cron entry.

Parameters
seconds- second pattern
minute- minute pattern
hour- hour pattern
dayOfMonth- day of month pattern
month- month pattern
dayOfWeek- day of week pattern
jobNamethe name of the job
Returns
a cron entry

◆ create() [10/10]

CronEntry eu.baltrad.beast.scheduler.CronEntryFactory.create ( String seconds,
String minute,
String hour,
String dayOfMonth,
String month,
String dayOfWeek,
String jobName,
int id )
inline

Creates a cron entry.

Parameters
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
Returns
a cron entry

◆ validateExpression()

void eu.baltrad.beast.scheduler.CronEntryFactory.validateExpression ( String expression)
inlineprotected

Validates that an expression is valid.

Parameters
expressionthe expression to validate
Exceptions
SchedulerExceptionif the expression isn't valid

The documentation for this class was generated from the following file: