Class CronTriggerBuilder


  • public class CronTriggerBuilder
    extends java.lang.Object
    Use this to construct a TriggerDefinition for 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
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static TriggerDefinition create​(java.lang.String expression)
      Create a new Definition for a CronTrigger using given cron expression.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CronTriggerBuilder

        public CronTriggerBuilder()
    • 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