Oracle Application Server Web Cache Invalidation API Reference
10g (9.0.4)

B10402-01

oracle.webcache.invalidation
Class InvalidationConnection

java.lang.Object
  |
  +--oracle.webcache.invalidation.InvalidationConnection
Direct Known Subclasses:
SimpleInvalidationConnection

public class InvalidationConnection
extends java.lang.Object

This class represents an OracleAS Web Cache connection over which invalidation messages may be sent, either synchronously or asynchronously.

Connection details (such as the hostname and port number of the Web Cache) are read from an XML configuration file.


Constructor Summary
  InvalidationConnection()
          Constructs a Web Cache invalidation connection over which an invalidation message can be sent.
protected InvalidationConnection(oracle.net.http.HttpConnection conn)
           
  InvalidationConnection(java.lang.String tagName)
          Constructs a Web Cache invalidation connection over which an invalidation message can be sent.
  InvalidationConnection(java.lang.String configFile, java.lang.String tagName)
          Constructs an OracleAS Web Cache invalidation connection over which an invalidation message can be sent.

 

Method Summary
 InvalidationResult send(InvalidationMessage msg)
          Sends an invalidation message to the Web Cache, in synchronous mode.
 void send(InvalidationMessage msg, oracle.net.http.HttpListener lsnr, java.lang.Object callbackArg)
          Sends an invalidation message to the Web Cache, in asynchronous mode.
 InvalidationResult send(java.lang.String msg)
          Sends an invalidation message to the Web Cache, in synchronous mode.
 void send(java.lang.String msg, oracle.net.http.HttpListener lsnr, java.lang.Object callbackArg)
          Sends an invalidation message to the Web Cache, in asynchronous mode.
static void shutdown()
          Terminates all outstanding sender threads.

 

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

 

Constructor Detail

InvalidationConnection

public InvalidationConnection(java.lang.String configFile,
                              java.lang.String tagName)
Constructs an OracleAS Web Cache invalidation connection over which an invalidation message can be sent.

Connection details (such as the hostname and port number of the Web Cache) are read from an XML configuration file. The given tagName parameter identifies which element in the configuration file contains these details. This element may appear anywhere in the file (at any depth).

If the element is a simple element (i.e. it has no sub-elements) then it is expected to have the following attributes:

   host="<hostname of Web Cache>"
   port="<invalidation port no.>"
   authorization="<obfuscated HTTP Authorization string>"
The authorization attribute may be omitted; if so, the HTTP Authorization string will default to the shipped default value ("invalidator:invalidator"). To "obfuscate" the value the user is expected to perform the following two steps:
  1. Use the Oracle obfuscation toolkit (found in ojmisc.jar) to encrypt the string.
  2. Take the result of step 1 and convert it to a hexadecimal string.
As a convience, the following utility function is provided for this purpose - it will take a given string, obfuscate it and return its hexadecimalized representation:
public static java.lang.String oracle.util.HO.tho(java.lang.String password)

These atttributes define the underlying physical HTTP "connection". A call to InvalidationConnection.send will result in an InvalidationMessage being sent to the Web Cache over this connection.

If the element has sub-elements then each of its sub-elements are expected to be simple elements of the above type. In this case a corresponding group of physical HTTP "connections" are associated with this InvalidationConnection. A call to InvalidationConnection.send will result in an InvalidationMessage being sent over each connection in the group.

 A "simple" configuration file might look like this:
  <?xml version="1.0" ?>
  <webcache>
    <invalidation
      host="cache.us.oracle.com"
      port="4001"
      authorization="03f06e7b2d77faf35eee766d737626900282764f12cc53f56d075ae0befffde354"/>
  </webcache>
    
 A "complex" configuration file might look like this:
  <?xml version="1.0" ?>
  <invalidation>
    <webcache1
      host="cache1.us.oracle.com"
      port="4001"/>
    <webcache2
      host="cache2.us.oracle.com"
      port="4001"
      authorization="03f06e7b2d77faf35eee766d737626900282764f12cc53f56d075ae0befffde354"/>
  </invalidation>

Parameters:
configFile - name of config file, if null, the name is expected to be defined by the system property "oracle.http.configuration."
tagName - tag name of element in config file whose attributes define the required connection details. In the above example you would use "invalidation" in the simple case, and in the complex case you would use either "webcache1" or "webcache2" (or "invalidation" if you want to define a connection group).

InvalidationConnection

public InvalidationConnection(java.lang.String tagName)
Constructs a Web Cache invalidation connection over which an invalidation message can be sent.

Equivalent to InvalidationConnection(null, tagName).


InvalidationConnection

public InvalidationConnection()
Constructs a Web Cache invalidation connection over which an invalidation message can be sent.

Equivalent to InvalidationConnection(null, "invalidation").


InvalidationConnection

protected InvalidationConnection(oracle.net.http.HttpConnection conn)
Method Detail

send

public InvalidationResult send(InvalidationMessage msg)
Sends an invalidation message to the Web Cache, in synchronous mode.
Parameters:
msg - an InvalidationMessage object
Returns:
an InvalidationResult object
See Also:
InvalidationMessage, InvalidationResult

send

public InvalidationResult send(java.lang.String msg)
Sends an invalidation message to the Web Cache, in synchronous mode.
Parameters:
msg - invalidation message expressed as an XML document (in compliance with WCSinvalidation.dtd)
Returns:
an InvalidationResult object
See Also:
InvalidationResult

send

public void send(InvalidationMessage msg,
                 oracle.net.http.HttpListener lsnr,
                 java.lang.Object callbackArg)
Sends an invalidation message to the Web Cache, in asynchronous mode. Notifies caller when send is complete via an asynchronous callback.
Parameters:
msg - an InvalidationMessage object
lsnr - callback listener
callbackArg - callback argument
See Also:
InvalidationMessage, HttpListener

send

public void send(java.lang.String msg,
                 oracle.net.http.HttpListener lsnr,
                 java.lang.Object callbackArg)
Sends an invalidation message to the Web Cache, in asynchronous mode. Notifies caller when send is complete via an asynchronous callback.
Parameters:
msg - invalidation message expressed as an XML document (in compliance with WCSinvalidation.dtd)
lsnr - callback listener
callbackArg - callback argument
See Also:
InvalidationMessage, HttpListener

shutdown

public static void shutdown()
Terminates all outstanding sender threads.

Oracle Application Server Web Cache Invalidation API Reference
10g (9.0.4)

B10402-01

Copyright © 2003 Oracle Corporation. All Rights Reserved.