com.ibm.itim.scheduling
Class RecurringTimeSchedule

java.lang.Object
  extended by com.ibm.itim.scheduling.RecurringTimeSchedule
All Implemented Interfaces:
Schedulable, com.ibm.itim.util.xml.objectstream.Importable, java.io.Serializable

public class RecurringTimeSchedule
extends java.lang.Object
implements Schedulable, com.ibm.itim.util.xml.objectstream.Importable

RecurringTimeSchedule is a class used to represent a recurring time that can be used for scheduling when implementing the Schedulable interface. This class has the flexibility to define the time based on hours, minutes, month, day of the week, day of the month, quarterly, and semi-annually. The following values are the example values for the different typs of schedules(all the remaining values of the schedule should be set to 0)

See Also:
Serialized Form

Constructor Summary
RecurringTimeSchedule(int minute, int hour, int dayOfMonth, int month, int dayOfWeek)
          Constructs the RecurringTimeSchedule with the given schedule parameters.
RecurringTimeSchedule(int minute, int hour, int dayOfMonth, int month, int dayOfWeek, int dayOfQuarter, int dayOfSemiAnnual)
          Constructs the RecurringTimeSchedule with the given schedule parameters.
 
Method Summary
 int getDayOfMonth()
          Returns the day of the month of the RecurringTimeSchedule.
 int getDayOfQuarter()
          Returns the day of the quarter of the RecurringTimeSchedule.
 int getDayOfSemiAnnual()
          Returns the day of the semi-annual of the RecurringTimeSchedule.
 int getDayOfWeek()
          Returns the day of the week of the RecurringTimeSchedule.
 int getHour()
          Returns the hour of the RecurringTimeSchedule.
 int getMinute()
          Returns the minute of the RecurringTimeSchedule.
 int getMonth()
          Returns the month of the RecurringTimeSchedule.
 java.util.TimeZone getTimeZone()
          Returns the timezone that the schedule is configured with.
 boolean isDaily()
          Method to check if the schedule is daily.
 boolean isHourly()
          Method to check if the schedule is hourly.
 boolean isMinutely()
          Method to check if the schedule is minutely.
 boolean isMonthly()
          Method to check if the schedule is monthly.
 boolean isQuarterly()
          Method to check if the schedule is quarterly.
 boolean isSemiAnnually()
          Method to check if the schedule is semi-annually.
 boolean isWeekly()
          Method to check if the schedule is weekly.
 long schedule(long time)
          Returns the next scheduled date in milliseconds since the epoch.
 void setDayOfMonth(int dayOfMonth)
          Changes the day of the month of the RecurringTimeSchedule.
 void setDayOfQuarter(int dayOfQuarter)
          Changes the day of the quarter of the RecurringTimeSchedule.
 void setDayOfSemiAnnual(int dayOfSemiAnnual)
          Changes the day of the semi-annual of the RecurringTimeSchedule.
 void setDayOfWeek(int dayOfWeek)
          Changes the day of the week of the RecurringTimeSchedule.
 void setHour(int hour)
          Changes the hour of the RecurringTimeSchedule.
 void setMinute(int minute)
          Changes the minute of the RecurringTimeSchedule.
 void setMonth(int month)
          Changes the month of the RecurringTimeSchedule.
 void setTimeZone(java.util.TimeZone timeZone)
          Method to set the schedule time zone.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecurringTimeSchedule

public RecurringTimeSchedule(int minute,
                             int hour,
                             int dayOfMonth,
                             int month,
                             int dayOfWeek)
Constructs the RecurringTimeSchedule with the given schedule parameters.

Parameters:
minute - minute of the schedule. Allowed values are 0-59.
hour - hour of the schedule. Allowed values are 0-23.
dayOfMonth - day of month of the schedule (-1 if every day). This attribute is exclusive with dayOfWeek. To set the dayOfMonth value other than -1(daily), the month value must be set either to specific month or -1(monthly). Allowed values are 1-28, if the schedule is set to monthly otherwise the allowed value varies according to the month value.
month - month of the alarm (-1 if every month). Allowed values are 1-12 (1 = January, 2 = February, ...).
dayOfWeek - day of week of the alarm (-1 if every day). This attribute is exclusive with dayOfMonth. Allowed values are 1-7 (1 = Sunday, 2 = Monday, ...). java.util.Calendar constants can be used.

