Class ComplexJobTrigger

  • All Implemented Interfaces:
    Serializable, IJobTrigger

    public class ComplexJobTrigger
    extends JobTrigger
    Used to specify a recurrence of scheduled job execution or a recurrence of scheduler availability.
    Author:
    arodriguez
    See Also:
    Serialized Form
    • Constructor Detail

      • ComplexJobTrigger

        public ComplexJobTrigger​(Integer year,
                                 Integer month,
                                 Integer dayOfMonth,
                                 Integer dayOfWeek,
                                 Integer hourOfDay)
        Creates a recurrence for the specified date/time. Specifying both a day of month and day of week is not supported. At least one of them should be null. If both are specified only the day of month will be used.
        Parameters:
        year - the year to occur. If null recurrence will be every year.
        month - the month to occur. If null recurrence will be every month.
        dayOfMonth - the day of month to occur. If null recurrence will be every day of month. If specified day of week must be null.
        dayOfWeek - the day of week to occur. If null recurrence will be every day of week. If specified day of month must be null.
        hourOfDay - the hour of day to occur. If null recurrence will be every hour of day.
      • ComplexJobTrigger

        public ComplexJobTrigger()
        Creates a default recurrence of every day of every year at midnight.
    • Method Detail

      • getRepeatInterval

        public long getRepeatInterval()
      • setRepeatInterval

        public void setRepeatInterval​(long repeatIntervalSeconds)
      • addYearlyRecurrence

        public void addYearlyRecurrence​(ITimeRecurrence recurrence)
        Add a recurrence to the yearly recurrences.
        Parameters:
        recurrence - the yearly recurrence. If null no addition occurs.
      • addYearlyRecurrence

        public void addYearlyRecurrence​(Integer... recurrence)
        Add a recurrence to the yearly recurrences.
        Parameters:
        recurrence - the yearly recurrence. If null no addition occurs.
      • setYearlyRecurrence

        public void setYearlyRecurrence​(ITimeRecurrence recurrence)
        Overrides any previously applied yearly recurrences with the provided recurrence.
        Parameters:
        recurrence - the yearly recurrence. If null it will recur every year.
      • setYearlyRecurrence

        public void setYearlyRecurrence​(Integer... recurrence)
        Overrides any previously applied yearly recurrences with the provided recurrence.
        Parameters:
        recurrence - the yearly recurrence. If not recurrences are provided it will recur every year.
      • addMonthlyRecurrence

        public void addMonthlyRecurrence​(ITimeRecurrence recurrence)
        Add a recurrence to the monthly recurrence.
        Parameters:
        recurrence - the monthly recurrence. If null no addition occurs.
      • addMonthlyRecurrence

        public void addMonthlyRecurrence​(Integer... recurrence)
        Add a recurrence to the monthly recurrence (1=January, 12=December).
        Parameters:
        recurrence - the monthly recurrence. If null no addition occurs.
      • setMonthlyRecurrence

        public void setMonthlyRecurrence​(ITimeRecurrence recurrence)
        Overrides any previously applied monthly recurrences with the provided recurrence.
        Parameters:
        recurrence - the monthly recurrence. If null it will recur every month.
      • setMonthlyRecurrence

        public void setMonthlyRecurrence​(Integer... recurrence)
        Overrides any previously applied monthly recurrences with the provided recurrence (1=January, 12=December).
        Parameters:
        recurrence - the monthly recurrence. If no recurrences are provided it will recur every month.
      • addDayOfMonthRecurrence

        public void addDayOfMonthRecurrence​(ITimeRecurrence recurrence)
        Add a recurrence to the day of month recurrence. Calling this method with a non-null parameter causes the day of week recurrence to be set to all days of the week.
        Parameters:
        recurrence - the day of month recurrences. If null no modification is made to this object.
      • addDayOfMonthRecurrence

        public void addDayOfMonthRecurrence​(Integer... recurrence)
        Add a recurrence to the day of week recurrence. Calling this method with a non-null parameter causes the day of month recurrence to be set to all days of the month.
        Parameters:
        recurrence - the day of week recurrences. If null no modification is made to this object.
      • setDayOfMonthRecurrence

        public void setDayOfMonthRecurrence​(ITimeRecurrence recurrence)
        Overrides any previously applied day of month recurrences with the provided recurrence. Calling this method with a non-null parameter causes the day of week recurrence to be set to all days of the week.
        Parameters:
        recurrence - the day of month recurrences. If null it will recur every day of month.
      • setDayOfMonthRecurrence

        public void setDayOfMonthRecurrence​(Integer... recurrence)
        Overrides any previously applied day of month recurrences with the provided recurrence. Calling this method with one or more days of month causes the day of week recurrence to be set to all days of the week.
        Parameters:
        recurrence - the day of month recurrences. If no days of month are provided it will recur every day of month.
      • addDayOfWeekRecurrence

        public void addDayOfWeekRecurrence​(ITimeRecurrence recurrence)
        Add a recurrence to the day of week recurrence. Calling this method with a non-null parameter causes the day of month recurrence to be set to all days of the month.
        Parameters:
        recurrence - the day of week recurrences. If null no modification is made to this object.
      • addDayOfWeekRecurrence

        public void addDayOfWeekRecurrence​(Integer... recurrence)
        Add a recurrence to the day of week recurrence (1=Sunday, 7=Saturday). Calling this method with a non-null parameter causes the day of month recurrence to be set to all days of the month.
        Parameters:
        recurrence - the day of week recurrences. If null no modification is made to this object.
      • setDayOfWeekRecurrence

        public void setDayOfWeekRecurrence​(ITimeRecurrence recurrence)
        Overrides any previously applied day of week recurrences with the provided recurrence. Calling this method with a non-null parameter causes the day of month recurrence to be set to all days of the month.
        Parameters:
        recurrence - the day of week recurrences. If null it will recur every day of week.
      • setDayOfWeekRecurrence

        public void setDayOfWeekRecurrence​(Integer... recurrence)
        Overrides any previously applied day of week recurrences with the provided recurrence (1=Sunday, 7=Saturday). Calling this method with one or more days of week causes the day of month recurrence to be set to all days of the month.
        Parameters:
        recurrence - the day of week recurrences. If no days of week are provided it will recur every day of the week.
      • addHourlyRecurrence

        public void addHourlyRecurrence​(ITimeRecurrence recurrence)
        Add a recurrence to the hourly recurrence.
        Parameters:
        recurrence - the hourly recurrence. If null no modification is made to this object.
      • addHourlyRecurrence

        public void addHourlyRecurrence​(Integer... recurrence)
        Add a recurrence to the minute recurrence.
        Parameters:
        recurrence - the minute recurrence. If null no modification is made to this object.
      • setHourlyRecurrence

        public void setHourlyRecurrence​(ITimeRecurrence recurrence)
        Overrides any previously applied hourly recurrences with the provided recurrence.
        Parameters:
        recurrence - the hourly recurrence. If null it will recur every hour
      • setHourlyRecurrence

        public void setHourlyRecurrence​(Integer... recurrence)
        Overrides any previously applied hourly recurrences with the provided recurrence.
        Parameters:
        recurrence - the hourly recurrence. If no recurrence is provided it will recur every hour.
      • addMinuteRecurrence

        public void addMinuteRecurrence​(ITimeRecurrence recurrence)
        Add a recurrence to the minute recurrence.
        Parameters:
        recurrence - the minute recurrence. If null no modification is made to this object.
      • addMinuteRecurrence

        public void addMinuteRecurrence​(Integer... recurrence)
        Add a recurrence to the minute recurrence.
        Parameters:
        recurrence - the minute recurrence. If null no modification is made to this object.
      • setMinuteRecurrence

        public void setMinuteRecurrence​(ITimeRecurrence recurrence)
        Overrides any previously applied minute recurrences with the provided recurrence.
        Parameters:
        recurrence - the minute recurrence. If null it will recur every minute.
      • setMinuteRecurrence

        public void setMinuteRecurrence​(Integer... recurrence)
        Overrides any previously applied minute recurrences with the provided recurrence.
        Parameters:
        recurrence - the minute recurrence. If no recurrence is provided it will recur every minute.
      • addSecondRecurrence

        public void addSecondRecurrence​(ITimeRecurrence recurrence)
        Add a recurrence to the second recurrence.
        Parameters:
        recurrence - the second recurrence. If null no modification is made to this object.
      • addSecondRecurrence

        public void addSecondRecurrence​(Integer... recurrence)
        Add a recurrence to the second recurrence.
        Parameters:
        recurrence - the second recurrence. If null no modification is made to this object.
      • setSecondRecurrence

        public void setSecondRecurrence​(ITimeRecurrence recurrence)
        Overrides any previously applied second recurrences with the provided recurrence.
        Parameters:
        recurrence - the second recurrence. If null it will recur every second.
      • setSecondRecurrence

        public void setSecondRecurrence​(Integer... recurrence)
        Overrides any previously applied second recurrences with the provided recurrence.
        Parameters:
        recurrence - the second recurrence. If no recurrence is provided it will recur every second.
      • getYearlyRecurrences

        public YearlyWrapper getYearlyRecurrences()
        Returns the yearly recurrence.
        Returns:
        the yearly recurrence. An empty list indicates a recurrence of every year.
      • getMonthlyRecurrences

        public MonthlyWrapper getMonthlyRecurrences()
        Returns the monthly recurrence.
        Returns:
        the monthly recurrence. An empty list indicates a recurrence of every month.
      • getDayOfMonthRecurrences

        public DayOfMonthWrapper getDayOfMonthRecurrences()
        Returns the day of month recurrence.
        Returns:
        the day of month recurrence. An empty list indicates a recurrence of every day of month.
      • getDayOfWeekRecurrences

        public DayOfWeekWrapper getDayOfWeekRecurrences()
        Returns the day of week recurrence.
        Returns:
        the day of week recurrence. An empty list indicates a recurrence of every day of week.
      • getSecondRecurrences

        public SecondWrapper getSecondRecurrences()
        Returns the day of hourly recurrence.
        Returns:
        the day of hourly recurrence. An empty list indicates a recurrence of every hour.
      • getHourlyRecurrences

        public HourlyWrapper getHourlyRecurrences()
        Returns the day of minute recurrence.
        Returns:
        the day of minute recurrence. An empty list indicates a recurrence of every minute.
      • getMinuteRecurrences

        public MinuteWrapper getMinuteRecurrences()