|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.mk.model.StagedNodeTree
public class StagedNodeTree
A StagedNodeTree provides methods to manipulate a specific revision
of the tree. The changes are recorded and can be persisted by calling
persist(RevisionStore.PutToken).
| Constructor Summary | |
|---|---|
StagedNodeTree(RevisionStore store,
Id baseRevisionId)
Creates a new StagedNodeTree instance. |
|
| Method Summary | |
|---|---|
void |
add(String parentNodePath,
String nodeName,
JsonObject nodeData)
Creates a new node named nodeName at parentNodePath. |
void |
copy(String srcPath,
String destPath)
Copies the subtree rooted at srcPath to destPath. |
boolean |
isEmpty()
Returns true if there are no staged changes, otherwise returns false. |
Id |
merge(StoredNode ourRoot,
Id newBaseRevisionId,
Id commonAncestorRevisionId,
RevisionStore.PutToken token)
Performs a three-way merge merging our tree (rooted at ourRoot)
and their tree (identified by newBaseRevisionId),
using the common ancestor revision commonAncestorRevisionId as
base reference. |
void |
move(String srcPath,
String destPath)
Moves the subtree rooted at srcPath to destPath. |
Id |
persist(RevisionStore.PutToken token)
Persists the staged nodes and returns the Id of the new root node. |
void |
remove(String nodePath)
Removes the node at nodePath. |
void |
reset(Id newBaseRevisionId)
Discards all staged changes and resets the base revision to the specified new revision id. |
void |
setProperty(String nodePath,
String propName,
String propValue)
Creates or updates the property named propName of the specified node. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StagedNodeTree(RevisionStore store,
Id baseRevisionId)
StagedNodeTree instance.
store - revision store used to read from and persist changesbaseRevisionId - id of revision the changes should be based upon| Method Detail |
|---|
public void reset(Id newBaseRevisionId)
newBaseRevisionId - id of revision the changes should be based uponpublic boolean isEmpty()
true if there are no staged changes, otherwise returns false.
true if there are no staged changes, otherwise returns false.
public Id persist(RevisionStore.PutToken token)
throws Exception
Id of the new root node.
token -
Id of new root node or null if there are no changes to persist.
Exception - if an error occurs
public Id merge(StoredNode ourRoot,
Id newBaseRevisionId,
Id commonAncestorRevisionId,
RevisionStore.PutToken token)
throws Exception
ourRoot)
and their tree (identified by newBaseRevisionId),
using the common ancestor revision commonAncestorRevisionId as
base reference.
This instance will be initially reset to newBaseRevisionId, discarding
all currently staged changes.
ourRoot - newBaseRevisionId - commonAncestorRevisionId - token -
Id of new root node
Exception
public void add(String parentNodePath,
String nodeName,
JsonObject nodeData)
throws Exception
nodeName at parentNodePath.
parentNodePath - parent node pathnodeName - name of new nodenodeData - JsonObject representation of the node to be added
NotFoundException - if there's no node at parentNodePath
Exception - if a node named nodeName already exists at parentNodePath
or if another error occurs
public void remove(String nodePath)
throws Exception
nodePath.
nodePath - node path
Exception
public void setProperty(String nodePath,
String propName,
String propValue)
throws Exception
propName of the specified node.
if propValue == null the specified property will be removed.
nodePath - node pathpropName - property namepropValue - property value
NotFoundException - if there's no node at nodePath
Exception - if another error occurs
public void move(String srcPath,
String destPath)
throws Exception
srcPath to destPath.
srcPath - path of node to be moveddestPath - destination path
NotFoundException - if either the node at srcPath or the parent
node of destPath doesn't exist
Exception - if a node already exists at destPath,
if srcPath denotes an ancestor of destPath
or if another error occurs
public void copy(String srcPath,
String destPath)
throws Exception
srcPath to destPath.
srcPath - path of node to be copieddestPath - destination path
NotFoundException - if either the node at srcPath or the parent
node of destPath doesn't exist
Exception - if a node already exists at destPath
or if another error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||