Class ComplexJobTrigger
- java.lang.Object
-
- org.pentaho.platform.api.scheduler2.JobTrigger
-
- org.pentaho.platform.api.scheduler2.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
-
-
Field Summary
Fields Modifier and Type Field Description static intAPRILstatic intAUGUSTstatic intDECEMBERstatic intFEBRUARYstatic intFRIDAYstatic intJANUARYstatic intJULYstatic intJUNEstatic intMARCHstatic intMAYstatic intMONDAYstatic intNOVEMBERstatic intOCTOBERstatic intSATURDAYstatic intSEPTEMBERstatic intSUNDAYstatic intTHURSDAYstatic intTUESDAYstatic intWEDNESDAY-
Fields inherited from class org.pentaho.platform.api.scheduler2.JobTrigger
ONCE_NOW
-
-
Constructor Summary
Constructors Constructor Description ComplexJobTrigger()Creates a default recurrence of every day of every year at midnight.ComplexJobTrigger(Integer year, Integer month, Integer dayOfMonth, Integer dayOfWeek, Integer hourOfDay)Creates a recurrence for the specified date/time.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDayOfMonthRecurrence(Integer... recurrence)Add a recurrence to the day of week recurrence.voidaddDayOfMonthRecurrence(ITimeRecurrence recurrence)Add a recurrence to the day of month recurrence.voidaddDayOfWeekRecurrence(Integer... recurrence)Add a recurrence to the day of week recurrence (1=Sunday, 7=Saturday).voidaddDayOfWeekRecurrence(ITimeRecurrence recurrence)Add a recurrence to the day of week recurrence.voidaddHourlyRecurrence(Integer... recurrence)Add a recurrence to the minute recurrence.voidaddHourlyRecurrence(ITimeRecurrence recurrence)Add a recurrence to the hourly recurrence.voidaddMinuteRecurrence(Integer... recurrence)Add a recurrence to the minute recurrence.voidaddMinuteRecurrence(ITimeRecurrence recurrence)Add a recurrence to the minute recurrence.voidaddMonthlyRecurrence(Integer... recurrence)Add a recurrence to the monthly recurrence (1=January, 12=December).voidaddMonthlyRecurrence(ITimeRecurrence recurrence)Add a recurrence to the monthly recurrence.voidaddSecondRecurrence(Integer... recurrence)Add a recurrence to the second recurrence.voidaddSecondRecurrence(ITimeRecurrence recurrence)Add a recurrence to the second recurrence.voidaddYearlyRecurrence(Integer... recurrence)Add a recurrence to the yearly recurrences.voidaddYearlyRecurrence(ITimeRecurrence recurrence)Add a recurrence to the yearly recurrences.StringgetCronDescription()Returns the User friendly description of a Cron StringDayOfMonthWrappergetDayOfMonthRecurrences()Returns the day of month recurrence.DayOfWeekWrappergetDayOfWeekRecurrences()Returns the day of week recurrence.HourlyWrappergetHourlyRecurrences()Returns the day of minute recurrence.MinuteWrappergetMinuteRecurrences()MonthlyWrappergetMonthlyRecurrences()Returns the monthly recurrence.longgetRepeatInterval()SecondWrappergetSecondRecurrences()Returns the day of hourly recurrence.YearlyWrappergetYearlyRecurrences()Returns the yearly recurrence.voidsetCronString(String cronString)Sets the cron String used by the quartz schedulervoidsetDayOfMonthRecurrence(Integer... recurrence)Overrides any previously applied day of month recurrences with the provided recurrence.voidsetDayOfMonthRecurrence(ITimeRecurrence recurrence)Overrides any previously applied day of month recurrences with the provided recurrence.voidsetDayOfWeekRecurrence(Integer... recurrence)Overrides any previously applied day of week recurrences with the provided recurrence (1=Sunday, 7=Saturday).voidsetDayOfWeekRecurrence(ITimeRecurrence recurrence)Overrides any previously applied day of week recurrences with the provided recurrence.voidsetHourlyRecurrence(Integer... recurrence)Overrides any previously applied hourly recurrences with the provided recurrence.voidsetHourlyRecurrence(ITimeRecurrence recurrence)Overrides any previously applied hourly recurrences with the provided recurrence.voidsetMinuteRecurrence(Integer... recurrence)Overrides any previously applied minute recurrences with the provided recurrence.voidsetMinuteRecurrence(ITimeRecurrence recurrence)Overrides any previously applied minute recurrences with the provided recurrence.voidsetMonthlyRecurrence(Integer... recurrence)Overrides any previously applied monthly recurrences with the provided recurrence (1=January, 12=December).voidsetMonthlyRecurrence(ITimeRecurrence recurrence)Overrides any previously applied monthly recurrences with the provided recurrence.voidsetRepeatInterval(long repeatIntervalSeconds)voidsetSecondRecurrence(Integer... recurrence)Overrides any previously applied second recurrences with the provided recurrence.voidsetSecondRecurrence(ITimeRecurrence recurrence)Overrides any previously applied second recurrences with the provided recurrence.voidsetYearlyRecurrence(Integer... recurrence)Overrides any previously applied yearly recurrences with the provided recurrence.voidsetYearlyRecurrence(ITimeRecurrence recurrence)Overrides any previously applied yearly recurrences with the provided recurrence.StringtoString()-
Methods inherited from class org.pentaho.platform.api.scheduler2.JobTrigger
getCronString, getDuration, getEndTime, getStartTime, getUiPassParam, setCronDescription, setDuration, setEndTime, setStartTime, setUiPassParam
-
-
-
-
Field Detail
-
SUNDAY
public static final int SUNDAY
- See Also:
- Constant Field Values
-
MONDAY
public static final int MONDAY
- See Also:
- Constant Field Values
-
TUESDAY
public static final int TUESDAY
- See Also:
- Constant Field Values
-
WEDNESDAY
public static final int WEDNESDAY
- See Also:
- Constant Field Values
-
THURSDAY
public static final int THURSDAY
- See Also:
- Constant Field Values
-
FRIDAY
public static final int FRIDAY
- See Also:
- Constant Field Values
-
SATURDAY
public static final int SATURDAY
- See Also:
- Constant Field Values
-
JANUARY
public static final int JANUARY
- See Also:
- Constant Field Values
-
FEBRUARY
public static final int FEBRUARY
- See Also:
- Constant Field Values
-
MARCH
public static final int MARCH
- See Also:
- Constant Field Values
-
APRIL
public static final int APRIL
- See Also:
- Constant Field Values
-
MAY
public static final int MAY
- See Also:
- Constant Field Values
-
JUNE
public static final int JUNE
- See Also:
- Constant Field Values
-
JULY
public static final int JULY
- See Also:
- Constant Field Values
-
AUGUST
public static final int AUGUST
- See Also:
- Constant Field Values
-
SEPTEMBER
public static final int SEPTEMBER
- See Also:
- Constant Field Values
-
OCTOBER
public static final int OCTOBER
- See Also:
- Constant Field Values
-
NOVEMBER
public static final int NOVEMBER
- See Also:
- Constant Field Values
-
DECEMBER
public static final int DECEMBER
- See Also:
- Constant Field Values
-
-
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()
-
setCronString
public void setCronString(String cronString)
Description copied from interface:IJobTriggerSets the cron String used by the quartz scheduler- Specified by:
setCronStringin interfaceIJobTrigger- Overrides:
setCronStringin classJobTrigger- Parameters:
cronString- the cronString to set
-
getCronDescription
public String getCronDescription()
Description copied from interface:IJobTriggerReturns the User friendly description of a Cron String- Specified by:
getCronDescriptionin interfaceIJobTrigger- Overrides:
getCronDescriptionin classJobTrigger- Returns:
- the cronDescription
-
-