|
Oracle Fusion Applications Java API Reference for Oracle Enterprise Scheduler Service 11g Release 1 (11.1.1.6) E20742-04 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.as.scheduler.BaseMetadata<Schedule> oracle.as.scheduler.Schedule
public class Schedule
Used to specify time-based recurrence.
The core part of the Schedule is the Recurrence
class that
provides occurrence based on the defined recurrence pattern. Schedule
allows adding dates to be explicitly included for generating occurrences
in addition to the one generated by the recurrence pattern.
It is also possible to exclude date/times instances from the list of
occurrences a Schedule
generates. Such exclusions can be specified
in two mode, by explicitly providing a list of dates to an instance of
Schedule
or by referencing to a named ExclusionsDefinition
.
An example would be an ExclusionsDefinition that contains the list of
holidays for which the Schedule
must skip the occurrences if
generated.
The start and end date/times if specified in the contained
Recurrence
only apply to the occurrences generated by the
recurrence pattern. Any additional dates explicitly added to the
Schedule
can fall before the start of after the end date
specified.
Schedule
provides the ability to mask or allow occurrences that
happen to be in the past with respect to the current timestamp at runtime.
Example - Schedule to run every monday at 10:00 am plus on 10th of July 2006, but exclude the 15th May 2006.
Recurrence recur = new Recurrence(RecurrenceFields.FREQUENCY.WEEKLY);
recur.addDayOfWeek(RecurrenceFields.DAY_OF_WEEK.MONDAY);
recur.setRecurTime(RecurrenceFields.TIME_OF_DAY.valueOf(10, 0, 0));
ExplicitDate july10 = new ExplicitDate(RecurrenceFields.YEAR.valueOf(2006),
RecurrenceFields.MONTH_OF_YEAR.JULY
RecurrenceFields.DAY_OF_MONTH.valueOf(10));
ExplicitDate may15 = new ExplicitDate(RecurrenceFields.YEAR.valueOf(2006),
RecurrenceFields.MONTH_OF_YEAR.MAY,
RecurrenceFields.DAY_OF_MONTH.valueOf(15));
Schedule schedule = new Schedule("everyMonday", "Weekly Schedule", recur);
schedule.addInclusionDate(july10);
schedule.addExclusionDate(may15);
RecurrenceFields
,
Recurrence
,
ExplicitDate
,
Exclusion
,
ExclusionsDefinition
,
Serialized FormField Summary | |
---|---|
static int |
DEFAULT_LIST_LIMIT
|
Constructor Summary | |
---|---|
Schedule(java.lang.String name,
java.lang.String description,
java.util.Collection<ExplicitDate> dates)
Constructs a new schedule with the given set of explicit dates. |
|
Schedule(java.lang.String name,
java.lang.String description,
java.util.Collection<ExplicitDate> dates,
MetadataObjectId objectId)
Constructs a new schedule with the given set of explicit dates. |
|
Schedule(java.lang.String name,
java.lang.String description,
Recurrence recur)
Constructs a new instance with the given recurrence. |
|
Schedule(java.lang.String name,
java.lang.String description,
Recurrence recur,
MetadataObjectId objectId)
Constructs a new instance with the given recurrence. |
|
Schedule(java.lang.String name,
java.lang.String displayNameKey,
java.lang.String descriptionKey,
java.util.Collection<ExplicitDate> dates,
java.lang.String[] resourceBundleIDs)
Constructs a new schedule with the given set of explicit dates and associate resource bundles. |
|
Schedule(java.lang.String name,
java.lang.String displayNameKey,
java.lang.String descriptionKey,
Recurrence recur,
java.lang.String[] resourceBundleIDs)
Constructs a new instance with the given recurrence and associate resource bundles |
Method Summary | |
---|---|
void |
addExclusion(MetadataObjectId objectId)
Adds a reference of an instance of ExclusionsDefinition in this Schedule object. |
void |
addExclusionDate(ExplicitDate date)
Adds an explicit date to be excluded from occurrences in this Schedule object. |
void |
addInclusionDate(ExplicitDate date)
Adds an explicit date to be included for occurrences in this Schedule object. |
Schedule |
clone(java.lang.String newName)
|
boolean |
equals(java.lang.Object obj)
Compares an object for equality with this Schedule object. |
static Schedule |
from(javax.management.openmbean.CompositeData cd)
Create an instance of the model specific class out of an associated CompositeData instance |
BaseMetadataType<Schedule> |
getBaseMetadataType()
|
java.util.Collection<ExplicitDate> |
getExclusionDates()
Returns the list of dates excluded for occurrences in this Schedule object. |
java.util.Collection<MetadataObjectId> |
getExclusions()
Returns the list of ExclusionsDefinition instance this object refers. |
oracle.as.scheduler.runtime.ScheduleState |
getFirstOccurrence(java.util.Calendar startTime,
java.util.Calendar effectiveTime)
Get the first occurrence of this schedule. |
java.util.Collection<ExplicitDate> |
getInclusionDates()
Returns the list of explicit dates that are included for occurrences in this Schedule object. |
java.util.Calendar |
getNext(java.util.Calendar time)
Returns the next occurrence as per the definition of this Schedule and the input timestamp. |
java.util.Calendar |
getNext(java.util.Calendar time,
boolean firstTime,
java.util.Calendar orig)
Calculates and returns the next possible occurrence of this Schedule based on the given timestamp. |
java.util.Calendar |
getNext(java.util.Calendar time,
java.util.Calendar orig)
Computes the next occurrence based on the given time and the original start time. |
oracle.as.scheduler.runtime.ScheduleState |
getNext(oracle.as.scheduler.runtime.ScheduleState state)
|
Recurrence |
getRecurrence()
Returns the recurrence object of this schedule instance. |
protected Schedule |
getSelf()
|
java.util.TimeZone |
getTimeZone()
Returns the TimeZone set for this Schedule object. |
java.util.Collection<java.util.Calendar> |
list(java.util.Calendar begin,
java.util.Calendar end)
Generates a list of possible occurrences of this Schedule object within a given time period up to the default limit of 300. |
java.util.Collection<java.util.Calendar> |
list(java.util.Calendar begin,
java.util.Calendar end,
int limit)
Generates a list of possible occurrences of this Schedule object within a given time period. |
java.util.Collection<java.util.Calendar> |
list(java.util.Calendar begin,
int count)
Generates a list of possible occurrences of this Schedule object starting with the given time upto the specified count. |
void |
removeExclusion(MetadataObjectId objectId)
Removes the given reference of ExclusionsDefinition from this Schedule object. |
void |
removeExclusionDate(ExplicitDate date)
Removes an explicit date from the list of dates excluded for occurrences in this Schedule object. |
void |
removeInclusionDate(ExplicitDate date)
Removes an explicit date from list of included dates of this Schedule object. |
void |
setExclusionDates(java.util.Collection<ExplicitDate> dates)
Sets the list of dates excluded for occurrences in this Schedule object. |
void |
setExclusionsDefinition(java.util.Collection<ExclusionsDefinition> exclusions)
Sets the ExclusionsDefinition list to this Schedule. |
void |
setInclusionDates(java.util.Collection<ExplicitDate> dates)
Sets the list of dates to be included for occurrences in this Schedule. |
void |
setRecurrence(Recurrence recur)
Sets the recurrence for this schedule instance. |
void |
setTimeZone(java.util.TimeZone tz)
Sets or clears the TimeZone for this Schedule object. |
javax.management.openmbean.CompositeData |
toCompositeData(javax.management.openmbean.CompositeType ct)
|
static javax.management.openmbean.CompositeType |
toCompositeType()
Returns the CompositeType that describes this model specific class |
java.lang.String |
toDisplayString(java.util.Locale locale)
Returns a localized string describing this schedule. |
java.lang.String |
toString()
Returns a String representation for this Schedule object. |
protected void |
validateCustom()
Validates this object. |
Methods inherited from class oracle.as.scheduler.BaseMetadata |
---|
from, getDescription, getDescriptionKey, getDisplayName, getDisplayNameKey, getMessages, getMetadataObjectId, getName, getResourceBundles, hashCode, localize, setDescription, setDescriptionKey, setDisplayName, setDisplayNameKey, setResourceBundles, toCompositeData, validate |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_LIST_LIMIT
Constructor Detail |
---|
public Schedule(java.lang.String name, java.lang.String description, Recurrence recur)
name
- name of the new instance. It cannot be null. The name is also
used as the default display name unless otherwise specifially set.description
- an optional description.recur
- an instance of Recurrence object for this instance.public Schedule(java.lang.String name, java.lang.String displayNameKey, java.lang.String descriptionKey, Recurrence recur, java.lang.String[] resourceBundleIDs)
name
- name of the new instance. It cannot be null. The name is also
used as the default display name unless otherwise specifially set.displayNameKey
- - the key of the entry in the resourcebundles to lookup the name. OptionaldescriptionKey
- - the key of the entry in the resourcebundles to lookup the description.
Optional.recur
- an instance of Recurrence object for this instance.resourceBundleIDs
- -- an array of resource bundle id. Optional.public Schedule(java.lang.String name, java.lang.String description, java.util.Collection<ExplicitDate> dates)
name
- the name for the new instance. It cannot be null. The name is also
used as the default display name unless otherwise specifially set.description
- an optional description.dates
- a collection explicit dates for occurrences.public Schedule(java.lang.String name, java.lang.String displayNameKey, java.lang.String descriptionKey, java.util.Collection<ExplicitDate> dates, java.lang.String[] resourceBundleIDs)
name
- name of the new instance. It cannot be null. The name is also
used as the default display name unless otherwise specifially set.displayNameKey
- - the key of the entry in the resourcebundles to lookup the name.descriptionKey
- - the key of the entry in the resourcebundles to lookup the description.
Optional.dates
- a collection explicit dates for occurrences.resourceBundleIDs
- -- an array of resource bundle idpublic Schedule(java.lang.String name, java.lang.String description, Recurrence recur, MetadataObjectId objectId)
This constructor is for internal use ONLY and should not be used
to construct a new instance. This constructor is used
internally by the MetadataService
to populate the unique
identifier of this object(definition) within the metadata repository.
name
- name of the new instance. It cannot be null. The name is also
used as the default display name unless otherwise specifially set.description
- an optional description.recur
- an instance of Recurrence object for this instance.objectId
- unique identifier of this object in the metadata
repository. The identifier is set which this object is retrieved
via MetadataService
.public Schedule(java.lang.String name, java.lang.String description, java.util.Collection<ExplicitDate> dates, MetadataObjectId objectId)
This constructor is for internal use ONLY and should not be used
to construct a new instance. This constructor is used
internally by the MetadataService
to populate the unique
identifier of this object(definition) within the metadata repository.
name
- the name for the new instance. It cannot be null. The name is also
used as the default display name unless otherwise specifially set.description
- an optional description.dates
- a collection explicit dates for occurrences.objectId
- unique identifier of this object in the metadata
repository. The identifier is set which this object is retrieved via
MetadataService
.Method Detail |
---|
public Recurrence getRecurrence()
public void setRecurrence(Recurrence recur)
recur
- name of this object.public void addInclusionDate(ExplicitDate date)
date
- the explicit date to be included.public void removeInclusionDate(ExplicitDate date)
date
- the explicit date to be removed from the list of
included dates.public void setInclusionDates(java.util.Collection<ExplicitDate> dates)
dates
- collection of explicit date to be included.public java.util.Collection<ExplicitDate> getInclusionDates()
public void addExclusionDate(ExplicitDate date)
date
- the explicit date to be excluded.public void removeExclusionDate(ExplicitDate date)
date
- the explicit date to be removed from the list of
excluded dates.public void setExclusionDates(java.util.Collection<ExplicitDate> dates)
dates
- the list of explicit date to be excluded.public java.util.Collection<ExplicitDate> getExclusionDates()
public void addExclusion(MetadataObjectId objectId)
objectId
- the identifier of the ExclusionsDefinition to be added.public void removeExclusion(MetadataObjectId objectId)
objectId
- identifier of the ExclusionsDefinition to be removed.public java.util.Collection<MetadataObjectId> getExclusions()
public void setExclusionsDefinition(java.util.Collection<ExclusionsDefinition> exclusions)
addExclusion
method
should be used instead.
exclusions
- collection of ExclusionsDefinition objects to be set.public java.util.TimeZone getTimeZone()
public void setTimeZone(java.util.TimeZone tz)
tz
- the TimeZone to be set for this object. NULL if the TimeZone
needs to be cleared/unset.public oracle.as.scheduler.runtime.ScheduleState getFirstOccurrence(java.util.Calendar startTime, java.util.Calendar effectiveTime)
startTime
and effectiveTime
. startTime
may, in some cases, be used as a template for missing time fields.
startTime
- Represents the time on which the first occurrence is
generated. This value can be used both as a lower boundary on the
schedule and a template for missing fields in a recurrence.effectiveTime
- Represents a lower boundary on the schedule.
No occurrences will be generated before this time.public java.util.Calendar getNext(java.util.Calendar time)
time
- timestamp based on which the occurrence will
be calculated.
public java.util.Calendar getNext(java.util.Calendar time, java.util.Calendar orig)
time
- timestamp representing previous occurrence. This can
be the one from the recurrence pattern or an explicit date that this
Schedule object returned last time.orig
- original requested start time for the request for which
the next time is being calculated. The Schedule may or may not use it.
public java.util.Calendar getNext(java.util.Calendar time, boolean firstTime, java.util.Calendar orig)
To compute the next possible occurrence, the method takes into account the recurrence, the list of inclusions dates, list of exclusion dates as well and shared ExclusionsDefinition this object refers to.
Based on the end date/time or the count if specified for this object, the Schedule will stop generating occurrences and return 0. This must be interpreted as end of this Schedule.
time
- the time on which the next occurrence will be generated.firstTime
- flag indicating whether the call is for
first occurrence or not.orig
- original timestamp with which the occurrences started.
public oracle.as.scheduler.runtime.ScheduleState getNext(oracle.as.scheduler.runtime.ScheduleState state)
public java.util.Collection<java.util.Calendar> list(java.util.Calendar begin, java.util.Calendar end) throws IllegalArgumentException
begin
- the start date/time for listing possible occurrences, inclusive, not null.end
- the end date/time for listing possible occurrences, inclusive, not null.
IllegalArgumentException
public java.util.Collection<java.util.Calendar> list(java.util.Calendar begin, int count) throws IllegalArgumentException
begin
- the start date/time for listing occurrences, inclusive, not null.count
- the maximum number of occurrences to be listed.
IllegalArgumentException
public java.util.Collection<java.util.Calendar> list(java.util.Calendar begin, java.util.Calendar end, int limit) throws IllegalArgumentException
begin
- the start date/time for listing possible occurrences, inclusive, not null.end
- the end date/time for listing possible occurrences, inclusive.limit
- the maximum number of occurrences to be listed. The limit has to be
a positive integer or zero. A zero limit results an empty list.
IllegalArgumentException
protected void validateCustom() throws ValidationException
MetadataService
at the
time of persistence.
validateCustom
in class BaseMetadata<Schedule>
ValidationException
- thrown if any validation errors are found.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to compare with this Schedule.
public java.lang.String toString()
toString
in class BaseMetadata<Schedule>
public static javax.management.openmbean.CompositeType toCompositeType()
public javax.management.openmbean.CompositeData toCompositeData(javax.management.openmbean.CompositeType ct)
toCompositeData
in class BaseMetadata<Schedule>
public static Schedule from(javax.management.openmbean.CompositeData cd) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
protected Schedule getSelf()
getSelf
in class BaseMetadata<Schedule>
public BaseMetadataType<Schedule> getBaseMetadataType()
getBaseMetadataType
in class BaseMetadata<Schedule>
public Schedule clone(java.lang.String newName)
clone
in class BaseMetadata<Schedule>
public java.lang.String toDisplayString(java.util.Locale locale)
locale
-
|
Oracle Fusion Applications Java API Reference for Oracle Enterprise Scheduler Service 11g Release 1 (11.1.1.6) E20742-04 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |