ModeShape Distribution 3.0.0.Beta4

org.modeshape.jcr.cache
Interface NodeCache

All Known Subinterfaces:
DocumentCache, SessionCache
All Known Implementing Classes:
AbstractSessionCache, ReadOnlySessionCache, WorkspaceCache, WritableSessionCache

public interface NodeCache


Method Summary
 void clear()
          Clears all changes in the cache.
 Iterator<NodeKey> getAllNodeKeys()
          Get an iterator over all node keys within this cache.
 Iterator<NodeKey> getAllNodeKeysAtAndBelow(NodeKey startingKey)
          Get an iterator over all keys for the supplied node and all its descendants.
 CachedNode getNode(ChildReference reference)
          Get the cached representation of the node as represented by the supplied child reference.
 CachedNode getNode(NodeKey key)
          Get the cached representation of the node with the supplied node key.
 NodeKey getRootKey()
          Get the node key for the root node.
 

Method Detail

clear

void clear()
Clears all changes in the cache.


getRootKey

NodeKey getRootKey()
Get the node key for the root node.

Returns:
the root node's key; never null

getNode

CachedNode getNode(NodeKey key)
Get the cached representation of the node with the supplied node key.

Parameters:
key - the node key; may not be null
Returns:
the cached node, or null if there is no such node

getNode

CachedNode getNode(ChildReference reference)
Get the cached representation of the node as represented by the supplied child reference. This is a convenience method that is equivalent to calling:
 getNode(reference.getKey());
 

Parameters:
reference - the child node reference; may not be null
Returns:
the cached node to which the reference points, or null if the child reference no longer points to a valid node

getAllNodeKeys

Iterator<NodeKey> getAllNodeKeys()
Get an iterator over all node keys within this cache. The order of the keys is not defined.

Returns:
an iterator over all the cache's node keys; never null

getAllNodeKeysAtAndBelow

Iterator<NodeKey> getAllNodeKeysAtAndBelow(NodeKey startingKey)
Get an iterator over all keys for the supplied node and all its descendants. The order of the keys is not defined.

Parameters:
startingKey - the key for the node to start; may not be null
Returns:
an iterator over all the cache's node keys; never null

ModeShape Distribution 3.0.0.Beta4

Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.