org.jboss.dna.graph.commands.basic
Class BasicGetChildrenCommand

java.lang.Object
  extended by org.jboss.dna.graph.commands.basic.BasicGraphCommand
      extended by org.jboss.dna.graph.commands.basic.BasicGetChildrenCommand
All Implemented Interfaces:
Serializable, Cacheable, ActsOnPath, GetChildrenCommand, GraphCommand
Direct Known Subclasses:
BasicGetNodeCommand

@NotThreadSafe
public class BasicGetChildrenCommand
extends BasicGraphCommand
implements GetChildrenCommand

Author:
Randall Hauch
See Also:
Serialized Form

Constructor Summary
BasicGetChildrenCommand(Path path)
           
 
Method Summary
 void addChild(Path.Segment nameOfChild, Property... identityProperties)
          Add the child to this node.
 CachePolicy getCachePolicy()
          Get the caching policy to be used for this object.
 Property[] getChildIdentityProperties(Path.Segment child)
          Get the identity properties for the supplied child.
 List<Path.Segment> getChildren()
           
 Path getPath()
          Get the path to which this command applies.
 DateTime getTimeLoaded()
          Get the time that this node data was originally loaded.
 void setCachePolicy(CachePolicy cachePolicy)
          Set the caching policy for this object.
 void setNoChildren()
          Set that this node has no children.
 void setTimeLoaded(DateTime timeLoaded)
           
 String toString()
          
 
Methods inherited from class org.jboss.dna.graph.commands.basic.BasicGraphCommand
getError, hasError, hasNoError, isCancelled, setCancelled, setError
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.dna.graph.commands.GraphCommand
getError, hasError, hasNoError, isCancelled, setError
 

Constructor Detail

BasicGetChildrenCommand

public BasicGetChildrenCommand(Path path)
Parameters:
path - the path to the node; may not be null
Method Detail

setNoChildren

public void setNoChildren()
Set that this node has no children. Any existing child references already set on this command will be removed.

Specified by:
setNoChildren in interface GetChildrenCommand

addChild

public void addChild(Path.Segment nameOfChild,
                     Property... identityProperties)
Add the child to this node. This method does not affect existing children, so callers of this method should not add a child with the same segment as an existing child (this is not checked by this method).

Specified by:
addChild in interface GetChildrenCommand
Parameters:
nameOfChild - the name of the child; should not be the same as an existing child (not checked)
identityProperties - the property/properties that are considered identity properties (other than the name) for the child
See Also:
GetChildrenCommand.addChild(org.jboss.dna.graph.properties.Path.Segment, org.jboss.dna.graph.properties.Property[])

getChildIdentityProperties

public Property[] getChildIdentityProperties(Path.Segment child)
Get the identity properties for the supplied child.

Parameters:
child - the name of the child
Returns:
the array of identity properties for the child, or null if there are none

getChildren

public List<Path.Segment> getChildren()
Returns:
children

getPath

public Path getPath()
Get the path to which this command applies. If the path does not exist, an PathNotFoundException exception should be recorded as an error.

Specified by:
getPath in interface ActsOnPath
Returns:
the path; never null

getCachePolicy

public CachePolicy getCachePolicy()
Get the caching policy to be used for this object.

Note that the values of the policy are relative to the time the node was loaded, so the same instance can be used for many nodes.

Specified by:
getCachePolicy in interface Cacheable
Returns:
cachePolicy the caching policy, which may not be null

getTimeLoaded

public DateTime getTimeLoaded()
Get the time that this node data was originally loaded.

Specified by:
getTimeLoaded in interface Cacheable
Returns:
the system time (in milliseconds) that the node data was loaded

setTimeLoaded

public void setTimeLoaded(DateTime timeLoaded)
Parameters:
timeLoaded - Sets timeLoaded to the specified value.

setCachePolicy

public void setCachePolicy(CachePolicy cachePolicy)
Set the caching policy for this object.

Specified by:
setCachePolicy in interface Cacheable
Parameters:
cachePolicy - the caching policy to use for this 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.