|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.graph.request.Request
org.modeshape.graph.request.CacheableRequest
org.modeshape.graph.request.ReadBranchRequest
@NotThreadSafe public class ReadBranchRequest
Instruction to read the properties and children of the nodes in the branch at the supplied location. The children of the nodes at the bottom of the branch are not read.
Field Summary | |
---|---|
static int |
DEFAULT_MAXIMUM_DEPTH
|
static int |
NO_MAXIMUM_DEPTH
|
Constructor Summary | |
---|---|
ReadBranchRequest(Location at,
String workspaceName)
Create a request to read the branch at the supplied location, to a maximum depth of 2. |
|
ReadBranchRequest(Location at,
String workspaceName,
int maxDepth)
Create a request to read the branch (of given depth) at the supplied location. |
Method Summary | |
---|---|
Location |
at()
Get the location defining the top of the branch to be read |
void |
cancel()
Cancel this request. |
boolean |
equals(Object obj)
|
Location |
getActualLocationOfNode()
Get the actual location of the node that was read. |
List<Location> |
getChildren(Location parent)
Get the children of the node at the supplied location. |
Location |
getLocationFor(Path path)
Get the location for the supplied path. |
Map<Name,Property> |
getPropertiesFor(Location location)
Get the nodes that make up this branch. |
RequestType |
getType()
Returns the type of the request |
int |
hashCode()
|
boolean |
includes(Location location)
Return whether this branch contains the specified location. |
boolean |
includes(Path path)
Return whether this branch contains the specified path. |
String |
inWorkspace()
Get the name of the workspace in which the branch exists. |
boolean |
isReadOnly()
Return whether this request only reads information. |
Iterator<Location> |
iterator()
The resulting iterator accesses the Location objects in the branch, in pre-order traversal order. |
int |
maximumDepth()
Get the maximum depth of the branch that is to be read. |
void |
setActualLocationOfNode(Location actual)
Sets the actual and complete location of the node being read. |
void |
setChildren(Location parent,
List<Location> children)
Record the children for a parent node in the branch. |
void |
setChildren(Location parent,
Location... children)
Record the children for a parent node in the branch. |
void |
setProperties(Location node,
Iterable<Property> properties)
Add a node that was read from the RepositoryConnection . |
void |
setProperties(Location node,
Property... properties)
Add a node that was read from the RepositoryConnection . |
String |
toString()
|
ReadBranchRequest |
withMaximumDepth(int maxDepth)
Obtain a copy of this request (without any results) with the new supplied maximum depth. |
Methods inherited from class org.modeshape.graph.request.CacheableRequest |
---|
getCachePolicy, getTimeLoaded, setCachePolicy, setTimeLoaded |
Methods inherited from class org.modeshape.graph.request.Request |
---|
checkNotFrozen, freeze, getError, hasError, isCancelled, isFrozen, printable, printable, setError, setLatchForFreezing |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_MAXIMUM_DEPTH
public static final int NO_MAXIMUM_DEPTH
Constructor Detail |
---|
public ReadBranchRequest(Location at, String workspaceName)
at
- the location of the branchworkspaceName
- the name of the workspace containing the parent
IllegalArgumentException
- if the location or workspace name is nullpublic ReadBranchRequest(Location at, String workspaceName, int maxDepth)
at
- the location of the branchworkspaceName
- the name of the workspace containing the branchmaxDepth
- the maximum depth to read
IllegalArgumentException
- if the location or workspace name is null or if the maximum depth is not positiveMethod Detail |
---|
public boolean isReadOnly()
isReadOnly
in class Request
Request.isReadOnly()
public Location at()
public String inWorkspace()
public int maximumDepth()
public boolean includes(Location location)
location
- the location
public boolean includes(Path path)
path
- the path
public Location getLocationFor(Path path)
path
- the path
public void setProperties(Location node, Property... properties)
RepositoryConnection
. This method does not verify or check that the node is
indeed on the branch and that it is at a level prescribed by the request.
node
- the location of the node that appears on this branch; must have a path
properties
- the properties on the node
IllegalArgumentException
- if the node is null
IllegalStateException
- if the request is frozenpublic void setProperties(Location node, Iterable<Property> properties)
RepositoryConnection
. This method does not verify or check that the node is
indeed on the branch and that it is at a level prescribed by the request.
node
- the location of the node that appears on this branch; must have a path
properties
- the properties on the node
IllegalArgumentException
- if the node is null
IllegalStateException
- if the request is frozenpublic void setChildren(Location parent, Location... children)
parent
- the location of the parent; must have a path
children
- the location of each child, in the order they appear in the parent
IllegalStateException
- if the request is frozenpublic void setChildren(Location parent, List<Location> children)
parent
- the location of the parent; must have a path
children
- the location of each child, in the order they appear in the parent
IllegalStateException
- if the request is frozenpublic Map<Name,Property> getPropertiesFor(Location location)
added
.
location
- the location of the node for which the properties are to be obtained
iterator()
public List<Location> getChildren(Location parent)
parent
- the location of the parent
public Iterator<Location> iterator()
The resulting iterator accesses the Location
objects in the branch, in pre-order traversal order.
iterator
in interface Iterable<Location>
Iterable.iterator()
public void setActualLocationOfNode(Location actual)
path
.
actual
- the actual location of the node being read, or null if the current location
should be used
IllegalArgumentException
- if the actual location is null or does not have a pathpublic Location getActualLocationOfNode()
public void cancel()
cancellation flag
is set, and any current or
future processing of the request may be affected by the cancellation. (Note however, that processors may choose to not
respect this request.)
This method is safe to be called by different threads.
cancel
in class Request
Request.cancel()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public String toString()
toString
in class Object
Object.toString()
public RequestType getType()
Request
getType
in class Request
public ReadBranchRequest withMaximumDepth(int maxDepth)
maxDepth
- the maximum depth for the new request
IllegalArgumentException
- if the maximum depth is not positive
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |