|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MapWorkspace
The MapWorkspace
defines the required methods for workspaces in a map repository
. By default, a
map repository supports multiple workspaces, each equating logically to a map of UUIDs to map nodes
.
As each map node (except the root-node for the workspace) has a non-null parent and a set of children, the map
nodes
naturally construct a tree within the workspace.
Method Summary | |
---|---|
MapNode |
cloneNode(ExecutionContext context,
MapNode original,
MapWorkspace newWorkspace,
MapNode newParent,
Name desiredName,
Path.Segment desiredSegment,
boolean removeExisting,
Set<Location> removedExistingNodes)
This should clone the subgraph given by the original node and place the cloned copy under the supplied new parent. |
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. |
MapNode |
createNode(ExecutionContext context,
MapNode parentNode,
Name name,
UUID uuid,
Iterable<Property> properties)
Create a new node with the supplied name, as a child of the supplied parent. |
MapNode |
createNode(ExecutionContext context,
String pathToNewNode,
Iterable<Property> properties)
Create a node at the supplied path. |
Path |
getLowestExistingPath(Path path)
Find the lowest existing node along the path. |
String |
getName()
Returns the name of the workspace. |
MapNode |
getNode(Path path)
Returns the node at the given path, if one exists of null if no exists at the given path. |
MapNode |
getNode(UUID uuid)
Returns the node with the given UUID, if one exists or null if no with the given UUID
exists in the workspace. |
MapNode |
getRoot()
Returns the root node in the workspace. |
void |
lockNode(MapNode node,
LockBranchRequest.LockScope lockScope,
long lockTimeoutInMillis)
Attempts to lock the given node with the given timeout. |
void |
moveNode(ExecutionContext context,
MapNode node,
Name desiredNewName,
MapWorkspace newWorkspace,
MapNode newParent,
MapNode beforeNode)
Move the supplied node to the new parent. |
Path |
pathFor(PathFactory pathFactory,
MapNode node)
Returns the path for the given node with this workspace if one exists, or a null if no node exists at the given
path. |
QueryResults |
query(ExecutionContext context,
AccessQueryRequest accessQuery)
Perform a query of this workspace. |
boolean |
removeNode(ExecutionContext context,
MapNode node)
Removes the given node. |
QueryResults |
search(ExecutionContext context,
String fullTextSearchExpression)
Perform a full-text search of this workspace. |
void |
unlockNode(MapNode node)
Attempts to unlock the given node. |
Method Detail |
---|
String getName()
MapNode getRoot()
map node
where node.getParent() == null
and
node.getUuid() == repository.getRootNodeUuid()
.
MapNode getNode(UUID uuid)
null
if no with the given UUID
exists in the workspace.
That is, node == null || node.getUuid().equals(uuid)
for the returned node.
uuid
- the UUID of the node to be retrieved; may not be null
null
if no with the given UUID
exists in the workspace.MapNode getNode(Path path)
null
if no exists at the given path.
path
- the path of the node to retrieve; may not be null
null
if no exists at the given path.boolean removeNode(ExecutionContext context, MapNode node)
context
- the current execution context; may not be nullnode
- the node to be removed; may not be null
MapNode createNode(ExecutionContext context, String pathToNewNode, Iterable<Property> properties)
context
- the environment; may not be nullpathToNewNode
- the path to the new node; may not be nullproperties
- the properties for the new node
MapNode createNode(ExecutionContext context, MapNode parentNode, Name name, UUID uuid, Iterable<Property> properties)
context
- the execution contextparentNode
- the parent node; may not be nullname
- the name; may not be nulluuid
- the UUID of the node, or null if the UUID is to be generatedproperties
- the properties for the new node
void moveNode(ExecutionContext context, MapNode node, Name desiredNewName, MapWorkspace newWorkspace, MapNode newParent, MapNode beforeNode)
index
to be correct in the new parent.
context
- node
- the node to be moved; may not be the root
desiredNewName
- the new name for the node, if it is to be changed; may be nullnewWorkspace
- the workspace containing the new parent nodenewParent
- the new parent; may not be the root
beforeNode
- the node before which this new node should be placedMapNode copyNode(ExecutionContext context, MapNode original, MapWorkspace newWorkspace, MapNode newParent, Name desiredName, boolean recursive)
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
MapNode cloneNode(ExecutionContext context, MapNode original, MapWorkspace newWorkspace, MapNode newParent, Name desiredName, Path.Segment desiredSegment, boolean removeExisting, Set<Location> removedExistingNodes) throws UuidAlreadyExistsException
context
- the context; may not be nulloriginal
- the node to be cloned; may not be nullnewWorkspace
- the workspace containing the new parent node; may not be nullnewParent
- the parent where the clone is to be placed; may not be nulldesiredName
- the desired name for the node; if null, the name will be calculated from desiredSegment
; Exactly
one of desiredSegment
and desiredName
must be non-nulldesiredSegment
- the exact segment at which the clone should be rooted; if null, the name will be inferred from
desiredName
; Exactly one of desiredSegment
and desiredName
must be non-nullremoveExisting
- true if existing nodes in the new workspace with the same UUIDs as nodes in the branch rooted at
original
should be removed; if false, a UuidAlreadyExistsException will be thrown if a UUID conflict is
detectedremovedExistingNodes
- the set into which should be placed all of the existing nodes that were removed as a result of
this clone operation, or null if these nodes need not be collected
UuidAlreadyExistsException
- if removeExisting
is true and and a UUID in the source tree already exists in
the new workspacevoid lockNode(MapNode node, LockBranchRequest.LockScope lockScope, long lockTimeoutInMillis) throws LockFailedException
LockFailedException
will be
thrown.
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.void unlockNode(MapNode node)
node
- the node to be unlocked; may not be nullPath getLowestExistingPath(Path path)
path
- the path to the node; may not be null
Path pathFor(PathFactory pathFactory, MapNode node)
null
if no node exists at the given
path.
pathFactory
- the path factory to use to construct the path; may not be nullnode
- the node for which the path should be retrieved; may not be null
QueryResults query(ExecutionContext context, AccessQueryRequest accessQuery)
context
- the context in which the query is to be executed; may not be nullaccessQuery
- the access query; may not be null
QueryResults search(ExecutionContext context, String fullTextSearchExpression)
context
- the context in which the query is to be executed; may not be nullfullTextSearchExpression
- the full-text search expression; may not be null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |