org.modeshape.jcr.cache.document
Class SessionNode.DeepCopy
java.lang.Object
org.modeshape.jcr.cache.document.SessionNode.DeepCopy
- Direct Known Subclasses:
- SessionNode.DeepClone
- Enclosing class:
- SessionNode
protected class SessionNode.DeepCopy
- extends Object
targetCache
protected final WritableSessionCache targetCache
targetNode
protected final SessionNode targetNode
sourceCache
protected final SessionCache sourceCache
sourceNode
protected final CachedNode sourceNode
startingPathInSource
protected final Path startingPathInSource
propertyFactory
protected final PropertyFactory propertyFactory
targetWorkspaceKey
protected final String targetWorkspaceKey
linkedPlaceholdersToOriginal
protected final Map<NodeKey,NodeKey> linkedPlaceholdersToOriginal
sourceToTargetKeys
protected final Map<NodeKey,NodeKey> sourceToTargetKeys
SessionNode.DeepCopy
protected SessionNode.DeepCopy(SessionNode targetNode,
WritableSessionCache cache,
CachedNode sourceNode,
SessionCache sourceCache)
getSourceToTargetKeys
public Map<NodeKey,NodeKey> getSourceToTargetKeys()
execute
public void execute()
doPhase1
protected void doPhase1(MutableCachedNode targetNode,
CachedNode sourceNode)
- Perform a copy of the source tree to create a similar tree in the target session. Note that copying linked nodes varies
depending upon where the linked nodes are relative to the source tree.
- If the linked nodes and the original node are all in the source tree being copied, then the result of the copy will
contain a copy of the original and links to the new copy.
- If the original node is not within the source tree being copied, then the result of the copy will contain links to
the original node.
The result of phase 1 will have either created the links correctly or will have add placeholders in the target tree
representing where the linked children should exist. Such placeholders will be handled in phase 2.
- Parameters:
targetNode
- the (empty) target node that should be made to look like the supplied source node; may not be nullsourceNode
- the original node that should be copied; may not be null
createTargetKeyFor
protected NodeKey createTargetKeyFor(NodeKey sourceKey,
NodeKey parentKeyInTarget)
doPhase2
protected void doPhase2()
- This leaves any linked placeholders that failed in the map.
copyProperties
protected void copyProperties(MutableCachedNode targetNode,
CachedNode sourceNode)
toString
public String toString()
- Overrides:
toString
in class Object
getOperationName
protected String getOperationName()
Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.