|
||||||||||
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.connector.store.jpa.model.simple.SimpleJpaRepository.Workspace
protected class SimpleJpaRepository.Workspace
This class provides a logical mapping of UUIDs to nodes
within a named workspace.
Like its enclosing class, this class only survives for the lifetime of a single request (which may be a
CompositeRequest
).
Constructor Summary | |
---|---|
SimpleJpaRepository.Workspace(MapRepository repository,
String name,
long workspaceId)
|
Method Summary | |
---|---|
protected void |
addNodeToMap(MapNode node)
Adds the given node to the persistent store, replacing any node already in the persistent store with the same UUID. |
MapNode |
copyNode(ExecutionContext context,
MapNode original,
MapWorkspace newWorkspace,
MapNode newParent,
Name desiredName,
boolean recursive)
This should copy the subgraph given by the original node and place the new copy under the supplied new parent. |
protected void |
correctSameNameSiblingIndexes(ExecutionContext context,
MapNode parentNode,
Name name)
Corrects the SNS indices for all children of the node with the given name |
protected MapNode |
createMapNode(UUID uuid)
Creates an empty node with the given UUID. |
List<MapNode> |
getBranch(Location rootLocation,
int maximumDepth)
Retrieves the branch of nodes rooted at the given location using the subgraph bulk accessor method . |
MapNode |
getNode(Path path)
Find a node with the given path. |
SimpleJpaRepository.JpaNode |
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)
This connector does not support connector-level, persistent locking of nodes. |
protected void |
removeAllNodesFromMap()
Removes all of the nodes in this workspace from the persistent store with a single query. |
protected MapNode |
removeNodeFromMap(UUID nodeUuid)
Removes the node with the given UUID from the backing map, returning the node if it exists |
protected void |
removeUuidReference(MapNode node)
Removes the given node and its children from the persistent store using the subgraph bulk delete method . |
void |
unlockNode(MapNode node)
This connector does not support connector-level, persistent locking of nodes. |
Methods inherited from class org.modeshape.graph.connector.map.AbstractMapWorkspace |
---|
cloneNode, copyNode, createNode, createNode, equals, getLowestExistingPath, getName, getNode, getRepository, getRoot, getUuidsUnderNode, hashCode, initialize, moveNode, moveNodeToWorkspace, pathFor, query, removeNode, search, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SimpleJpaRepository.Workspace(MapRepository repository, String name, long workspaceId)
Method Detail |
---|
public MapNode copyNode(ExecutionContext context, MapNode original, MapWorkspace newWorkspace, MapNode newParent, Name desiredName, boolean recursive)
copyNode
in interface MapWorkspace
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 recursive
protected void correctSameNameSiblingIndexes(ExecutionContext context, MapNode parentNode, Name name)
AbstractMapWorkspace
correctSameNameSiblingIndexes
in class AbstractMapWorkspace
context
- the execution contextparentNode
- the parent nodename
- the name of the child nodes for which the SNS indices should be recalculatedprotected void addNodeToMap(MapNode node)
Invoking this method causes a database INSERT statement to execute immediately.
addNodeToMap
in class AbstractMapWorkspace
node
- the node to add to the persistent store; 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 removeUuidReference(MapNode node)
subgraph bulk delete method
.
removeUuidReference
in class AbstractMapWorkspace
node
- the root of the branch to be removedprotected MapNode createMapNode(UUID uuid)
AbstractMapWorkspace
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
protected void removeAllNodesFromMap()
removeAllNodesFromMap
in class AbstractMapWorkspace
public SimpleJpaRepository.JpaNode 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
public MapNode getNode(Path path)
AbstractMapWorkspace
getNode
in interface MapWorkspace
getNode
in class AbstractMapWorkspace
path
- the path to the node; may not be null
public List<MapNode> getBranch(Location rootLocation, int maximumDepth)
subgraph bulk accessor method
.
rootLocation
- the root of the branch of nodes to retrievemaximumDepth
- the maximum depth to retrieve; a negative number indicates that the entire branch should be
retrieved
rootLocation
public void lockNode(MapNode node, LockBranchRequest.LockScope lockScope, long lockTimeoutInMillis) throws LockFailedException
node
- lockScope
- lockTimeoutInMillis
-
LockFailedException
public void unlockNode(MapNode node)
node
- the node to be unlocked
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |