|
ModeShape Distribution 3.5.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.modeshape.jcr.cache.SessionCacheWrapper
public class SessionCacheWrapper
A SessionCache implementation that wraps another and is suitable to extend and overwrite only those methods that are
required.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.modeshape.jcr.cache.SessionCache |
|---|
SessionCache.PreSave, SessionCache.SaveContext |
| Constructor Summary | |
|---|---|
SessionCacheWrapper(SessionCache delegate)
|
|
| Method Summary | |
|---|---|
void |
addContextData(String key,
String value)
Adds a [key,value] data pair for this cache's context |
void |
checkForTransaction()
Check whether this session is running within a transaction. |
void |
clear()
Clears all changes in the cache. |
void |
clear(CachedNode node)
Clears all changes in the cache that are at or below the supplied node. |
NodeKey |
createNodeKey()
Create a new node key for the current source and workspace. |
NodeKey |
createNodeKey(String sourceName,
String identifier)
Create a new node key for the current source and workspace. |
NodeKey |
createNodeKeyWithIdentifier(String identifier)
Create a new node key for the current source and workspace. |
NodeKey |
createNodeKeyWithSource(String sourceName)
Create a new node key for the current source and workspace. |
void |
destroy(NodeKey key)
Destroy the subgraph with the supplied node as the top node in the subgraph. |
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. |
Set<NodeKey> |
getChangedNodeKeys()
Returns a set with the NodeKeys of the transient nodes from this cache. |
Set<NodeKey> |
getChangedNodeKeysAtOrBelow(CachedNode node)
Returns a set with the NodeKeys of the transient nodes from this cache which are at or below the path of the given
node |
ExecutionContext |
getContext()
Get the context for this session. |
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. |
Set<NodeKey> |
getNodeKeysAtAndBelow(NodeKey nodeKey)
Returns a set with the NodeKeys of the existing nodes (persistent not transient & new) which are at and below the
path of the node with the given key. |
NodeKey |
getRootKey()
Get the node key for the root node. |
NodeCache |
getWorkspace()
Get the cache the reflects the workspace content, without any of the transient, unsaved changes of this session. |
boolean |
hasChanges()
Determine whether this session has any transient, unsaved changes. |
boolean |
isDestroyed(NodeKey key)
Return whether the node with the supplied key has been removed using this session but not yet persisted. |
boolean |
isReadOnly()
Returns whether this cache is readonly. |
MutableCachedNode |
mutable(NodeKey key)
Get a mutable form of the node with the supplied key. |
void |
save()
Saves all changes made within this session. |
void |
save(SessionCache otherSession,
SessionCache.PreSave preSaveOperation)
Saves all changes made within this session and the supplied session, using a single transaction for both. |
void |
save(Set<NodeKey> toBeSaved,
SessionCache otherSession,
SessionCache.PreSave preSaveOperation)
Saves all of this session's changes that were made at or below the specified path. |
SessionCache |
unwrap()
Unwrap this instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SessionCacheWrapper(SessionCache delegate)
| Method Detail |
|---|
public SessionCache unwrap()
NodeCache
unwrap in interface NodeCacheunwrap in interface SessionCachepublic void clear()
NodeCache
clear in interface NodeCachepublic NodeKey getRootKey()
NodeCache
getRootKey in interface NodeCachepublic CachedNode getNode(NodeKey key)
NodeCache
getNode in interface NodeCachekey - the node key; may not be null
public CachedNode getNode(ChildReference reference)
NodeCachegetNode(reference.getKey());
getNode in interface NodeCachereference - the child node reference; may not be null
public Iterator<NodeKey> getAllNodeKeys()
NodeCache
getAllNodeKeys in interface NodeCachepublic Iterator<NodeKey> getAllNodeKeysAtAndBelow(NodeKey startingKey)
NodeCache
getAllNodeKeysAtAndBelow in interface NodeCachestartingKey - the key for the node to start; may not be null
public ExecutionContext getContext()
SessionCache
getContext in interface SessionCache
public void addContextData(String key,
String value)
SessionCache
addContextData in interface SessionCachekey - the key for the context datavalue - the value for the context datapublic void save()
SessionCache
save in interface SessionCache
public void save(Set<NodeKey> toBeSaved,
SessionCache otherSession,
SessionCache.PreSave preSaveOperation)
SessionCacheItem.save().
save in interface SessionCachetoBeSaved - the set of keys identifying the nodes whose changes should be saved; may not be nullotherSession - another session whose changes should be saved with this session's changes; may not be nullpreSaveOperation - the set of operations to run against the new and changed nodes prior to saving; may be null
public void save(SessionCache otherSession,
SessionCache.PreSave preSaveOperation)
SessionCache
save in interface SessionCacheotherSession - another session whose changes should be saved with this session's changes; may not be nullpreSaveOperation - the set of operations to run against the new and changed nodes prior to saving; may be nullpublic boolean hasChanges()
SessionCache
hasChanges in interface SessionCachepublic Set<NodeKey> getChangedNodeKeys()
SessionCacheNodeKeys of the transient nodes from this cache. Please note that there may be nodes which
have been removed by another session.
getChangedNodeKeys in interface SessionCacheSet with the changed keys, or an empty set if
SessionCache.hasChanges() is false. The returned set is a mutable copy of the
underlying set.
public Set<NodeKey> getChangedNodeKeysAtOrBelow(CachedNode node)
throws NodeNotFoundException
SessionCacheNodeKeys of the transient nodes from this cache which are at or below the path of the given
node
getChangedNodeKeysAtOrBelow in interface SessionCachenode - a non-null CachedNode instance
NodeNotFoundException - if any of changes registered in this cache refer to nodes that have been removed in the
meantime.public Set<NodeKey> getNodeKeysAtAndBelow(NodeKey nodeKey)
SessionCacheNodeKeys of the existing nodes (persistent not transient & new) which are at and below the
path of the node with the given key. Note that this method will attempt to load each node
getNodeKeysAtAndBelow in interface SessionCachenodeKey - the key of node which will be considered the root node
public void clear(CachedNode node)
SessionCache
clear in interface SessionCachenode - the node at or below which all changes should be cleared; may not be nullpublic NodeCache getWorkspace()
SessionCache
getWorkspace in interface SessionCache
public MutableCachedNode mutable(NodeKey key)
throws NodeNotFoundException,
UnsupportedOperationException
SessionCache
mutable in interface SessionCachekey - the key for the node; may not be null
NodeNotFoundException - if there is no existing node in the session cache or workspace cache
UnsupportedOperationException - if this session is marked for read-only operations
public void destroy(NodeKey key)
throws NodeNotFoundException,
UnsupportedOperationException
SessionCacheremoved from its parent node.
destroy in interface SessionCachekey - the key for the top node in the subgraph; may not be null
NodeNotFoundException - if there is no existing node in the session cache or workspace cache
UnsupportedOperationException - if this session is marked for read-only operationspublic boolean isDestroyed(NodeKey key)
SessionCache
isDestroyed in interface SessionCachekey - the for the node; may not be null
public NodeKey createNodeKey()
SessionCache
createNodeKey in interface SessionCachepublic NodeKey createNodeKeyWithIdentifier(String identifier)
SessionCache
createNodeKeyWithIdentifier in interface SessionCacheidentifier - the unique identifier for the key; if null, a generated identifier will be used
public boolean isReadOnly()
SessionCache
isReadOnly in interface SessionCachepublic NodeKey createNodeKeyWithSource(String sourceName)
SessionCache
createNodeKeyWithSource in interface SessionCachesourceName - the name (not key) for the source; if null, the key for the current source is used
public NodeKey createNodeKey(String sourceName,
String identifier)
SessionCache
createNodeKey in interface SessionCachesourceName - the name (not key) for the source; if null, the key for the current source is usedidentifier - the unique identifier for the key; if null, a generated identifier will be used
public void checkForTransaction()
SessionCache
checkForTransaction in interface SessionCache
|
ModeShape Distribution 3.5.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||