RecurringTimeSchedule

public RecurringTimeSchedule(int minute,
                             int hour,
                             int dayOfMonth,
                             int month,
                             int dayOfWeek,
                             int dayOfQuarter,
                             int dayOfSemiAnnual)
Constructs the RecurringTimeSchedule with the given schedule parameters. This also takes the parameter for day of quarter and day of semi-annual. If the dayOfSemiAnnual value is set to the schedule, then it ignores the dayOfQuarter value.

Parameters:
minute - minute of the schedule. Allowed values are 0-59.
hour - hour of the schedule. Allowed values are 0-23.
dayOfMonth - day of month of the schedule (-1 if every day). This attribute is exclusive with dayOfWeek. To set the dayOfMonth value other than -1(daily), the month value should be set either to a specific month or -1(monthly). Allowed values are 1-28, if schedule is set to monthly, otherwise the allowed value varies according to the month value.
month - month of the alarm (-1 if every month). Allowed values are 1-12 (1 = January, 2 = February, ...).
dayOfWeek - day of week of the alarm (-1 if every day). This attribute is exclusive with dayOfMonth. Allowed values are 1-7 (1 = Sunday, 2 = Monday, ...). java.util.Calendar constants can be used.
dayOfQuarter - (0 for disabled by quarterly, otherwise 1-90) dayOfQuarter is exclusive with dayOfMonth, dayOfWeek and dayOfSemiAnnual, therefore value of dayOfMonth, dayOfWeek and dayOfSemiAnnual is set to ignore.
dayOfSemiAnnual - (0 for disabled by semi-annually, otherwise 1-180) dayOfSemiAnnual is exclusive with dayOfMonth, dayOfWeek and dayOfQuarter therefore value of dayOfMonth, dayOfWeek and dayOfQuarter is set to ignore.
Method Detail

getMinute

public int getMinute()
Returns the minute of the RecurringTimeSchedule.

Returns:
the configured minute.

setMinute

public void setMinute(int minute)
Changes the minute of the RecurringTimeSchedule.

Parameters:
minute - new minute to configure. Allowed values are 0-59.
Throws:
java.lang.IllegalArgumentException - Thrown if argument is not within the range.

getHour

public int getHour()
Returns the hour of the RecurringTimeSchedule.

Returns:
the configured hour.

setHour

public void setHour(int hour)
Changes the hour of the RecurringTimeSchedule.

Parameters:
hour - new hour to configure. Allowed values are 0-23. (-1 if every hour.)
Throws:
java.lang.IllegalArgumentException - Thrown if argument is not within the range.

getMonth

public int getMonth()
Returns the month of the RecurringTimeSchedule.

Returns:
the configured month or -1 if it is every month.

setMonth

public void setMonth(int month)
Changes the month of the RecurringTimeSchedule.

Parameters:
month - new month to configure (-1 if every month). (0 if ignore) Allowed values are 0-12 (1 = January, 2 = February, ...).
Throws:
java.lang.IllegalArgumentException - Thrown if argument is not within the range.

getDayOfWeek

public int getDayOfWeek()
Returns the day of the week of the RecurringTimeSchedule.

Returns:
the configured day of the week or -1 if it is every day.

setDayOfWeek

public void setDayOfWeek(int dayOfWeek)
Changes the day of the week of the RecurringTimeSchedule.

Parameters:
dayOfWeek - new day of the week to configure (-1 if every day) (0 if ignore). This attribute is exclusive with dayOfMonth. Allowed values are 1-7 (1 = Sunday, 2 = Monday, ...). java.util.Calendar constants can be used.
Throws:
java.lang.IllegalArgumentException - Thrown if argument is not within the range.

