org.pentaho.platform.api.scheduler2
Class ComplexJobTrigger

java.lang.Object
  extended by org.pentaho.platform.api.scheduler2.JobTrigger
      extended by org.pentaho.platform.api.scheduler2.ComplexJobTrigger

public class ComplexJobTrigger
extends JobTrigger

Used to specify a recurrence of scheduled job execution or a recurrence of scheduler availability.

Author:
arodriguez

Field Summary
static int APRIL
           
static int AUGUST
           
static int DECEMBER
           
static int FEBRUARY
           
static int FRIDAY
           
static int JANUARY
           
static int JULY
           
static int JUNE
           
static int MARCH
           
static int MAY
           
static int MONDAY
           
static int NOVEMBER
           
static int OCTOBER
           
static int SATURDAY
           
static int SEPTEMBER
           
static int SUNDAY
           
static int THURSDAY
           
static int TUESDAY
           
static int WEDNESDAY
           
 
Fields inherited from class org.pentaho.platform.api.scheduler2.JobTrigger
ONCE_NOW
 
Constructor Summary
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
 void addDayOfMonthRecurrence(Integer... recurrence)
          Add a recurrence to the day of week recurrence.
 void addDayOfMonthRecurrence(ITimeRecurrence recurrence)
          Add a recurrence to the day of month recurrence.
 void addDayOfWeekRecurrence(Integer... recurrence)
          Add a recurrence to the day of week recurrence (1=Sunday, 7=Saturday).
 void addDayOfWeekRecurrence(ITimeRecurrence recurrence)
          Add a recurrence to the day of week recurrence.
 void addHourlyRecurrence(Integer... recurrence)
          Add a recurrence to the minute recurrence.
 void addHourlyRecurrence(ITimeRecurrence recurrence)
          Add a recurrence to the hourly recurrence.
 void addMinuteRecurrence(Integer... recurrence)
          Add a recurrence to the minute recurrence.
 void addMinuteRecurrence(ITimeRecurrence recurrence)
          Add a recurrence to the minute recurrence.
 void addMonthlyRecurrence(Integer... recurrence)
          Add a recurrence to the monthly recurrence (1=January, 12=December).
 void addMonthlyRecurrence(ITimeRecurrence recurrence)
          Add a recurrence to the monthly recurrence.
 void addSecondRecurrence(Integer... recurrence)
          Add a recurrence to the second recurrence.
 void addSecondRecurrence(ITimeRecurrence recurrence)
          Add a recurrence to the second recurrence.
 void addYearlyRecurrence(Integer... recurrence)
          Add a recurrence to the yearly recurrences.
 void addYearlyRecurrence(ITimeRecurrence recurrence)
          Add a recurrence to the yearly recurrences.
 List<ITimeRecurrence> getDayOfMonthRecurrences()
          Returns the day of month recurrence.
 List<ITimeRecurrence> getDayOfWeekRecurrences()
          Returns the day of week recurrence.
 List<ITimeRecurrence> getHourlyRecurrences()
          Returns the day of hourly recurrence.
 List<ITimeRecurrence> getMinuteRecurrences()
           
 List<ITimeRecurrence> getMonthlyRecurrences()
          Returns the monthly recurrence.
 List<ITimeRecurrence> getSecondRecurrences()
          Returns the day of minute recurrence.
 List<ITimeRecurrence> getYearlyRecurrences()
          Returns the yearly recurrence.
 void setDayOfMonthRecurrence(Integer... recurrence)
          Overrides any previously applied day of month recurrences with the provided recurrence.
 void setDayOfMonthRecurrence(ITimeRecurrence recurrence)
          Overrides any previously applied day of month recurrences with the provided recurrence.
 void setDayOfWeekRecurrence(Integer... recurrence)
          Overrides any previously applied day of week recurrences with the provided recurrence (1=Sunday, 7=Saturday).
 void setDayOfWeekRecurrence(ITimeRecurrence recurrence)
          Overrides any previously applied day of week recurrences with the provided recurrence.
 void setHourlyRecurrence(Integer... recurrence)
          Overrides any previously applied hourly recurrences with the provided recurrence.
 void setHourlyRecurrence(ITimeRecurrence recurrence)
          Overrides any previously applied hourly recurrences with the provided recurrence.
 void setMinuteRecurrence(Integer... recurrence)
          Overrides any previously applied minute recurrences with the provided recurrence.
 void setMinuteRecurrence(ITimeRecurrence recurrence)
          Overrides any previously applied minute recurrences with the provided recurrence.
 void setMonthlyRecurrence(Integer... recurrence)
          Overrides any previously applied monthly recurrences with the provided recurrence (1=January, 12=December).
 void setMonthlyRecurrence(ITimeRecurrence recurrence)
          Overrides any previously applied monthly recurrences with the provided recurrence.
 void setSecondRecurrence(Integer... recurrence)
          Overrides any previously applied second recurrences with the provided recurrence.
 void setSecondRecurrence(ITimeRecurrence recurrence)
          Overrides any previously applied second recurrences with the provided recurrence.
 void setYearlyRecurrence(Integer... recurrence)
          Overrides any previously applied yearly recurrences with the provided recurrence.
 void setYearlyRecurrence(ITimeRecurrence recurrence)
          Overrides any previously applied yearly recurrences with the provided recurrence.
 String toString()
           
 
Methods inherited from class org.pentaho.platform.api.scheduler2.JobTrigger
getEndTime, getStartTime, setEndTime, setStartTime
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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

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 List<ITimeRecurrence> getYearlyRecurrences()
Returns the yearly recurrence.

Returns:
the yearly recurrence. An empty list indicates a recurrence of every year.

getMonthlyRecurrences

public List<ITimeRecurrence> getMonthlyRecurrences()
Returns the monthly recurrence.

Returns:
the monthly recurrence. An empty list indicates a recurrence of every month.

getDayOfMonthRecurrences

public List<ITimeRecurrence> 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 List<ITimeRecurrence> getDayOfWeekRecurrences()
Returns the day of week recurrence.

Returns:
the day of week recurrence. An empty list indicates a recurrence of every day of week.

getHourlyRecurrences

public List<ITimeRecurrence> getHourlyRecurrences()
Returns the day of hourly recurrence.

Returns:
the day of hourly recurrence. An empty list indicates a recurrence of every hour.

getSecondRecurrences

public List<ITimeRecurrence> getSecondRecurrences()
Returns the day of minute recurrence.

Returns:
the day of minute recurrence. An empty list indicates a recurrence of every minute.

getMinuteRecurrences

public List<ITimeRecurrence> getMinuteRecurrences()

toString

public String toString()
Overrides:
toString in class Object