org.jboss.dna.graph.request
Class ReadPropertyRequest

java.lang.Object
  extended by org.jboss.dna.graph.request.Request
      extended by org.jboss.dna.graph.request.CacheableRequest
          extended by org.jboss.dna.graph.request.ReadPropertyRequest
All Implemented Interfaces:
Serializable, Cacheable

public class ReadPropertyRequest
extends CacheableRequest

Instruction to read a single property on the node at the specified location.

See Also:
Serialized Form

Constructor Summary
ReadPropertyRequest(Location on, String workspaceName, Name propertyName)
          Create a request to read the properties and number of children of a node at the supplied location.
 
Method Summary
 void cancel()
          Cancel this request.
 boolean equals(Object obj)
          
 Location getActualLocationOfNode()
          Get the actual location of the node whose property was read.
 Property getProperty()
          Get the property that was read.
 int hashCode()
          
 String inWorkspace()
          Get the name of the workspace in which the node exists.
 boolean isReadOnly()
          Return whether this request only reads information.
 Name named()
          Get the name of the property that is to be read
 Location on()
          Get the location defining the node that is to be read.
 void setActualLocationOfNode(Location actual)
          Sets the actual and complete location of the node whose property has been read.
 void setProperty(Property property)
          Set the property on the node as read from the RepositoryConnection
 String toString()
          
 
Methods inherited from class org.jboss.dna.graph.request.CacheableRequest
getCachePolicy, getTimeLoaded, setCachePolicy, setTimeLoaded
 
Methods inherited from class org.jboss.dna.graph.request.Request
freeze, getError, hasError, isCancelled, isFrozen, setError, setLatchForFreezing
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReadPropertyRequest

public ReadPropertyRequest(Location on,
                           String workspaceName,
                           Name propertyName)
Create a request to read the properties and number of children of a node at the supplied location.

Parameters:
on - the location of the node to be read
workspaceName - the name of the workspace containing the node
propertyName - the name of the property to read
Throws:
IllegalArgumentException - if the location, workspace name, or property name are 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()

on

public Location on()
Get the location defining the node that is to be read.

Returns:
the location of the node; never null

inWorkspace

public String inWorkspace()
Get the name of the workspace in which the node exists.

Returns:
the name of the workspace; never null

named

public Name named()
Get the name of the property that is to be read

Returns:
the property name; never null

getProperty

public Property getProperty()
Get the property that was read.

Returns:
the property, or null if the property was not read or did not exist on the node

setProperty

public void setProperty(Property property)
Set the property on the node as read from the RepositoryConnection

Parameters:
property - the property that was read
Throws:
IllegalArgumentException - if the property's name does not match the name of the property that was to be read
IllegalStateException - if the request is frozen

setActualLocationOfNode

public void setActualLocationOfNode(Location actual)
Sets the actual and complete location of the node whose property has 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.
IllegalStateException - if the request is frozen

getActualLocationOfNode

public Location getActualLocationOfNode()
Get the actual location of the node whose property was read.

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

cancel

public void cancel()
Cancel this request. After this method is called, the 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.

Overrides:
cancel in class Request
See Also:
Request.cancel()

hashCode

public int hashCode()

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

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-2009 JBoss, a division of Red Hat. All Rights Reserved.