org.jboss.dna.graph.request
Class DeleteBranchRequest

java.lang.Object
  extended by org.jboss.dna.graph.request.Request
      extended by org.jboss.dna.graph.request.DeleteBranchRequest
All Implemented Interfaces:
Serializable, ChangeRequest

public class DeleteBranchRequest
extends Request
implements ChangeRequest

Instruction that a branch be deleted.

Author:
Randall Hauch
See Also:
Serialized Form

Constructor Summary
DeleteBranchRequest(Location at, String workspaceName)
          Create a request to delete a branch.
 
Method Summary
 Location at()
          Get the location defining the top of the branch to be deleted
 Location changedLocation()
          Get the location of the top-most node that is to be changed by this request.
 boolean changes(String workspace, Path path)
          Determine if this request changes the branch at the given path.
 boolean equals(Object obj)
          
 Location getActualLocationOfNode()
          Get the actual location of the node that was deleted.
 String inWorkspace()
          Get the name of the workspace in which the branch exists.
 boolean isReadOnly()
          Return whether this request only reads information.
 void setActualLocationOfNode(Location actual)
          Sets the actual and complete location of the node being deleted.
 String toString()
          
 
Methods inherited from class org.jboss.dna.graph.request.Request
cancel, getError, hasError, isCancelled, setError
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeleteBranchRequest

public DeleteBranchRequest(Location at,
                           String workspaceName)
Create a request to delete a branch.

Parameters:
at - the location of the top node in the existing branch that is to be deleted
workspaceName - the name of the workspace containing the parent
Throws:
IllegalArgumentException - if the location or workspace name is null
Method Detail

at

public Location at()
Get the location defining the top of the branch to be deleted

Returns:
the location of the branch; never null

inWorkspace

public String inWorkspace()
Get the name of the workspace in which the branch exists.

Returns:
the name of the workspace; never null

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 deleted. 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 deleted, 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 deleted.

Returns:
the actual location, or null if the actual location was not set

changes

public boolean changes(String workspace,
                       Path path)
Determine if this request changes the branch at the given path.

Specified by:
changes in interface ChangeRequest
Parameters:
workspace - the name of the workspace; may not be null
path - the path; may not be null
Returns:
true if this request changes a node under the given path
See Also:
ChangeRequest.changes(java.lang.String, org.jboss.dna.graph.property.Path)

changedLocation

public Location changedLocation()
Get the location of the top-most node that is to be changed by this request.

Specified by:
changedLocation in interface ChangeRequest
Returns:
the location changed by this request
See Also:
ChangeRequest.changedLocation()

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.