Oracle Fusion Middleware
Java API Reference for Oracle PDK Java

11g Release 1 (11.1.1)

E10691-01


oracle.portal.provider.v2.cache.invalidation
Class InvalidationContext

java.lang.Object
  extended by oracle.portal.provider.v2.cache.invalidation.InvalidationContext
Direct Known Subclasses:
ServletInvalidationContext

public abstract class InvalidationContext
extends java.lang.Object

Interface for objects representing an invalidation object. It is used to set up and execute an invalidation request. This is done by setting up an InvalidationContext type object and then building up the invalidation request by setting various cache keys.

There are two sets of methods. The first allows requests to be set up from within the context of a provider (using JPDK objects). The second set enables external code to set up requests using object ids and names. NOTE: The set methods in this interface do not accept null values


Constructor Summary
InvalidationContext()
           
 
Method Summary
abstract  void clearAllKeys()
          Clear all of the cache keys so that an object of this type can be used to make repeated invalidation requests.
abstract  int invalidate()
          Execute the invalidation.
 int invalidateURI(java.lang.String uriHost, java.lang.String uriPrefix, java.lang.String uriExpression)
          Invalidates cached documents using an arbitrary host, port, folder prefix and regular expression suffix.
abstract  void setAuthenticationLevel(int level)
          Set authentication level as an invalidation request key
 void setLocale(java.util.Locale locale)
          Set locale as an invalidation key.
abstract  void setPortalRealm(PortalRealm pr)
          Set the user's realm name as an invalidation key
abstract  void setPortalRealm(java.lang.String name)
          Set the user's realm name as an invalidation key
abstract  void setPortlet(long id)
          Set a portlet id for this invalidation request.
abstract  void setPortlet(PortletInstance pt)
          Use a Portlet object to set up an invalidation request.
 void setPortletInstance(PortletInstance pInst)
          Use a PortletInstance as a key for an invalidation request.
abstract  void setPortletInstanceName(java.lang.String instanceName)
          Set a portlet instance as key for an invalidation request.
abstract  void setPortletReference(PortletReference pRef)
          Invalidate content using a PortletReference object.
abstract  void setProvider(ProviderInstance pr)
          Use a Provider object to set up an invalidation request.
abstract  void setProvider(java.lang.String id)
          Set a provider id for this invalidation request.
abstract  void setProviderSubscription(ProviderSubscription ps)
          Set the subscription id as an invalidation key
abstract  void setProviderSubscription(java.lang.String id)
          Set the subscription id as an invalidation key
abstract  void setService(java.lang.String id)
          Set a service id for this invalidation request.
abstract  void setUser(ProviderUser pu)
          Use a provider user as a key for the invalidation request.
abstract  void setUsername(java.lang.String user)
          Set the user name as a key for the invalidation request
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InvalidationContext

public InvalidationContext()
Method Detail

setProvider

public abstract void setProvider(ProviderInstance pr)
                          throws InvalidationException
Use a Provider object to set up an invalidation request.

Parameters:
pr - the provider whose content will be invalidated
Throws:
InvalidationException - thrown if a null parameter is passed

setPortlet

public abstract void setPortlet(PortletInstance pt)
                         throws InvalidationException
Use a Portlet object to set up an invalidation request. The underlying implementation class should use Provider info as well as Portlet info in the invalidation request.

Parameters:
pt - portlet whose content will be invalidated
Throws:
InvalidationException - thrown if a null parameter is passed

setPortletInstance

public void setPortletInstance(PortletInstance pInst)
                        throws InvalidationException
Use a PortletInstance as a key for an invalidation request. The default implementation is included so that implementation classes built against previous versions of the interface still work.

Parameters:
pInst - the object from which invalidation keys will be generated.
Throws:
InvalidationException - thrown if a null parameter is passed

setPortletReference

public abstract void setPortletReference(PortletReference pRef)
                                  throws InvalidationException
Invalidate content using a PortletReference object. This object encapsulates the provider, portlet, portlet instance name, user name and language.

Parameters:
pRef - the portlet reference whose content will be invalidated
Throws:
InvalidationException - thrown if a null parameter is passed

setUser

public abstract void setUser(ProviderUser pu)
                      throws InvalidationException
Use a provider user as a key for the invalidation request.

Parameters:
pu - the provider user object.
Throws:
InvalidationException - thrown if a null parameter is passed

setProviderSubscription

public abstract void setProviderSubscription(ProviderSubscription ps)
                                      throws InvalidationException
