Class Schedules
java.lang.Object
COM.TIBCO.hawk.config.rbengine.schedule.Schedules
- All Implemented Interfaces:
RBEConfigObject,Cloneable
A Schedules contains a list of
Schedule and PeriodGroup objects.
The PeriodGroup is referenced in a Schedules using a PeriodGroupReference.
Unlike rulebases,
All the schedules which is used by the TIBCO Hawk Agent is kept in a single file instead of
individual files as in the case of rulebases.
The Agent transfer the entire list of Schedule objects in a Schedules to and
from a Console API application.
For example to retrieve and send a Schedules to and from an agent, see
SchedulesXML.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPeriodGroup(PeriodGroup periodGroup) Adds a period group to the current list of PeriodGroup in this Schedules.voidaddSchedule(Schedule schedule) Adds a schedule to the current list of schedules.clone()Returns a copy of this Schedules objectprotected booleanChecks to see if specified Schedule is in the current schedule list.booleanCompares the specified Schedules objects for equality.voidDeprecated.Returns the attributes for this Schedules.Deprecated.longReturns the checksum value of this Schedules object.Deprecated.Returns file extension based on the schedules.Deprecated.getName()Returns the Schedules name.getPeriodGroup(String name) Returns a PeriodGroup of the specified name.Returns a list of PeriodGroup in this Schedules.getSchedule(String name) Returns a schedule of the specified name.String[]Deprecated.Schedule[]Returns a list of schedules.Deprecated.getScheduleUsingPeriodGroup(String periodGroupName) Gets the schedule that uses the specified PeriodGroup.static SchedulesDeprecated.static voidloadFromFile(String path) Deprecated.voidremovePeriodGroup(PeriodGroup periodGroup) Removes a period group from the current list of PeriodGroup in this Schedules.voidremoveSchedule(Schedule schedule) Deprecated.voidremoveSchedule(String name) Removes a schedule from the current list of schedules.voidrenamePeriodGroup(String oldName, String newName) Renames a PeriodGroup.voidsaveToFile(String filename) Deprecated.voidsetAttributes(Attributes attributes) Sets the attributes for this Schedules.voidDeprecated.voidsetComment(String comment) Deprecated.voidsetLastModification(String lastModification) Deprecated.voidsetPeriodGroups(PeriodGroup[] periodGroups) Replaces a list of PeriodGroup in this Schedules with the specified list.voidsetSchedules(Schedule[] schedules) Replaces the list of schedules with the specified list.voidDeprecated.toString()Returns the string representation of the Schedules object.toXML()Deprecated.voidWrites the Schedules object to Writer in XML format.
-
Field Details
-
FILE_EXTENSION
The default file extension of a schedule file.- See Also:
-
SchedulesName
The default name of a schedules. -
SchedulesFileName
The file name of a schedule file. This is the file name used by Agent and repository when loading and saving a schedule file.
-
-
Constructor Details
-
Schedules
public Schedules()Creates a Schedules. The new Schedules object has no Schedule object. -
Schedules
Deprecated.Creates a Schedules with the specifed name. The new schedules does not contain any Schedule object.- Parameters:
name- Schedules name
-
Schedules
Deprecated.Creates a Schedules with the specifed name and list of schedules.- Parameters:
schedules- a list of schedule.
-
Schedules
Creates a Schedules with the specifed name and list of schedules.- Parameters:
schedules- a list of schedule.- Throws:
IllegalArgumentException- if schedules is null
-
Schedules
Creates a Schedules from the reader. The reader contains a schedules in an XML format. This constructor is useful when recreating a Schedules from SchedulesXML object:Schedules schedules = new Schedules(aScheduleXML.getXMLReader());- Parameters:
reader- a reader which contain the schedule in XML format.- Throws:
ScheduleException- if not able to create schedules from the reader.
-
-
Method Details
-
getFileExtension
Returns file extension based on the schedules.- Specified by:
getFileExtensionin interfaceRBEConfigObject- Returns:
- the file extension of the schedules.
-
getSchedulesAsVector
Deprecated.Returns a list of schedules as vector. -
getSchedules
Returns a list of schedules. -
setSchedules
Replaces the list of schedules with the specified list.- Throws:
IllegalArgumentException- if schedules is null
-
setSchedules
Deprecated.Replaces the list of schedules with the specified list. -
getSchedule
Returns a schedule of the specified name.- Returns:
- the instance of Schedule in this Schedules object with the specified name.
-
getPeriodGroups
Returns a list of PeriodGroup in this Schedules. -
setPeriodGroups
Replaces a list of PeriodGroup in this Schedules with the specified list.- Parameters:
periodGroups- the new period groups for this Schedules.- Throws:
IllegalArgumentException- if schedules is null
-
addPeriodGroup
Adds a period group to the current list of PeriodGroup in this Schedules. If the period group of the same name exist, it will be replaced.- Parameters:
periodGroup- period group to be added.- Throws:
IllegalArgumentException- if periodGroup is null
-
renamePeriodGroup
Renames a PeriodGroup.If the PeriodGroup to be renamed is referenced by a schedule, the schedule will be updated to used the new PeriodGroup name.
-
removePeriodGroup
Removes a period group from the current list of PeriodGroup in this Schedules. If the period group does not exist, no action is taken.- Parameters:
periodGroup- period group to be removed.- Throws:
IllegalArgumentException- if periodGroupName is null or use by a schedule.
-
getPeriodGroup
Returns a PeriodGroup of the specified name.- Returns:
- instance of PeriodGroup in this Schedules object with the specified name.
-
getScheduleUsingPeriodGroup
Gets the schedule that uses the specified PeriodGroup.- Returns:
- the name of first schedule found to use the given PeriodGroup.
-
getName
Returns the Schedules name.- Specified by:
getNamein interfaceRBEConfigObject
-
setAuthor
Deprecated.Sets the author of this Schedules.- Parameters:
name- name of the author.
-
setLastModification
Deprecated.Sets the last modification time stamp of this Schedules.- Parameters:
lastModification- timeStamp of the last modification.
-
setComment
Deprecated.Sets the comment for this Schedules.- Parameters:
comment- text for the comment.
-
getAuthor
Deprecated.Returns the author for this Schedules. -
getLastModification
Deprecated.Returns the last modification for this Schedules. -
getComment
Deprecated.Returns the comment for this Schedules. -
setAttributes
Sets the attributes for this Schedules.- Throws:
IllegalArgumentException- if attributes is null
-
getAttributes
Returns the attributes for this Schedules. The Attributes contains attributes suchs as author, last modification record, and comment.- See Also:
-
addSchedule
Adds a schedule to the current list of schedules. If the schedule of the same name exist, it will be replaced.- Parameters:
schedule- schedule to be added.- Throws:
IllegalArgumentException- if schedule is null
-
removeSchedule
Deprecated.Removes a schedule from the current list of schedules. If the schedule does not exist, no action is taken.- Parameters:
schedule- schedule to be removed.- Throws:
IllegalArgumentException- if schedule is null
-
removeSchedule
Removes a schedule from the current list of schedules. -
contains
Checks to see if specified Schedule is in the current schedule list.- Parameters:
scheduleToCheck- The schedule to look for in the list- Returns:
- true if scheduleToCheck is in the list.
-
getScheduleNames
Deprecated.Returns the names of all Schedule objects. -
toXML
Deprecated.Returns an XML string that may be used to restore the Schedules usingfromXML.
- See Also:
-
toXML
Writes the Schedules object to Writer in XML format.- Specified by:
toXMLin interfaceRBEConfigObject- Parameters:
writer- the writer where the XML output will be written.- Throws:
RBEConfigObjectException
-
fromXML
Deprecated.Restores Schedules from a reader in XML format.- Parameters:
reader- the reader where the XML output will be read.- Throws:
ScheduleException
-
equals
Compares the specified Schedules objects for equality. -
toString
Returns the string representation of the Schedules object. -
getChecksum
public long getChecksum()Returns the checksum value of this Schedules object.- Specified by:
getChecksumin interfaceRBEConfigObject- Returns:
- the checksum value of this Schedules object.
-
clone
Returns a copy of this Schedules object- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
loadFromFile
Deprecated.Loads a Schedules object from an absolute fully qualified path.- Parameters:
path- the full path name of the file to load- Throws:
RBEConfigObjectException
-
saveToFile
Deprecated.Saves Schedules object to a file.- Parameters:
filename- a fully qualify file name.- Throws:
RBEConfigObjectException- if I/O error occurs.
-
load
Deprecated.Creates Schedules object from file- Parameters:
filename- filename- Returns:
- Schedules
- Throws:
RBEConfigObjectException
-