org.jboss.dna.graph.requests
Class CreateNodeRequest

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

public class CreateNodeRequest
extends Request
implements Iterable<Property>

Instruction to create the node at the specified location. This command will create the node and set the initial properties.

Author:
Randall Hauch
See Also:
Serialized Form

Field Summary
static NodeConflictBehavior DEFAULT_CONFLICT_BEHAVIOR
           
 
Constructor Summary
CreateNodeRequest(Location at, Iterable<Property> properties)
          Create a request to create a node with the given properties at the supplied location.
CreateNodeRequest(Location at, Iterator<Property> properties)
          Create a request to create a node with the given properties at the supplied location.
CreateNodeRequest(Location at, NodeConflictBehavior conflictBehavior, Iterable<Property> properties)
          Create a request to create a node with the given properties at the supplied location.
CreateNodeRequest(Location at, NodeConflictBehavior conflictBehavior, Iterator<Property> properties)
          Create a request to create a node with the given properties at the supplied location.
CreateNodeRequest(Location at, NodeConflictBehavior conflictBehavior, Property... properties)
          Create a request to create a node with the given properties at the supplied location.
CreateNodeRequest(Location at, Property... properties)
          Create a request to create a node with the given properties at the supplied location.
 
Method Summary
 Location at()
          Get the location defining the node that is to be created.
 NodeConflictBehavior conflictBehavior()
          Get the expected behavior when copying the branch and the destination already has a node with the same name.
 boolean equals(Object obj)
          
 Location getActualLocationOfNode()
          Get the actual location of the node that was created.
 boolean isReadOnly()
          Return whether this request only reads information.
 Iterator<Property> iterator()
          
 Collection<Property> properties()
          Get the properties for the node.
 void setActualLocationOfNode(Location actual)
          Sets the actual and complete location of the node being created.
 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
 

Field Detail

DEFAULT_CONFLICT_BEHAVIOR

public static final NodeConflictBehavior DEFAULT_CONFLICT_BEHAVIOR
Constructor Detail

CreateNodeRequest

public CreateNodeRequest(Location at,
                         Property... properties)
Create a request to create a node with the given properties at the supplied location.

Parameters:
at - the location of the node to be read
properties - the properties of the new node, which should not include the location's identification properties
Throws:
IllegalArgumentException - if the location is null

CreateNodeRequest

public CreateNodeRequest(Location at,
                         Iterable<Property> properties)
Create a request to create a node with the given properties at the supplied location.

Parameters:
at - the location of the node to be read
properties - the properties of the new node, which should not include the location's identification properties
Throws:
IllegalArgumentException - if the location is null

CreateNodeRequest

public CreateNodeRequest(Location at,
                         Iterator<Property> properties)
Create a request to create a node with the given properties at the supplied location.

Parameters:
at - the location of the node to be read
properties - the properties of the new node, which should not include the location's identification properties
Throws:
IllegalArgumentException - if the location is null

CreateNodeRequest

public CreateNodeRequest(Location at,
                         NodeConflictBehavior conflictBehavior,
                         Property... properties)
Create a request to create a node with the given properties at the supplied location.

Parameters:
at - the location of the node to be read
properties - the properties of the new node, which should not include the location's identification properties
conflictBehavior - the expected behavior if an equivalently-named child already exists at the into location
Throws:
IllegalArgumentException - if the location or the conflict behavior is null

CreateNodeRequest

public CreateNodeRequest(Location at,
                         NodeConflictBehavior conflictBehavior,
                         Iterable<Property> properties)
Create a request to create a node with the given properties at the supplied location.

Parameters:
at - the location of the node to be read
properties - the properties of the new node, which should not include the location's identification properties
conflictBehavior - the expected behavior if an equivalently-named child already exists at the into location
Throws:
IllegalArgumentException - if the location or the conflict behavior is null

CreateNodeRequest

public CreateNodeRequest(Location at,
                         NodeConflictBehavior conflictBehavior,
                         Iterator<Property> properties)
Create a request to create a node with the given properties at the supplied location.

Parameters:
at - the location of the node to be read
properties - the properties of the new node, which should not include the location's identification properties
conflictBehavior - the expected behavior if an equivalently-named child already exists at the into location
Throws:
IllegalArgumentException - if the location or the conflict behavior is null
Method Detail

at

public Location at()
Get the location defining the node that is to be created.

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. If the node's location has identification properties, the resulting properties will include the identification properties.

Returns:
the collection of properties; never null

conflictBehavior

public NodeConflictBehavior conflictBehavior()
Get the expected behavior when copying the branch and the destination already has a node with the same name.

Returns:
the behavior specification

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()

setActualLocationOfNode

public void setActualLocationOfNode(Location actual)
Sets the actual and complete location of the node being created. 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 created, 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 that was created.

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.