oracle.webcache.invalidation.invalidators
Class Invalidator

java.lang.Object
  |
  +--oracle.webcache.invalidation.invalidators.InvalidatorElement
        |
        +--oracle.webcache.invalidation.invalidators.Invalidator

public class Invalidator
extends InvalidatorElement

The Invalidator class represents an Oracle Web Cache Release 2.0 invalidation message.

An invalidation message contains one or more invalidation items Each item defines an object (or range of objects) in the cache that are to be marked as invalid. An invalidation request takes place when an invalidation message is sent to the Web Cache.

At constructor time the invalidation message (buffer) is empty; it contains no invalidation items. An invalidation item is represented by the ObjectInvalidator class. Sub-classes of ObjectInvalidator further define the invalidation item, see Class Hierarchy below.

With this API an invalidation message is built piecemeal by adding invalidation items to it.

Class Hierarchy:

                                     Invalidator
                                          |
                                  ObjectInvalidator
                                          |
            ----------------------------------------------------
            |                             |                    |
  BasicSelectorInvalidator  AdvancedSelectorInvalidator  ActionInvalidator
                                          |
                                  -------------------
                                  |                 |
                          CookieInvalidator  HeaderInvalidator
 

Example 1: Invalidating One Documemt

   Invalidator inv = new Invalidator ();
   ObjectInvalidator objInv = new ObjectInvalidator ();
   objInv.add ( new BasicSelectorInvalidator("/images/logo.gif") );
   inv.add (objInv);
   InvalidationConnection invConn = new InvalidationConnection ();
   invConn.send (inv);
 

Example 2: Invalidating a Subtree of Documemts

   Invalidator inv = new Invalidator ();
   ObjectInvalidator objInv = new ObjectInvalidator ();
   objInv.add ( new AdvancedSelectorInvalidator("/images/") );
   objInv.add ( new ActionInvalidator("1800") );
   inv.add (objInv);
   InvalidationConnection invConn = new InvalidationConnection (
       "localhost", "4001", "invalidator", "invalidator");
   invConn.send (inv);
 

See Also:
ObjectInvalidator, BasicSelectorInvalidator, AdvancedSelectorInvalidator, ActionInvalidator, CookieInvalidator, HeaderInvalidator

Constructor Summary
Invalidator(boolean useSOAP)
          Constructs an empty invalidation message.
 
Method Summary
TypeMethod
 java.lang.String toString()
          Returns the current contents of the invalidation message buffer (in the form of an XML document).
 
Methods inherited from class oracle.webcache.invalidation.invalidators.InvalidatorElement
add, addAttribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Invalidator

public Invalidator(boolean useSOAP)
Constructs an empty invalidation message.

Parameters:
useSOAP - reserved for future use, must be false
Method Detail

toString

public java.lang.String toString()
Returns the current contents of the invalidation message buffer (in the form of an XML document).
Overrides:
toString in class InvalidatorElement