com.plumtree.uiinfrastructure.activityspace
Class ASCache

java.lang.Object
  extended by com.plumtree.uiinfrastructure.activityspace.ASCache

public class ASCache
extends java.lang.Object

This handles the cache for developers so that it can't get into an inconsistent state. Note: ClearCache() should not be used. This is only for debug purposes.

Author:
Don Hayler

Field Summary
static java.lang.String SPACEID_INVALID
          Used by the gateway in the interpreter, since it doesn't use cache IDs.
 
Constructor Summary
ASCache(ISessionManager cache, XPHashtable xpmCacheList)
          Constructor.
 
Method Summary
 void ClearCache()
          This method clears the AActivitySpace cache.
static ISessionManager GetASCache(ISessionManager session, ISessionManager smSandbox)
          Gets the ASCache session manager off of the top-level session manager, creating it if necessary; made into a separate method so the SSO login code can call it.
 java.lang.Object GetAttribute(java.lang.String sKey)
          Returns the value corresponding to the key in argument.
static XPHashtable GetCacheList(ISessionManager session)
          Gets the CacheList off of the top-level session manager.
 IXPEnumerator GetKeys()
          Returns an enumaration of the keys for the ASCache.
 AActivitySpace GetSpace(java.lang.String strName, java.lang.String nID)
          This method returns the requested AActivitySpace from the cache.
 AActivitySpace GetSpaceIfCached(java.lang.String strName)
          This method returns the requested AActivitySpace from the cache, if it exists.
 boolean GetSpaceIsSubSpace(java.lang.String sKey)
          Returns whether or not the space corresponding to the key in argument is a subspace.
 void HandleCacheLimit()
          This method handles cache management after the request has been sent to the user.
 void RemoveSubSpace(java.lang.String name, java.lang.String ID)
          This method removes the specified sub-space.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPACEID_INVALID

public static final java.lang.String SPACEID_INVALID
Used by the gateway in the interpreter, since it doesn't use cache IDs. This should not be used by Activity Space developers. This will trigger different Activity Space caching (see Interpreter.HandleCacheLimit for details)

See Also:
Constant Field Values
Constructor Detail

ASCache

public ASCache(ISessionManager cache,
               XPHashtable xpmCacheList)
Constructor.

Parameters:
ISessionManager - the cache to wrap
Method Detail

GetKeys

public IXPEnumerator GetKeys()
Returns an enumaration of the keys for the ASCache.

Returns:
IXPEnumerator Keys

GetAttribute

public java.lang.Object GetAttribute(java.lang.String sKey)
Returns the value corresponding to the key in argument. This method will reset the timestamp on the requested space.

Parameters:
sKey - Key of the requested value
Returns:
Object Value

GetSpaceIsSubSpace

public boolean GetSpaceIsSubSpace(java.lang.String sKey)
Returns whether or not the space corresponding to the key in argument is a subspace. This method will not reset the timestamp on the requested space.

Parameters:
sKey - Key of the requested value
Returns:
boolean true implies the requested space is a sub-space.

GetSpace

public AActivitySpace GetSpace(java.lang.String strName,
                               java.lang.String nID)
This method returns the requested AActivitySpace from the cache. This method will reset the timestamp on the requested space.

Parameters:
String - name the name of the AActivitySpace
String - ID the cache ID of the AActivitySpace
Returns:
AActivitySpace the requested space

GetSpaceIfCached

public AActivitySpace GetSpaceIfCached(java.lang.String strName)
This method returns the requested AActivitySpace from the cache, if it exists. This method will reset the timestamp on the requested space.

Parameters:
String - name the name of the AActivitySpace
Returns:
AActivitySpace the requested space, if it is cached. may return null.

RemoveSubSpace

public void RemoveSubSpace(java.lang.String name,
                           java.lang.String ID)
This method removes the specified sub-space. This will fail if the specified space is not a sub-space.

Parameters:
String - name the name of the AActivitySpace
String - ID the cache ID of the AActivitySpace

ClearCache

public void ClearCache()
This method clears the AActivitySpace cache. This should not be used and is only here for debugging purposes. Doing so will remove all cached spaces and cause them to be regenerated. All editors will fail when this happens.


HandleCacheLimit

public void HandleCacheLimit()
This method handles cache management after the request has been sent to the user. This should only be called by the Interpreter.


GetASCache

public static ISessionManager GetASCache(ISessionManager session,
                                         ISessionManager smSandbox)
Gets the ASCache session manager off of the top-level session manager, creating it if necessary; made into a separate method so the SSO login code can call it. Creates the cache (if necessary) and puts a safe wrapper around it into the user's sandbox session. This should only be used by the Interpreter and SSO login code.

Parameters:
session -
smSandbox -
Returns:
ISessionManager

GetCacheList

public static XPHashtable GetCacheList(ISessionManager session)
Gets the CacheList off of the top-level session manager. This should only be used by the Interpreter and SSO login code.

Parameters:
session -
Returns:
XPHashtable



Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.