|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.dna.graph.request.Request
org.jboss.dna.graph.request.ChangeRequest
org.jboss.dna.graph.request.CopyBranchRequest
public class CopyBranchRequest
Instruction that a branch be copied from one location into another. This request can copy a branch in one workspace into
another workspace, or it can copy a branch in the same workspace. Copying a branch always results in the generation of new
UUIDs for the copied nodes. Cloning a branch
provides functionality similar to copy, but with the
ability to preserve UUIDs in the move.
CloneBranchRequest
,
Serialized FormField Summary | |
---|---|
static NodeConflictBehavior |
DEFAULT_NODE_CONFLICT_BEHAVIOR
|
Constructor Summary | |
---|---|
CopyBranchRequest(Location from,
String fromWorkspace,
Location into,
String intoWorkspace)
Create a request to copy a branch to another. |
|
CopyBranchRequest(Location from,
String fromWorkspace,
Location into,
String intoWorkspace,
Name nameForCopy)
Create a request to copy a branch to another. |
|
CopyBranchRequest(Location from,
String fromWorkspace,
Location into,
String intoWorkspace,
Name nameForCopy,
NodeConflictBehavior nodeConflictBehavior)
Create a request to copy 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. |
CopyBranchRequest |
clone()
This method does not clone the results. |
Name |
desiredName()
Get the name of the copy if it is to be different than that of the original. |
boolean |
equals(Object obj)
|
Location |
from()
Get the location defining the top of the branch to be copied |
String |
fromWorkspace()
Get the name of the workspace containing the branch to be copied. |
Location |
getActualLocationAfter()
Get the actual location of the node after being copied. |
Location |
getActualLocationBefore()
Get the actual location of the node before being copied. |
int |
hashCode()
|
Location |
into()
Get the location defining the parent where the new copy is to be placed |
String |
intoWorkspace()
Get the name of the workspace where the copy is to be placed |
boolean |
isReadOnly()
Return whether this request only reads information. |
boolean |
isSameWorkspace()
Determine whether this copy operation is within the same workspace. |
NodeConflictBehavior |
nodeConflictBehavior()
Get the expected behavior when copying the branch and the destination already has a node with the same
name. |
void |
setActualLocations(Location fromLocation,
Location intoLocation)
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.request.Request |
---|
freeze, getError, hasError, isCancelled, isFrozen, setError, setLatchForFreezing |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final NodeConflictBehavior DEFAULT_NODE_CONFLICT_BEHAVIOR
Constructor Detail |
---|
public CopyBranchRequest(Location from, String fromWorkspace, Location into, String intoWorkspace)
from
- the location of the top node in the existing branch that is to be copiedfromWorkspace
- the name of the workspace where the from
node existsinto
- the location of the existing node into which the copy should be placedintoWorkspace
- the name of the workspace where the into
node is to be copied, or null if the source's
default workspace is to be used
IllegalArgumentException
- if any of the parameters are nullpublic CopyBranchRequest(Location from, String fromWorkspace, Location into, String intoWorkspace, Name nameForCopy)
from
- the location of the top node in the existing branch that is to be copiedfromWorkspace
- the name of the workspace where the from
node existsinto
- the location of the existing node into which the copy should be placedintoWorkspace
- the name of the workspace where the into
node is to be copiednameForCopy
- the desired name for the node that results from the copy, or null if the name of the original should be
used
IllegalArgumentException
- if any of the parameters are nullpublic CopyBranchRequest(Location from, String fromWorkspace, Location into, String intoWorkspace, Name nameForCopy, NodeConflictBehavior nodeConflictBehavior)
from
- the location of the top node in the existing branch that is to be copiedfromWorkspace
- the name of the workspace where the from
node existsinto
- the location of the existing node into which the copy should be placedintoWorkspace
- the name of the workspace where the into
node is to be copiednameForCopy
- the desired name for the node that results from the copy, or null if the name of the original should be
usednodeConflictBehavior
- the expected behavior if an equivalently-named child already exists at the into
location
IllegalArgumentException
- if any of the parameters are nullMethod Detail |
---|
public Location from()
public Location into()
public String fromWorkspace()
public String intoWorkspace()
public boolean isSameWorkspace()
original
is different than that of the copy
public Name desiredName()
public boolean isReadOnly()
isReadOnly
in class Request
Request.isReadOnly()
public NodeConflictBehavior nodeConflictBehavior()
destination
already has a node with the same
name.
public void setActualLocations(Location fromLocation, Location intoLocation)
path
.
fromLocation
- the actual location of the node being copiedintoLocation
- the actual location of the new copy 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 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 CopyBranchRequest 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 |