org.jboss.dna.graph.requests
Class ReadAllChildrenRequest

java.lang.Object
  extended by org.jboss.dna.graph.requests.Request
      extended by org.jboss.dna.graph.requests.CacheableRequest
          extended by org.jboss.dna.graph.requests.ReadAllChildrenRequest
All Implemented Interfaces:
Serializable, Iterable<Location>, Cacheable

public class ReadAllChildrenRequest
extends CacheableRequest
implements Iterable<Location>

Instruction to read all of the children of a node at a specific location.

Author:
Randall Hauch
See Also:
Serialized Form

Constructor Summary
ReadAllChildrenRequest(Location of)
          Create a request to read the children of a node at the supplied location.
 
Method Summary
 void addChild(Location child)
          Add to the list of children that has been read the child with the given path and identification properties.
 void addChild(Path pathToChild, Property idProperty)
          Add to the list of children that has been read the child with the given path and identification property.
 void addChild(Path pathToChild, Property firstIdProperty, Property... remainingIdProperties)
          Add to the list of children that has been read the child with the given path and identification properties.
 boolean equals(Object obj)
          
 Location getActualLocationOfNode()
          Get the actual location of the node whose children were read.
 List<Location> getChildren()
          Get the children that were read from the RepositoryConnection after the request was processed.
 boolean isReadOnly()
          Return whether this request only reads information.
 Iterator<Location> iterator()
          
 Location of()
          Get the location defining the node whose children are to be read.
 void setActualLocationOfNode(Location actual)
          Sets the actual and complete location of the node whose children have been read.
 String toString()
          
 
Methods inherited from class org.jboss.dna.graph.requests.CacheableRequest
getCachePolicy, getTimeLoaded, setCachePolicy, setTimeLoaded
 
Methods inherited from class org.jboss.dna.graph.requests.Request
cancel, getError, hasError, isCancelled, setError
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReadAllChildrenRequest

public ReadAllChildrenRequest(Location of)
Create a request to read the children of a node at the supplied location.

Parameters:
of - the location of the node whose children are to be read
Throws:
IllegalArgumentException - if the location is null
Method Detail

isReadOnly

public boolean isReadOnly()
Return whether this request only reads information.

Specified by:
isReadOnly in class Request
Returns:
true if this request reads information, or false if it requests that the repository content be changed in some way
See Also:
Request.isReadOnly()

of

public Location of()
Get the location defining the node whose children are to be read.

Returns:
the location of the parent node; never null

getChildren

public List<Location> getChildren()
Get the children that were read from the RepositoryConnection after the request was processed. Each child is represented by a location.

Returns:
the children that were read; never null

iterator

public Iterator<Location> iterator()

Specified by:
iterator in interface Iterable<Location>
See Also:
Iterable.iterator()

addChild

public void addChild(Location child)
Add to the list of children that has been read the child with the given path and identification properties. The children should be added in order.

Parameters:
child - the location of the child that was read
Throws:
IllegalArgumentException - if the location is null
See Also:
addChild(Path, Property), addChild(Path, Property, Property...)

addChild

public void addChild(Path pathToChild,
                     Property firstIdProperty,
                     Property... remainingIdProperties)
Add to the list of children that has been read the child with the given path and identification properties. The children should be added in order.

Parameters:
pathToChild - the path of the child that was just read
firstIdProperty - the first identification property of the child that was just read
remainingIdProperties - the remaining identification properties of the child that was just read
Throws:
IllegalArgumentException - if the path or identification properties are null
See Also:
addChild(Location), addChild(Path, Property)

addChild

public void addChild(Path pathToChild,
                     Property idProperty)
Add to the list of children that has been read the child with the given path and identification property. The children should be added in order.

Parameters:
pathToChild - the path of the child that was just read
idProperty - the identification property of the child that was just read
Throws:
IllegalArgumentException - if the path or identification properties are null
See Also:
addChild(Location), addChild(Path, Property, Property...)

setActualLocationOfNode

public void setActualLocationOfNode(Location actual)
Sets the actual and complete location of the node whose children have been read. This method must be called when processing the request, and the actual location must have a path.

Parameters:
actual - the actual location of the node being read, or null if the current location should be used
Throws:
IllegalArgumentException - if the actual location does not represent the same location as the current location, or if the actual location does not have a path.

getActualLocationOfNode

public Location getActualLocationOfNode()
Get the actual location of the node whose children were read.

Returns:
the actual location, or null if the actual location was not set

equals

public boolean equals(Object obj)

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2008-Present JBoss a division of Red Hat. All Rights Reserved.