com.sapportals.wcm.util.cache

Interface IClusterCacheArea


public interface IClusterCacheArea

Represents a cacheable area. A cacheable area is identified by its unique ID. An area is either in state valid or invalid. These states are toggled by the following events:

from event to side-effect
VALID validate() VALID initial state, calling validate() won't do anything.
VALID invalidate() VALID calling invalidate() will send an INVALIDATE event and update the getLastNodeInvalidation() timestamp.
VALID INVALIDATE INVALID an INVALIDATE event from other cluster nodes invalidates the cache area and updates the getLastClusterInvalidation() timestamp.
INVALID INVALIDATE INVALID INVALIDATE event in INVALID state just update the getLastClusterInvalidation() timestamp.
INVALID invalidate() INVALID calling invalidate() will send an INVALIDATE event and update the getLastNodeInvalidation() timestamp.
INVALID validate() VALID calling validate() toogles the state back to VALID.
For example used by the IDMapper.


Method Summary
 String getAreaID()
          Get the area's ID.
 long getClusterTimeout()
          Get the cluster cache timeout.
 long getLastClusterInvalidation()
          Get the timestamp of the last (external) invalidation from other cluster nodes.
 long getLastInvalidation()
          Get the timestamp of the last invalidation (internally or externally, the later one).
 long getLastNodeInvalidation()
          Get the timestamp of the last (internal) invalidation from this node.
 void invalidate()
          Mark this cache area as invalid.
 boolean isCluster()
          Get the cluster's cache flag.
 boolean isValid()
          Check, if this cache area is marked as invalid.
 void refresh(ICache cache)
          Remove all expired entries from the given cache (does a cache.removeEntriesOlderThan(getLastClusterInvalidation())).
 void validate()
          Mark this cache area as valid.
 

Method Detail

getAreaID

public String getAreaID()
Get the area's ID.

Returns:
a String, which holds the area's ID.

isCluster

public boolean isCluster()
Get the cluster's cache flag.

Returns:
true if the system is running in cluster mode.

getClusterTimeout

public long getClusterTimeout()
Get the cluster cache timeout.

Returns:
a long with the system's cluster cache timeout in msec.

validate

public void validate()
Mark this cache area as valid. Changes the state from INVALID to VALID.


refresh

public void refresh(ICache cache)
             throws CacheException
Remove all expired entries from the given cache (does a cache.removeEntriesOlderThan(getLastClusterInvalidation())).

Parameters:
cache - the ICache to remove expired entries from.
Throws:
CacheException

invalidate

public void invalidate()
Mark this cache area as invalid. Sends an INVALIDATE event to the other cluster nodes but doesn't change the state.


isValid

public boolean isValid()
Check, if this cache area is marked as invalid.

Returns:
true, if state is VALID.

getLastInvalidation

public long getLastInvalidation()
Get the timestamp of the last invalidation (internally or externally, the later one).

Returns:
the timestamp of the last invalidation, the later timestamp from getLastExternalInvalidation() and getLastInternalInvalidation().

getLastClusterInvalidation

public long getLastClusterInvalidation()
Get the timestamp of the last (external) invalidation from other cluster nodes.

Returns:
a long with the timestamp of the last incoming INVALIDATE event.

getLastNodeInvalidation

public long getLastNodeInvalidation()
Get the timestamp of the last (internal) invalidation from this node.

Returns:
a long with the timestamp of the last call to invalidate().


Copyright 2006 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.