Set the subscription id as an invalidation key

Parameters:
ps - the JPDK object containing the invalidation key
Throws:
InvalidationException - thrown if a null parameter is passed

setProviderSubscription

public abstract void setProviderSubscription(java.lang.String id)
                                      throws InvalidationException
Set the subscription id as an invalidation key

Parameters:
id - the invalidation key
Throws:
InvalidationException - thrown if a null parameter is passed

setPortalRealm

public abstract void setPortalRealm(PortalRealm pr)
                             throws InvalidationException
Set the user's realm name as an invalidation key

Parameters:
pr - the JPDK object containing the invalidation key
Throws:
InvalidationException - thrown if a null parameter is passed

setPortalRealm

public abstract void setPortalRealm(java.lang.String name)
                             throws InvalidationException
Set the user's realm name as an invalidation key

Parameters:
name - the realm name
Throws:
InvalidationException - thrown if a null parameter is passed

setService

public abstract void setService(java.lang.String id)
                         throws InvalidationException
Set a service id for this invalidation request.

Parameters:
id - the id of the service whose content will be invalidated
Throws:
InvalidationException - thrown if a null parameter is passed

setProvider

public abstract void setProvider(java.lang.String id)
                          throws InvalidationException
Set a provider id for this invalidation request.

Parameters:
id - the id of the provider whose content will be invalidated
Throws:
InvalidationException - thrown if a null parameter is passed

setPortlet

public abstract void setPortlet(long id)
                         throws InvalidationException
Set a portlet id for this invalidation request.

Parameters:
id - the id of the portlet whose content will be invalidated
Throws:
InvalidationException - thrown if a null parameter is passed

setUsername

public abstract void setUsername(java.lang.String user)
                          throws InvalidationException
Set the user name as a key for the invalidation request

Parameters:
user - the provider user name
Throws:
InvalidationException - thrown if a null parameter is passed

setPortletInstanceName

public abstract void setPortletInstanceName(java.lang.String instanceName)
                                     throws InvalidationException
Set a portlet instance as key for an invalidation request. This method sets an invalidation key based on the instance name alone.

Parameters:
instanceName - the name of the portlet instance whose content will be invalidated.
Throws:
InvalidationException - thrown if a null parameter is passed

setAuthenticationLevel

public abstract void setAuthenticationLevel(int level)
Set authentication level as an invalidation request key

Parameters:
level - the authentication level, e.g 1

setLocale

public void setLocale(java.util.Locale locale)
               throws InvalidationException
Set locale as an invalidation key. The default implementation is included so that implementation classes built against previous versions of the interface still work.

Parameters:
locale - the locale object to be used as an invalidation key
Throws:
InvalidationException - thrown if null parameter is passed or the method is not defined in the implementation class

clearAllKeys

public abstract void clearAllKeys()
Clear all of the cache keys so that an object of this type can be used to make repeated invalidation requests.


invalidate

public abstract int invalidate()
                        throws InvalidationException
Execute the invalidation.

Returns:
the number of objects invalidated by the request.
Throws:
InvalidationException - throw if there is a problem during invalidation

invalidateURI

public int invalidateURI(java.lang.String uriHost,
                         java.lang.String uriPrefix,
                         java.lang.String uriExpression)
                  throws InvalidationException
Invalidates cached documents using an arbitrary host, port, folder prefix and regular expression suffix.

Use this method to invalidate an arbitrary URI that has been cached.

Use this method to invalidate an arbitrary URI that has been cached.

Example usages:

  •  int numInvalidations = invalidationContext.invalidateURI(
         "myhost.us.oracle.com:7777", "/public/documents/jsp/", "info\\.jsp");
     
  •  int numInvalidations = invalidationContext.invalidateURI(
         "myhost.us.oracle.com:7777", "/public/documents/jsp/", "info.*jsp");
     

Parameters:
uriHost - the host and port of the document(s) to be invalidated. Must have the format "hostname:port".
uriPrefix - the folder that prefixes the document(s). Must have the format "/folder1/.../folderN/". Note that there must be opening and closing '/' slashes.
uriExpression - a regular expression corresponding to the URL of the document(s) to be invalidated underneath the uriPrefix
Returns:
the number of cached entries invalidated
Throws:
InvalidationException - if there is a problem during invalidation

Oracle Fusion Middleware
Java API Reference for Oracle PDK Java

11g Release 1 (11.1.1)

E10691-01


Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.