|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.modeshape.graph.connector.map.AbstractMapWorkspace org.modeshape.graph.connector.inmemory.InMemoryRepository.Workspace
protected class InMemoryRepository.Workspace
Constructor Summary | |
---|---|
InMemoryRepository.Workspace(MapRepository repository,
String name)
|
Method Summary | |
---|---|
protected void |
addNodeToMap(MapNode node)
Adds the given node to the backing map, replacing any node already in the backing map with the same UUID. |
protected MapNode |
copyNode(ExecutionContext context,
MapNode original,
MapWorkspace newWorkspace,
MapNode newParent,
Name desiredName,
boolean recursive,
Map<UUID,UUID> oldToNewUuids)
This should copy the subgraph given by the original node and place the new copy under the supplied new parent. |
protected MapNode |
createMapNode(UUID uuid)
Creates an empty node with the given UUID. |
MapNode |
getNode(UUID nodeUuid)
Gets the node with the given UUID from the backing map, if one exists |
void |
lockNode(MapNode node,
LockBranchRequest.LockScope lockScope,
long lockTimeoutInMillis)
Attempts to lock the given node with the given timeout. |
void |
prepareForChange(InMemoryNode node)
Signal that the supplied node is about to change. |
protected void |
releaseBackups()
|
protected void |
removeAllNodesFromMap()
Removes all of the nodes from the backing map |
protected MapNode |
removeNodeFromMap(UUID nodeUuid)
Removes the node with the given UUID from the backing map, returning the node if it exists |
protected void |
restoreBackups()
|
void |
unlockNode(MapNode node)
Attempts to unlock the given node. |
Methods inherited from class org.modeshape.graph.connector.map.AbstractMapWorkspace |
---|
cloneNode, copyNode, correctSameNameSiblingIndexes, createNode, createNode, equals, getLowestExistingPath, getName, getNode, getNode, getRepository, getRoot, getUuidsUnderNode, hashCode, initialize, moveNode, moveNodeToWorkspace, pathFor, query, removeNode, removeUuidReference, search, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public InMemoryRepository.Workspace(MapRepository repository, String name)
Method Detail |
---|
protected MapNode createMapNode(UUID uuid)
node
with the given UUID.
This method does not add the new map node to the map. That must be done with a separate call to
AbstractMapWorkspace.addNodeToMap(MapNode)
.
createMapNode
in class AbstractMapWorkspace
uuid
- the UUID that identifies the new node; may not be null
AbstractMapWorkspace.createMapNode(java.util.UUID)
protected void addNodeToMap(MapNode node)
AbstractMapWorkspace
addNodeToMap
in class AbstractMapWorkspace
node
- the node to add to the map; may not be nullprotected MapNode removeNodeFromMap(UUID nodeUuid)
AbstractMapWorkspace
removeNodeFromMap
in class AbstractMapWorkspace
nodeUuid
- the UUID of the node to replace; may not be null
protected void removeAllNodesFromMap()
AbstractMapWorkspace
removeAllNodesFromMap
in class AbstractMapWorkspace
public MapNode getNode(UUID nodeUuid)
AbstractMapWorkspace
getNode
in interface MapWorkspace
getNode
in class AbstractMapWorkspace
nodeUuid
- the UUID of the node to be retrieved; may not be null
protected MapNode copyNode(ExecutionContext context, MapNode original, MapWorkspace newWorkspace, MapNode newParent, Name desiredName, boolean recursive, Map<UUID,UUID> oldToNewUuids)
This method is trivially overridden for testing purposes.
copyNode
in class AbstractMapWorkspace
context
- the context; may not be nulloriginal
- the node to be copied; may not be nullnewWorkspace
- the workspace containing the new parent node; may not be nullnewParent
- the parent where the copy is to be placed; may not be nulldesiredName
- the desired name for the node; if null, the name will be obtained from the original noderecursive
- true if the copy should be recursiveoldToNewUuids
- the map of UUIDs of nodes in the new subgraph keyed by the UUIDs of nodes in the original; may be
null if the UUIDs are to be maintained
public void lockNode(MapNode node, LockBranchRequest.LockScope lockScope, long lockTimeoutInMillis) throws LockFailedException
MapWorkspace
LockFailedException
will be
thrown.
lockNode
in interface MapWorkspace
node
- the node to be locked; may not be nulllockScope
- the scope of the lock (i.e., whether descendants of node
should be included in the locklockTimeoutInMillis
- the maximum lifetime of the lock in milliseconds; zero (0) indicates that the connector default
should be used
LockFailedException
- if the implementing connector supports locking but the lock could not be acquired.public void unlockNode(MapNode node)
MapWorkspace
unlockNode
in interface MapWorkspace
node
- the node to be unlocked; may not be nullpublic void prepareForChange(InMemoryNode node)
prepareForChange
in interface InMemoryNode.ChangeListener
node
- the node that is about to changeInMemoryNode.ChangeListener.prepareForChange(org.modeshape.graph.connector.inmemory.InMemoryNode)
protected void restoreBackups()
protected void releaseBackups()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |