org.jboss.dna.graph.requests
Class MoveBranchRequest

java.lang.Object
  extended by org.jboss.dna.graph.requests.Request
      extended by org.jboss.dna.graph.requests.MoveBranchRequest
All Implemented Interfaces:
Serializable

public class MoveBranchRequest
extends Request

Instruction that a branch be moved from one location into another.

Author:
Randall Hauch
See Also:
Serialized Form

Field Summary
static NodeConflictBehavior DEFAULT_CONFLICT_BEHAVIOR
           
 
Constructor Summary
MoveBranchRequest(Location from, Location into)
          Create a request to move a branch from one location into another.
MoveBranchRequest(Location from, Location into, NodeConflictBehavior conflictBehavior)
          Create a request to move a branch from one location into another.
 
Method Summary
 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 from()
          Get the location defining the top of the branch to be moved
 Location getActualLocationAfter()
          Get the actual location of the node after being moved.
 Location getActualLocationBefore()
          Get the actual location of the node before being moved.
 Location into()
          Get the location defining the parent where the branch is to be placed
 boolean isReadOnly()
          Return whether this request only reads information.
 void setActualLocations(Location oldLocation, Location newLocation)
          Sets the actual and complete location of the node being renamed and its new location.
 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

MoveBranchRequest

public MoveBranchRequest(Location from,
                         Location into)
Create a request to move a branch from one location into another.

Parameters:
from - the location of the top node in the existing branch that is to be moved
into - the location of the existing node into which the branch should be moved
Throws:
IllegalArgumentException - if from or into are null

MoveBranchRequest

public MoveBranchRequest(Location from,
                         Location into,
                         NodeConflictBehavior conflictBehavior)
Create a request to move a branch from one location into another.

Parameters:
from - the location of the top node in the existing branch that is to be moved
into - the location of the existing node into which the branch should be moved
conflictBehavior - the expected behavior if an equivalently-named child already exists at the into location
Throws:
IllegalArgumentException - if any of the parameters are null
Method Detail

from

public Location from()
Get the location defining the top of the branch to be moved

Returns:
the from location; never null

into

public Location into()
Get the location defining the parent where the branch is to be placed

Returns:
the to location; 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()

setActualLocations

public void setActualLocations(Location oldLocation,
                               Location newLocation)
Sets the actual and complete location of the node being renamed and its new location. This method must be called when processing the request, and the actual location must have a path.

Parameters:
oldLocation - the actual location of the node before being renamed
newLocation - the actual location of the node after being renamed
Throws:
IllegalArgumentException - if the either location is null, if the old location does not represent the same location as the from location, if the new location does not represent the same location as the into location, or if the either location does not have a path

getActualLocationBefore

public Location getActualLocationBefore()
Get the actual location of the node before being moved.

Returns:
the actual location of the node before being moved, or null if the actual location was not set

getActualLocationAfter

public Location getActualLocationAfter()
Get the actual location of the node after being moved.

Returns:
the actual location of the node after being moved, 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.