|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.jcr.cache.document.AbstractSessionCache
org.modeshape.jcr.cache.document.ReadOnlySessionCache
@ThreadSafe public class ReadOnlySessionCache
A read-only SessionCache
implementation.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.modeshape.jcr.cache.document.AbstractSessionCache |
---|
AbstractSessionCache.BasicSaveContext |
Nested classes/interfaces inherited from interface org.modeshape.jcr.cache.SessionCache |
---|
SessionCache.PreSave, SessionCache.SaveContext |
Field Summary |
---|
Fields inherited from class org.modeshape.jcr.cache.document.AbstractSessionCache |
---|
workspaceCache |
Constructor Summary | |
---|---|
ReadOnlySessionCache(ExecutionContext context,
WorkspaceCache workspaceCache,
SessionEnvironment sessionContext)
|
Method Summary | |
---|---|
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. |
void |
destroy(NodeKey key)
Destroy the subgraph with the supplied node as the top node in the subgraph. |
Set<NodeKey> |
getChangedNodeKeys()
Returns a set with the NodeKey s of the transient nodes from this cache. |
Set<NodeKey> |
getChangedNodeKeysAtOrBelow(CachedNode node)
Returns a set with the NodeKey s of the transient nodes from this cache which are at or below the path of the given
node |
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. |
SessionNode |
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. |
String |
toString()
|
Methods inherited from class org.modeshape.jcr.cache.document.AbstractSessionCache |
---|
addContextData, createNodeKey, createNodeKey, createNodeKeyWithIdentifier, createNodeKeyWithSource, generateIdentifier, getAllNodeKeys, getAllNodeKeysAtAndBelow, getContext, getNode, getNode, getNodeKeysAtAndBelow, getRootKey, getWorkspace, workspaceCache |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ReadOnlySessionCache(ExecutionContext context, WorkspaceCache workspaceCache, SessionEnvironment sessionContext)
Method Detail |
---|
public void clear()
NodeCache
public boolean hasChanges()
SessionCache
public Set<NodeKey> getChangedNodeKeys()
SessionCache
NodeKey
s of the transient nodes from this cache. Please note that there may be nodes which
have been removed by another session.
Set
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)
SessionCache
NodeKey
s of the transient nodes from this cache which are at or below the path of the given
node
node
- a non-null CachedNode
instance
public void clear(CachedNode node)
SessionCache
node
- the node at or below which all changes should be cleared; may not be nullpublic void save()
SessionCache
public void save(SessionCache otherSession, SessionCache.PreSave preSaveOperation)
SessionCache
otherSession
- 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 void save(Set<NodeKey> toBeSaved, SessionCache otherSession, SessionCache.PreSave preSaveOperation)
SessionCache
Item.save()
.
toBeSaved
- 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 nullpublic SessionNode mutable(NodeKey key)
SessionCache
mutable
in interface SessionCache
mutable
in class AbstractSessionCache
key
- the key for the node; may not be null
public boolean isReadOnly()
SessionCache
public void destroy(NodeKey key)
SessionCache
removed from its parent node
.
key
- the key for the top node in the subgraph; may not be nullpublic boolean isDestroyed(NodeKey key)
SessionCache
key
- the for the node; may not be null
public String toString()
toString
in class Object
|
ModeShape Distribution 3.0.0.Beta4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |