org.jboss.dna.graph.requests
Class RemovePropertiesRequest

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

public class RemovePropertiesRequest
extends Request
implements Iterable<Name>

Instruction to remove properties from the node at the specified location.

Author:
Randall Hauch
See Also:
Serialized Form

Constructor Summary
RemovePropertiesRequest(Location from, Iterable<Name> propertyNames)
          Create a request to remove the properties with the given names from the node at the supplied location.
RemovePropertiesRequest(Location from, Iterator<Name> propertyNames)
          Create a request to remove the properties with the given names from the node at the supplied location.
RemovePropertiesRequest(Location from, Name... propertyNames)
          Create a request to remove the properties with the given names from the node at the supplied location.
 
Method Summary
 boolean equals(Object obj)
          
 Location from()
          Get the location defining the node from which the properties are to be removed.
 Location getActualLocationOfNode()
          Get the actual location of the node whose properties were removed.
 boolean isReadOnly()
          Return whether this request only reads information.
 Iterator<Name> iterator()
          
 Collection<Name> propertyNames()
          Get the names of the properties that are to be removed from the node.
 void setActualLocationOfNode(Location actual)
          Sets the actual and complete location of the node whose properties were removed.
 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

RemovePropertiesRequest

public RemovePropertiesRequest(Location from,
                               Name... propertyNames)
Create a request to remove the properties with the given names from the node at the supplied location.

Parameters:
from - the location of the node to be read
propertyNames - the names of the properties to be removed from the node
Throws:
IllegalArgumentException - if the location is null or if there are no properties to remove

RemovePropertiesRequest

public RemovePropertiesRequest(Location from,
                               Iterable<Name> propertyNames)
Create a request to remove the properties with the given names from the node at the supplied location.

Parameters:
from - the location of the node to be read
propertyNames - the names of the properties to be removed from the node
Throws:
IllegalArgumentException - if the location is null or if there are no properties to remove

RemovePropertiesRequest

public RemovePropertiesRequest(Location from,
                               Iterator<Name> propertyNames)
Create a request to remove the properties with the given names from the node at the supplied location.

Parameters:
from - the location of the node to be read
propertyNames - the names of the properties to be removed from the node
Throws:
IllegalArgumentException - if the location is null or if there are no properties to remove
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()

from

public Location from()
Get the location defining the node from which the properties are to be removed.

Returns:
the location of the node; never null

iterator

public Iterator<Name> iterator()

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

propertyNames

public Collection<Name> propertyNames()
Get the names of the properties that are to be removed from the node.

Returns:
the collection of property names; never null and never empty

setActualLocationOfNode

public void setActualLocationOfNode(Location actual)
Sets the actual and complete location of the node whose properties were removed. 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 changed, 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 properties were removed.

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.