Class Schedule
java.lang.Object
COM.TIBCO.hawk.config.rbengine.schedule.Schedule
- All Implemented Interfaces:
Cloneable
A Schedule is configuration object that can be used to determine if a rulebase or part of the rulebase
should be in-schedule or out-of-schedule at a given time.
A Schedule can be specified in any rulebase element such as Rulebase, Rule, Test, or an Action.
When an element of the rulebase is out-of-schedule, that element and all its nodes
are out-of-schedule. For example, if a Test is out-of-schedule, then the Test and all its
actions are out-of-schedule.
When a rulebase element is out-of-schedule, the rulebase element is suspended and will not be
be active until the element is back in-schedule.
A Schedule has a name, a list of inclusion periods and a list of exclusion periods. A Schedule is in-schedule if at least one of its inclusion periods is in-schedule and none of its exclusion periods are in-schedule. If a Schedule does not have any inclusion period, then it is in-schedule if none of its exclusion periods are in-schedule. If a Schedule does not have any inclusion period or exclusion period, then it is out-of-schedule.
The inclusion periods and exclusion periods may contain Period or PeriodGroupReference objects.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a schedule with the specified name.Schedule(String name, Scheduleable[] inclusionPeriods, Scheduleable[] exclusionPeriods) Deprecated.Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExclusionPeriod(Scheduleable period) Adds an period to existing a list of exclusion periods.voidaddInclusionPeriod(Scheduleable period) Adds an inclusion periods to existing a list of inclusion periods.clone()Returns a copy of this Schedule.booleanCompares with the specified schedule for equality.Returns all exclusion periods in this Schedule.Deprecated.Returns all inclusion periods in this Schedule.Deprecated.getName()Returns the name of the schedule.longReturns seconds until next schedule change.Returns the TimeZone for this schedule.booleaninSchedule(Date date) Checks to see if the schedule is in-schedule using the specified date.booleanisUsingPeriodGroup(String periodGroupName) Checks if the specified PeriodGroup is used by this schedules.voidremoveExclusionPeriod(Scheduleable period) Removes an period from existing a list of exclusion periods.voidremoveInclusionPeriod(Scheduleable period) Removes an period from existing a list of inclusion periods.voidsetExclusionPeriods(Vector periods) Deprecated.voidsetInclusionPeriods(Vector periods) Deprecated.voidSets the name of the Schedule.voidsetTimeZone(String timeZone) Sets the timezone of the Schedule.toString()Returns a string representation of the Schedule object.
-
Constructor Details
-
Schedule
Creates a schedule with the specified name. The new Schedule does not has any inclusion or exclusion period.- Parameters:
name- the schedule name
-
Schedule
Deprecated.Creates a schedule with the specified name, inclusion periods, and exclusion periods.- Parameters:
name- the schedule nameinclusionPeriods- a list of inclusion Period or PeriodGroupReferenceexclusionPeriods- a list of exclusion Period or PeriodGroupReference- Throws:
IllegalArgumentException- if name, inclusionPeriods or inclusionPeriods is null
-
Schedule
Deprecated.Creates a schedule with the specified name, inclusion periods, and exclusion periods.- Parameters:
name- the schedule nameinclusionPeriods- a list of inclusion Period or PeriodGroupReferenceexclusionPeriods- a list of exclusion Period or PeriodGroupReference- Throws:
IllegalArgumentException- if name, inclusionPeriods or inclusionPeriods is null
-
-
Method Details
-
inSchedule
Checks to see if the schedule is in-schedule using the specified date.- Parameters:
date- date to be checked.- Returns:
- true if date is in-schedule.
-
getSecondTillNextScheduleChange
public long getSecondTillNextScheduleChange()Returns seconds until next schedule change. If the next schedule is after mid night (12:00 am), then seconds till mid night is returned.- Returns:
- seconds until next schedule change.
-
setName
Sets the name of the Schedule.- Throws:
IllegalArgumentException- if name is null
-
getName
Returns the name of the schedule. -
setTimeZone
Sets the timezone of the Schedule.Note: In 4.7, timezone can be set to null. If timezone is null, local timezone is used for the schedule.
-
getTimeZone
Returns the TimeZone for this schedule. -
setInclusionPeriods
Deprecated.Replaces current inclusion periods in this Schedule with the given list. -
getInclusionPeriods
Returns all inclusion periods in this Schedule. -
getInclusionPeriodsAsVector
Deprecated.Returns a list of inclusion periods. -
setExclusionPeriods
Deprecated.Replaces current inclusion periods in this Schedule with the given list. -
getExclusionPeriods
Returns all exclusion periods in this Schedule. -
getExclusionPeriodsAsVector
Deprecated.Returns a list of exclusion periods. -
addInclusionPeriod
Adds an inclusion periods to existing a list of inclusion periods.- Parameters:
period- Period or PeriodGroupReference to be added.- Throws:
IllegalArgumentException- if period is null
-
addExclusionPeriod
Adds an period to existing a list of exclusion periods.- Parameters:
period- Period or PeriodGroupReference to be added.- Throws:
IllegalArgumentException- if period is null
-
removeInclusionPeriod
Removes an period from existing a list of inclusion periods. -
removeExclusionPeriod
Removes an period from existing a list of exclusion periods. -
isUsingPeriodGroup
Checks if the specified PeriodGroup is used by this schedules.- Returns:
- true if this Schedule use the given PeriodGroup.
-
clone
Returns a copy of this Schedule.- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
equals
Compares with the specified schedule for equality. Note that two Schedule objects with identical inclusion and exclusion periods but with different comments and last modification string are consider equals. -
toString
Returns a string representation of the Schedule object.
-