|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.dna.graph.request.Request org.jboss.dna.graph.request.ChangeRequest org.jboss.dna.graph.request.CloneBranchRequest
public class CloneBranchRequest
Instruction that a branch be cloned from one workspace into another. Cloning a branch differs from cloning a branch in that:
Constructor Summary | |
---|---|
CloneBranchRequest(Location from,
String fromWorkspace,
Location into,
String intoWorkspace,
Name nameForClone,
Path.Segment exactSegmentForClone,
boolean removeExisting)
Create a request to clone a branch to another. |
Method Summary | |
---|---|
void |
cancel()
Cancel this request. |
Location |
changedLocation()
Get the location of the top-most node that is to be changed by this request. |
String |
changedWorkspace()
Get the name of the workspace that was changed by this request. |
boolean |
changes(String workspace,
Path path)
Determine if this request changes the branch at the given path. |
CloneBranchRequest |
clone()
This method does not clone the results. |
Name |
desiredName()
Get the name of the clone if it is to be different than that of the original. |
Path.Segment |
desiredSegment()
Get the exact segment at which the clone should be rooted |
boolean |
equals(Object obj)
|
Location |
from()
Get the location defining the top of the branch to be cloned |
String |
fromWorkspace()
Get the name of the workspace containing the branch to be cloned. |
Location |
getActualLocationAfter()
Get the actual location of the node after being cloned. |
Location |
getActualLocationBefore()
Get the actual location of the node before being cloned. |
Set<Location> |
getRemovedNodes()
Get the set of nodes that were removed because of this clone operation. |
int |
hashCode()
|
Location |
into()
Get the location defining the parent where the new clone is to be placed |
String |
intoWorkspace()
Get the name of the workspace where the clone is to be placed |
boolean |
isReadOnly()
Return whether this request only reads information. |
boolean |
isSameWorkspace()
Determine whether this clone operation is within the same workspace. |
boolean |
removeExisting()
Gets whether the clone should remove existing nodes in the new workspace with the same UUID as any
of the nodes in the source branch or should throw an exception if such conflict is detected. |
void |
setActualLocations(Location fromLocation,
Location intoLocation)
Sets the actual and complete location of the node being renamed and its new location. |
void |
setRemovedNodes(Set<Location> existingNodesThatWereRemoved)
Set the locations of the nodes that were removed by this operation, if removeExisting() is true. |
String |
toString()
|
Methods inherited from class org.jboss.dna.graph.request.Request |
---|
freeze, getError, hasError, isCancelled, isFrozen, setError, setLatchForFreezing |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CloneBranchRequest(Location from, String fromWorkspace, Location into, String intoWorkspace, Name nameForClone, Path.Segment exactSegmentForClone, boolean removeExisting)
from
- the location of the top node in the existing branch that is to be clonedfromWorkspace
- the name of the workspace where the from
node existsinto
- the location of the existing node into which the clone should be placedintoWorkspace
- the name of the workspace where the into
node is to be clonednameForClone
- the desired name for the node that results from the clone, or null if the name of the original should
be usedexactSegmentForClone
- the exact segment
at which the cloned tree should be rooted.removeExisting
- whether any nodes in the intoWorkspace with the same UUIDs as a node in the source branch should be
removed (if true) or a UuidAlreadyExistsException
should be thrown.
IllegalArgumentException
- if any of the parameters are null except for nameForClone
or exactSegmentForClone
. Exactly one of nameForClone
and exactSegmentForClone
must be null.Method Detail |
---|
public Location from()
public Location into()
public String fromWorkspace()
public String intoWorkspace()
public boolean isSameWorkspace()
original
is different than that of the clone
public Name desiredName()
exact segment
is specified.public Path.Segment desiredSegment()
segment
at which the clone should be rooted
into
locationpublic boolean removeExisting()
new workspace
with the same UUID as any
of the nodes in the source branch or should throw an exception if such conflict is detected.
new workspace
with the same UUID as
any of the nodes in the source branch or should throw an exception if such conflict is detected; true indicates
that the nodes should be removed and false indicates that an exception should be thrownpublic boolean isReadOnly()
isReadOnly
in class Request
Request.isReadOnly()
public void setActualLocations(Location fromLocation, Location intoLocation)
path
.
fromLocation
- the actual location of the node being clonedintoLocation
- the actual location of the new clone of the node
IllegalArgumentException
- if the either location is null; if the old location is not equal to
the from location
; if the new location is not equal to
the into location
; if the either location does not have a path
IllegalStateException
- if the request is frozenpublic Location getActualLocationBefore()
public Location getActualLocationAfter()
public void setRemovedNodes(Set<Location> existingNodesThatWereRemoved)
removeExisting()
is true.
existingNodesThatWereRemoved
- the (immutable) set of existing node locations; may be nullpublic Set<Location> getRemovedNodes()
public boolean changes(String workspace, Path path)
changes
in class ChangeRequest
workspace
- the name of the workspace; may not be nullpath
- the path; may not be null
ChangeRequest.changes(java.lang.String, org.jboss.dna.graph.property.Path)
public Location changedLocation()
path
.
changedLocation
in class ChangeRequest
ChangeRequest.changedLocation()
public String changedWorkspace()
changedWorkspace
in class ChangeRequest
ChangeRequest.changedWorkspace()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public void cancel()
cancellation flag
is set, and any current or
future processing of the request may be affected by the cancellation. (Note however, that processors may choose to not
respect this request.)
This method is safe to be called by different threads.
cancel
in class Request
Request.cancel()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public String toString()
toString
in class Object
Object.toString()
public CloneBranchRequest clone()
This method does not clone the results.
This method does not clone the results.
clone
in class ChangeRequest
ChangeRequest.clone()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |