org.jboss.dna.graph.requests
Class UpdatePropertiesRequest

java.lang.Object
  extended by org.jboss.dna.graph.requests.Request
      extended by org.jboss.dna.graph.requests.UpdatePropertiesRequest
All Implemented Interfaces:
Serializable, Iterable<Property>

public class UpdatePropertiesRequest
extends Request
implements Iterable<Property>

Instruction to update the properties on the node at the specified location. Any property with no values will be removed.

Author:
Randall Hauch
See Also:
Serialized Form

Constructor Summary
UpdatePropertiesRequest(Location on, Iterable<Property> properties)
          Create a request to update the properties on the node at the supplied location.
UpdatePropertiesRequest(Location on, Iterator<Property> properties)
          Create a request to update the properties on the node at the supplied location.
UpdatePropertiesRequest(Location on, Property... properties)
          Create a request to update the properties on the node at the supplied location.
 
Method Summary
 boolean equals(Object obj)
          
 Location getActualLocationOfNode()
          Get the actual location of the node that was updated.
 boolean isReadOnly()
          Return whether this request only reads information.
 Iterator<Property> iterator()
          
 Location on()
          Get the location defining the node that is to be updated.
 Collection<Property> properties()
          Get the properties for the node.
 void setActualLocationOfNode(Location actual)
          Sets the actual and complete location of the node being updated.
 String toString()
          
 
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

UpdatePropertiesRequest

public UpdatePropertiesRequest(Location on,
                               Property... properties)
Create a request to update the properties on the node at the supplied location.

Parameters:
on - the location of the node to be read
properties - the new properties on the node
Throws:
IllegalArgumentException - if the location is null or if there are no properties to update

UpdatePropertiesRequest

public UpdatePropertiesRequest(Location on,
                               Iterable<Property> properties)
Create a request to update the properties on the node at the supplied location.

Parameters:
on - the location of the node to be read
properties - the new properties on the node
Throws:
IllegalArgumentException - if the location is null or if there are no properties to update

UpdatePropertiesRequest

public UpdatePropertiesRequest(Location on,
                               Iterator<Property> properties)
Create a request to update the properties on the node at the supplied location.

Parameters:
on - the location of the node to be read
properties - the new properties on the node
Throws:
IllegalArgumentException - if the location is null or if there are no properties to update
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 updated.

Returns:
the location of the node; never null

iterator

public Iterator<Property> iterator()

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

properties

public Collection<Property> properties()
Get the properties for the node.

Returns:
the collection of properties; never null and never empty

setActualLocationOfNode

public void setActualLocationOfNode(Location actual)
Sets the actual and complete location of the node being updated. 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 updated, or null if the current location should be used
Throws:
IllegalArgumentException - if the actual location does 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 that was updated.

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.