|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.modeshape.graph.connector.path.AbstractWritablePathWorkspace
public abstract class AbstractWritablePathWorkspace
Implementation of some methods from WritablePathWorkspace
to assist in the development of path-based connectors.
Subclasses of this class should be made thread-safe.
Field Summary | |
---|---|
protected UUID |
rootNodeUuid
|
Constructor Summary | |
---|---|
AbstractWritablePathWorkspace(String name,
UUID rootNodeUuid)
|
Method Summary | |
---|---|
PathNode |
copyNode(ExecutionContext context,
PathNode original,
PathWorkspace originalWorkspace,
PathNode newParent,
Name desiredName,
boolean recursive)
This should copy the subgraph rooted at the original node and place the new copy under the supplied new parent. |
PathNode |
createNode(ExecutionContext context,
String pathToNewNode,
Map<Name,Property> properties,
NodeConflictBehavior conflictBehavior)
Create a node at the supplied path. |
String |
getName()
Returns the name of the workspace. |
void |
lockNode(PathNode node,
LockBranchRequest.LockScope lockScope,
long lockTimeoutInMillis)
Attempts to lock the given node with the given timeout. |
PathNode |
moveNode(ExecutionContext context,
PathNode node,
Name desiredNewName,
WritablePathWorkspace originalWorkspace,
PathNode newParent,
PathNode beforeNode)
Move the supplied node to the new parent within this workspace. |
QueryResults |
query(ExecutionContext context,
AccessQueryRequest accessQuery)
Perform a query of this workspace. |
PathNode |
removeProperties(ExecutionContext context,
Path nodePath,
Iterable<Name> propertyNames)
Removes the properties with the given names |
QueryResults |
search(ExecutionContext context,
String fullTextSearchExpression)
Perform a full-text search of this workspace. |
void |
unlockNode(PathNode node)
Attempts to unlock the given node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.modeshape.graph.connector.path.WritablePathWorkspace |
---|
createNode, removeNode, setProperties |
Methods inherited from interface org.modeshape.graph.connector.path.PathWorkspace |
---|
getLowestExistingPath, getNode |
Field Detail |
---|
protected final UUID rootNodeUuid
Constructor Detail |
---|
public AbstractWritablePathWorkspace(String name, UUID rootNodeUuid)
Method Detail |
---|
public PathNode copyNode(ExecutionContext context, PathNode original, PathWorkspace originalWorkspace, PathNode newParent, Name desiredName, boolean recursive)
copyNode
in interface WritablePathWorkspace
context
- the context; may not be nulloriginal
- the node to be copied; may not be nulloriginalWorkspace
- the workspace containing the original 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
public PathNode createNode(ExecutionContext context, String pathToNewNode, Map<Name,Property> properties, NodeConflictBehavior conflictBehavior)
WritablePathWorkspace
createNode
in interface WritablePathWorkspace
context
- the environment; may not be nullpathToNewNode
- the path to the new node; may not be nullproperties
- the properties for the new nodeconflictBehavior
- the expected behavior if an equivalently-named child already exists at the location
public PathNode moveNode(ExecutionContext context, PathNode node, Name desiredNewName, WritablePathWorkspace originalWorkspace, PathNode newParent, PathNode beforeNode)
WritablePathWorkspace
index
to be correct in the new parent.
moveNode
in interface WritablePathWorkspace
node
- the node to be moved; may not be the workspace root nodedesiredNewName
- the new name for the node, if it is to be changed; may be nulloriginalWorkspace
- the workspace containing the node to be movednewParent
- the new parent; may not be the workspace root nodebeforeNode
- the node before which this new node should be placed
node
that reflects the new locationpublic PathNode removeProperties(ExecutionContext context, Path nodePath, Iterable<Name> propertyNames)
WritablePathWorkspace
removeProperties
in interface WritablePathWorkspace
context
- the context; may not be nullnodePath
- the path to the node from which the properties should be removedpropertyNames
- the name of the properties to remove
public QueryResults query(ExecutionContext context, AccessQueryRequest accessQuery)
PathWorkspace
query
in interface PathWorkspace
context
- the context in which the query is to be executed; may not be nullaccessQuery
- the access query; may not be null
public QueryResults search(ExecutionContext context, String fullTextSearchExpression)
PathWorkspace
search
in interface PathWorkspace
context
- the context in which the query is to be executed; may not be nullfullTextSearchExpression
- the full-text search expression; may not be null
public String getName()
PathWorkspace
getName
in interface PathWorkspace
public void lockNode(PathNode node, LockBranchRequest.LockScope lockScope, long lockTimeoutInMillis) throws LockFailedException
PathWorkspace
LockFailedException
will be
thrown.
lockNode
in interface PathWorkspace
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(PathNode node)
PathWorkspace
unlockNode
in interface PathWorkspace
node
- the node to be unlocked; may not be null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |