Class CronTriggerBuilder
- java.lang.Object
-
- com.inet.taskplanner.server.api.trigger.CronTriggerBuilder
-
public class CronTriggerBuilder extends java.lang.ObjectUse this to construct aTriggerDefinitionfor a cron Trigger.A cron trigger only needs one expression to be configured. The expression has the following syntax:
(minute) (hour) (dayOfMonth) (month) (dayOfWeek) (year)
Each value is separated by a space, the year value can be omitted. Only one of dayOfMonth and dayOfWeek can be specified, the other one must be '?'. It follows the QUARTZ syntax without the seconds value! See http://www.quartz-scheduler.org/documentation/quartz-2.x/tutorials/crontrigger.html for more detais on the syntax.Example usage:
TaskDefinition task = new TaskDefinition("mytask"); TriggerDefinition cron = CronTriggerBuilder.create("0 18 1 * ?"); task.addTrigger(cron); // ...add jobs and Actions... TaskPlanner.getInstance().addTask( task );- Since:
- taskplanner 3.0
-
-
Constructor Summary
Constructors Constructor Description CronTriggerBuilder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TriggerDefinitioncreate(java.lang.String expression)Create a new Definition for a CronTrigger using given cron expression.
-
-
-
Method Detail
-
create
public static TriggerDefinition create(java.lang.String expression)
Create a new Definition for a CronTrigger using given cron expression.- Parameters:
expression- the expression to use- Returns:
- the definition which can be added to the task
- Throws:
java.lang.IllegalArgumentException- if the given expression is null, empty or invalid.- Since:
- taskplanner 3.0
-
-