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

java.lang.Object
  extended by org.jboss.dna.graph.commands.basic.BasicGraphCommand
      extended by org.jboss.dna.graph.commands.basic.BasicGetPropertiesCommand
All Implemented Interfaces:
Serializable, Cacheable, ActsOnPath, GetPropertiesCommand, GraphCommand

@NotThreadSafe
public class BasicGetPropertiesCommand
extends BasicGraphCommand
implements GetPropertiesCommand

Author:
Randall Hauch
See Also:
Serialized Form

Constructor Summary
BasicGetPropertiesCommand(Path path)
           
 
Method Summary
 CachePolicy getCachePolicy()
          Get the caching policy to be used for this object.
 Path getPath()
          Get the path to which this command applies.
 Iterable<Property> getProperties()
          Get the property values that were added to the command
 Map<Name,Property> getPropertiesByName()
           
 DateTime getTimeLoaded()
          Get the time that this node data was originally loaded.
 void setCachePolicy(CachePolicy cachePolicy)
          Set the caching policy for this object.
 void setProperties(Map<Name,Property> properties)
           
 void setProperty(Property property)
          Set the values for the named property.
 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

BasicGetPropertiesCommand

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

setProperty

public void setProperty(Property property)
Set the values for the named property. Any existing property values, if previously set, will be overwritten. If there are no property vlaues or if all of the property values are null, the property will be removed.

Specified by:
setProperty in interface GetPropertiesCommand
Parameters:
property - the property

setProperties

public void setProperties(Map<Name,Property> properties)

getProperties

public Iterable<Property> getProperties()
Get the property values that were added to the command

Returns:
the map of property name to values

getPropertiesByName

public Map<Name,Property> getPropertiesByName()

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.