org.jboss.dna.graph.commands.basic
Class BasicMoveBranchCommand

java.lang.Object
  extended by org.jboss.dna.graph.commands.basic.BasicGraphCommand
      extended by org.jboss.dna.graph.commands.basic.BasicMoveBranchCommand
All Implemented Interfaces:
ActsAsUpdate, ActsOnPath, GraphCommand, MoveBranchCommand

@NotThreadSafe
public class BasicMoveBranchCommand
extends BasicGraphCommand
implements MoveBranchCommand

Author:
Randall Hauch

Constructor Summary
BasicMoveBranchCommand(Path oldPath, Path newPath, NodeConflictBehavior conflictBehavior)
           
 
Method Summary
 NodeConflictBehavior getConflictBehavior()
          Get the desired behavior when a node at the target path already exists.
 Path getNewPath()
          Get the new path to which the branch is to be moved.
 Path getPath()
          Get the path to which this command applies.
 String toString()
          
 
Methods inherited from class org.jboss.dna.graph.commands.basic.BasicGraphCommand
getError, hasError, hasNoError, isCancelled, setCancelled, setError
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.dna.graph.commands.GraphCommand
getError, hasError, hasNoError, isCancelled, setError
 

Constructor Detail

BasicMoveBranchCommand

public BasicMoveBranchCommand(Path oldPath,
                              Path newPath,
                              NodeConflictBehavior conflictBehavior)
Parameters:
oldPath - the path to the original; may not be null
newPath - the path to the new location; may not be null
conflictBehavior - the desired behavior when a node exists at the path; may not be null
Method Detail

getPath

public Path getPath()
Get the path to which this command applies. If the path does not exist, an PathNotFoundException exception should be recorded as an error.

Specified by:
getPath in interface ActsOnPath
Returns:
the path; never null

getNewPath

public Path getNewPath()
Get the new path to which the branch is to be moved.

Specified by:
getNewPath in interface MoveBranchCommand
Returns:
the new path; never null

getConflictBehavior

public NodeConflictBehavior getConflictBehavior()
Get the desired behavior when a node at the target path already exists.

Specified by:
getConflictBehavior in interface MoveBranchCommand
Returns:
the desired behavior; never null

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.