Skip navigation links

Oracle Enterprise Scheduler Java API Reference
11g Release 1 (11.1.1.7)
E26229-06


oracle.as.scheduler
Class Exclusion

java.lang.Object
  extended by oracle.as.scheduler.Exclusion

All Implemented Interfaces:
java.io.Serializable

public class Exclusion
extends java.lang.Object
implements java.io.Serializable

Date/time instances that are excluded from the occurrences of a Schedule.

Instance of Exclusion can be added to the ExclusionsDefinition that contains the list of such exclusion instances. One or more ExclusionsDefinition objects are then referred by the Schedule.

An example would be the list of holidays. This list of holidays can be defined as an ExclusionsDefinition object where each holiday is represented by an instance of Exclusion Exclusion can be created with an ExplicitDate or with an Recurrenceobject. The Recurrence can represent one specific date such as Thanksgiving or a recurring pattern.

See Also:
RecurrenceFields, Recurrence, ExplicitDate, ExclusionsDefinition, Schedule, Serialized Form

Constructor Summary
Exclusion(java.lang.String name, ExplicitDate date)
          Constructs a new instance representing the given explicit date.
Exclusion(java.lang.String name, Recurrence recur)
          Constructs a new instance representing the given recurrence.

 

Method Summary
 boolean equals(java.lang.Object obj)
          Compares an object for equality with this Exclusion object.
 ExplicitDate getExplicitDate()
          Returns the explicit date this Exlusions object represents.
 java.lang.String getName()
          Returns the name of this Exlusions object.
 Recurrence getRecurrence()
          Returns the recurrence of this Exclusion object.
 int hashCode()
          Returns the hash code value of this Exclusion object.
 boolean isExcluded(java.util.Calendar start, java.util.Calendar date)
          Method to check if a given date is contained in this Exclusion.
 void setExplicitDate(ExplicitDate date)
          Sets the explicit date of this Exlusions object.
 void setName(java.lang.String name)
          Sets the name of this Exlusions object.
 void setRecurrence(Recurrence recur)
          Sets the recurrence of this Exlusion object.
 void validate()
          Validates this instance of Exclusion to make sure it contains valid Recurrence or ExplicitDate.

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

Exclusion

public Exclusion(java.lang.String name,
                 ExplicitDate date)
Constructs a new instance representing the given explicit date. The name of an Exclusions is optional. An example where the Exclusion might be named is any specific holiday such as Independence Day.
Parameters:
name - - optional name to be given to the Exclusion.
date - - the date this Exclusion represent.

Exclusion

public Exclusion(java.lang.String name,
                 Recurrence recur)
Constructs a new instance representing the given recurrence. The name of an Exclusions is optional. An example where the Exclusion might be named is any specific holiday such as Thanksgiving.
Parameters:
name - - optional name to be given to the Exclusion.
recur - - the recurrence this Exclusion represent.

Method Detail

getName

public java.lang.String getName()
Returns the name of this Exlusions object.
Returns:
- name if present, null otherwise.

setName

public void setName(java.lang.String name)
Sets the name of this Exlusions object.

setExplicitDate

public void setExplicitDate(ExplicitDate date)
                     throws UnsupportedOperationException
Sets the explicit date of this Exlusions object. Note that this method cannot be called if object already has a recurrence defined.
Parameters:
date - - explicit dat to be set for this object.
Throws:
UnsupportedOperationException - - thrown if this object already has a recurrence set.

getExplicitDate

public ExplicitDate getExplicitDate()
Returns the explicit date this Exlusions object represents.
Returns:
- explicit date if present, null otherwise.

setRecurrence

public void setRecurrence(Recurrence recur)
                   throws UnsupportedOperationException
Sets the recurrence of this Exlusion object. This method cannot be called if this object already contains an explicit date.
Parameters:
recur - - the instance of Recurrence to be set for this object.
Throws:
UnsupportedOperationException - - thrown if this object already has an explicit date set.

getRecurrence

public Recurrence getRecurrence()
Returns the recurrence of this Exclusion object.
Returns:
- recurrence of this object if present, null otherwise.

isExcluded

public boolean isExcluded(java.util.Calendar start,
                          java.util.Calendar date)
Method to check if a given date is contained in this Exclusion.

If a given date is present, it indicates that the specific date must be excluded. The method also requires a start time if this Exclusion instance is based on Recurrence The start time is the time from which the contained recurrence will start generating occurrences to check if the specified date is one of the occurrence or not. The method stops generating occurrence when the given date matches one of the generated occurrence or as soon as the generated occurrence goes beyond (after) the given date.

Parameters:
start - - used as the starting point of this Exclusion is based on Recurrence. If null, the underlying Recurrence will use the current timestamp to generate occurrences.
date - - the date/time to be checked for exclusion.
Returns:
- true if the given date must be excluded, false otherwise.

validate

public void validate()
              throws ValidationException
Validates this instance of Exclusion to make sure it contains valid Recurrence or ExplicitDate. This method also gets called via ExclusionsDefinition during persistence into metadata repository.
Throws:
ValidationException - - thrown if any invalid data is detected.

equals

public boolean equals(java.lang.Object obj)
Compares an object for equality with this Exclusion object.
Overrides:
equals in class java.lang.Object
Parameters:
obj - - the object to compare with this Exclusion.
Returns:
- true if the object passed in is an instance of Exclusion and is equal to this Exclusion, false otherwise.

hashCode

public int hashCode()
Returns the hash code value of this Exclusion object.
Overrides:
hashCode in class java.lang.Object
Returns:
- the hash code value of this Exclusion object.

Skip navigation links

Oracle Enterprise Scheduler Java API Reference
11g Release 1 (11.1.1.7)
E26229-06


Copyright © 2008, 2013, Oracle and/or its affiliates. All rights reserved.