com.filenet.wcm.toolkit.server.util
Class CacheManager

java.lang.Object
  extended bycom.filenet.wcm.toolkit.server.util.CacheManager

public class CacheManager
extends java.lang.Object

This helper class is used by WcmNavigationDataProvider and WcmAuthoringDataProvider for cahching navigation data.


Field Summary
static int CONTAINEE
           
static int CONTAINER
           
 
Constructor Summary
CacheManager()
           
 
Method Summary
 void clear()
          Clear the gneral session cache
 void clear(java.lang.String objectStoreName, java.lang.String objectId, int mode, int objectType, java.lang.String[] parentIds)
          Deprecated. use clearContainer or clearContainee signatures.
 void clearContainee(com.filenet.wcm.api.Document document)
          For each container of the document, clear its cached Document containees.
 void clearContainee(com.filenet.wcm.api.Folder folder)
          Clear the cached Folder containees of the specified folder's parent folder.
 void clearContainee(java.lang.String objectStoreName, int objectType, java.lang.Object parentInfo)
          For the containers in the specified object store specified in parentInfo, clear the cached items of the specified object type.
 void clearContainer(com.filenet.wcm.api.Folder folder)
          Clears all cached containees of the specified container.
 void clearContainer(java.lang.String objectStoreName, java.lang.String folderId)
          Clears all cached containees of the specified container.
static void clearStaticCache()
          Clear the static application cache value
 java.lang.Object get(java.lang.String key)
          Get the general session cache value
static CacheManager getCacheManager(WcmDataStore ds)
          Returns a singleton CacheManager objects
 org.w3c.dom.Document getResults(com.filenet.wcm.api.Session session, FilterData filterData)
          This runtine gets the requested results from from CS
 org.w3c.dom.Document getResults(com.filenet.wcm.api.Session session, FilterData filterData, boolean ignoreCache)
          This runtine gets the requested results from the cache and retrieves what ever it needs from CS
static java.lang.Object getStatic(java.lang.String key)
          Get the static application cache value
 long getTimeLastUpdated(FilterData filterData)
           
 void initializeCache()
           
 boolean isContainerDeleted(java.lang.String containerId)
          Checks if the container is is the deleted list with in the cache.
 void put(java.lang.String key, java.lang.Object value)
          Put an element into the general cache
static void putStatic(java.lang.String key, java.lang.Object value)
          Put an element into the static application cache
 void removeDeletedContainer(java.lang.String containerId)
          Removes the container from the deleted list.
 void setDeletedContainer(java.lang.String containerId)
          used to inform the cache that a container has been deleted so that a hit to the server can be avoided.
static java.lang.String substringBetween(java.lang.String str, java.lang.String open, java.lang.String close, boolean searchBackwards)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTAINER

public static final int CONTAINER
See Also:
Constant Field Values

CONTAINEE

public static final int CONTAINEE
See Also:
Constant Field Values
Constructor Detail

CacheManager

public CacheManager()
Method Detail

initializeCache

public void initializeCache()

setDeletedContainer

public void setDeletedContainer(java.lang.String containerId)
used to inform the cache that a container has been deleted so that a hit to the server can be avoided.

Parameters:
containerId -

isContainerDeleted

public boolean isContainerDeleted(java.lang.String containerId)
Checks if the container is is the deleted list with in the cache.

Parameters:
containerId -
Returns:
ture if the container id in the deletedcontainer list

removeDeletedContainer

public void removeDeletedContainer(java.lang.String containerId)
Removes the container from the deleted list.

Parameters:
containerId -

getCacheManager

public static CacheManager getCacheManager(WcmDataStore ds)
                                    throws java.lang.Exception
Returns a singleton CacheManager objects

Parameters:
ds - The data store for the controller
Returns:
The CacheManager
Throws:
java.lang.Exception

put

public void put(java.lang.String key,
                java.lang.Object value)
Put an element into the general cache

Parameters:
key - The cache key
value - The cache value

putStatic

public static void putStatic(java.lang.String key,
                             java.lang.Object value)
Put an element into the static application cache

Parameters:
key - The cache key
value - The cache value

getStatic

public static java.lang.Object getStatic(java.lang.String key)
Get the static application cache value

Parameters:
key - The Cache key
Returns:
The Cache value

get

public java.lang.Object get(java.lang.String key)
Get the general session cache value

Parameters:
key - The Cache key
Returns:
The Cache value

clearStaticCache

public static void clearStaticCache()
Clear the static application cache value


clear

public void clear()
Clear the gneral session cache


getTimeLastUpdated

public long getTimeLastUpdated(FilterData filterData)
Returns:
the cache last updated timestamp

clearContainer

public void clearContainer(com.filenet.wcm.api.Folder folder)
Clears all cached containees of the specified container.

Parameters:
folder -

clearContainer

public void clearContainer(java.lang.String objectStoreName,
                           java.lang.String folderId)
Clears all cached containees of the specified container.

Parameters:
objectStoreName -
folderId -

clearContainee

public void clearContainee(com.filenet.wcm.api.Document document)
For each container of the document, clear its cached Document containees.

Parameters:
document -

clearContainee

public void clearContainee(com.filenet.wcm.api.Folder folder)
Clear the cached Folder containees of the specified folder's parent folder.

Parameters:
folder -

clearContainee

public void clearContainee(java.lang.String objectStoreName,
                           int objectType,
                           java.lang.Object parentInfo)
For the containers in the specified object store specified in parentInfo, clear the cached items of the specified object type.

Parameters:
objectStoreName - The name of the object store where the specified folders reside.
objectType - Object type constant. Valid values are the WcmAuthoringDataProvider.TYPE_... constants.
parentInfo - Parent info can be either a String[] of folder IDs, a Folders collection, or a single Folder object.

clear

public void clear(java.lang.String objectStoreName,
                  java.lang.String objectId,
                  int mode,
                  int objectType,
                  java.lang.String[] parentIds)
Deprecated. use clearContainer or clearContainee signatures.


getResults

public org.w3c.dom.Document getResults(com.filenet.wcm.api.Session session,
                                       FilterData filterData)
                                throws java.lang.Exception
This runtine gets the requested results from from CS

Parameters:
session - The current session
filterData - The requested container object
Returns:
Throws:
java.lang.Exception

getResults

public org.w3c.dom.Document getResults(com.filenet.wcm.api.Session session,
                                       FilterData filterData,
                                       boolean ignoreCache)
                                throws java.lang.Exception
This runtine gets the requested results from the cache and retrieves what ever it needs from CS

Parameters:
session - The current session
filterData - The reqested container objects
ignoreCache - ignore the cashe
Returns:
The reqested results
Throws:
java.lang.Exception

substringBetween

public static java.lang.String substringBetween(java.lang.String str,
                                                java.lang.String open,
                                                java.lang.String close,
                                                boolean searchBackwards)


© Copyright IBM Corp. 2002, 2007. All Rights Reserved.