setDayOfQuarter

public void setDayOfQuarter(int dayOfQuarter)
Changes the day of the quarter of the RecurringTimeSchedule. dayOfQuarter is exclusive with dayOfMonth, dayOfWeek and dayOfSemiAnnual therefore value of dayOfMonth, dayOfWeek and dayOfSemiAnnual is set to ignore.

Parameters:
dayOfQuarter - day of the quarter(0 for disabled by quarterly, otherwise 1-90).
Throws:
java.lang.IllegalArgumentException - Thrown if argument is not within the range.

getDayOfQuarter

public int getDayOfQuarter()
Returns the day of the quarter of the RecurringTimeSchedule.

Returns:
the configured day of the quarter.

setDayOfSemiAnnual

public void setDayOfSemiAnnual(int dayOfSemiAnnual)
Changes the day of the semi-annual of the RecurringTimeSchedule. dayOfSemiAnnual is exclusive with dayOfMonth, dayOfWeek and dayOfQuarter therefore value of dayOfMonth, dayOfWeek and dayOfQuarter is set to ignore.

Parameters:
dayOfSemiAnnual - day of the semi-annual(0 for disabled by semi-annually, otherwise 1-180).
Throws:
java.lang.IllegalArgumentException - Thrown if argument is not within the range.

getDayOfSemiAnnual

public int getDayOfSemiAnnual()
Returns the day of the semi-annual of the RecurringTimeSchedule.

Returns:
the configured day of the semi-annual.

getDayOfMonth

public int getDayOfMonth()
Returns the day of the month of the RecurringTimeSchedule.

Returns:
the configured day of the month or -1 if it is every day.

setDayOfMonth

public void setDayOfMonth(int dayOfMonth)
Changes the day of the month of the RecurringTimeSchedule.

Parameters:
dayOfMonth - new day of the month to configure (-1 if it is every day). This attribute is exclusive with dayOfWeek therefore value of dayOfWeek is set to ignore. To set the dayOfMonth value other than -1(daily), the month value must be set either to specific month or -1(monthly). Allowed values are 1-28 if the schedule is set to monthly. If the month value is set to the schedule, then the value can be set according to month.
Throws:
java.lang.IllegalArgumentException - Thrown if argument is not within the range.

setTimeZone

public void setTimeZone(java.util.TimeZone timeZone)
Method to set the schedule time zone.

Parameters:
timeZone -

getTimeZone

public java.util.TimeZone getTimeZone()
Returns the timezone that the schedule is configured with.

Returns:
TimeZone the timezone used for this schedule.

schedule

public long schedule(long time)
Returns the next scheduled date in milliseconds since the epoch.

Specified by:
schedule in interface Schedulable
Parameters:
time - the current time in milliseconds since the epoch.
Returns:
the scheduled date in milliseconds since the epoch.

isDaily

public boolean isDaily()
Method to check if the schedule is daily.

Returns:
boolean true if schedule is set to daily.

isMonthly

public boolean isMonthly()
Method to check if the schedule is monthly.

Returns:
boolean true if schedule is set to monthly.

isWeekly

public boolean isWeekly()
Method to check if the schedule is weekly.

Returns:
boolean true if schedule is set to weekly.

isHourly

public boolean isHourly()
Method to check if the schedule is hourly.

Returns:
boolean true if schedule is set to hourly.

isMinutely

public boolean isMinutely()
Method to check if the schedule is minutely.

Returns:
boolean true if schedule is set to minutely.

isQuarterly

public boolean isQuarterly()
Method to check if the schedule is quarterly.

Returns:
boolean true if the schedule is set to quarterly.

isSemiAnnually

public boolean isSemiAnnually()
Method to check if the schedule is semi-annually.

Returns:
boolean true if the schedule is set to semi-annually.


IBM Security Identity Manager 6.0.0
© Copyright International Business Machines Corporation 2007, 2012. All rights reserved. US Government Users Restricited Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.