Class TriggerFactory


  • public class TriggerFactory
    extends Object
    Helper methods for creating quartz triggers.
    Author:
    XIMA MEDIA GmbH
    • Constructor Detail

      • TriggerFactory

        public TriggerFactory()
    • Method Detail

      • getDateTrigger

        public static org.quartz.Trigger getDateTrigger​(org.quartz.TriggerKey triggerKey,
                                                        Date startDate,
                                                        boolean ignoreMisfired)
        Parameters:
        triggerKey - TriggerKey to use for the trigger
        startDate - Date when the trigger should fire
        ignoreMisfired - true if misfired triggers should be ignored, false otherwise
        Returns:
        Trigger the created trigger
      • getDateTrigger

        public static org.quartz.Trigger getDateTrigger​(org.quartz.TriggerKey triggerKey,
                                                        Instant startInstant,
                                                        boolean ignoreMisfired)
        Parameters:
        triggerKey - TriggerKey to use for the trigger
        startInstant - Instant when the trigger should fire
        ignoreMisfired - true if misfired triggers should be ignored, false otherwise
        Returns:
        Trigger the created trigger
      • getDelayTrigger

        public static org.quartz.Trigger getDelayTrigger​(org.quartz.TriggerKey triggerKey,
                                                         int delay,
                                                         org.quartz.DateBuilder.IntervalUnit delayUnit,
                                                         boolean ignoreMisfired)
        Parameters:
        triggerKey - TriggerKey to use for the trigger
        delay - Delay for the trigger when it should fire. The trigger fires after this amount of time relative to NOW.
        delayUnit - Unit of the given delay.
        ignoreMisfired - true if misfired triggers should be ignored, false otherwise
        Returns:
        The newly created trigger for the given delay.
      • getCronTrigger

        public static org.quartz.Trigger getCronTrigger​(org.quartz.TriggerKey triggerKey,
                                                        org.quartz.CronExpression cronExpression,
                                                        boolean ignoreMisfired)
        Parameters:
        triggerKey - TriggerKey to use for the trigger
        cronExpression - Cron expression for when the trigger should fire.
        ignoreMisfired - true if misfired triggers should be ignored, false otherwise
        Returns:
        The newly created trigger for the given cron expression.