Interface TreeManager
- All Known Implementing Classes:
BTreeManager
public interface TreeManager
TreeManager instances are responsible for the mapping between sequence views
of
Nodes and Propertys and an hierarchical JCR
representation. They are passed to the various factory methods in
ItemSequence to parameterize the behavior of NodeSequences
and PropertySequences.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether to automatically save changes of the current session occurring from adding/removing nodes and properties.Properties to ignore.getOrder()Comparatorused for establishing the order of the keys in the sequence.getRoot()booleanDetermines whether the givennodeis a leaf.booleanDetermined whether the givennodeis the root node of the JCR sub-tree.voidjoin(ItemSequence itemSequence, Node node, Node cause) After the nodecausehas been deleted from the sequenceitemSequence, the implementation of this method may decide to join the parentnodeofcausewith some other nodes.voidjoin(ItemSequence itemSequence, Node node, Property cause) After the propertycausehas been deleted from the sequenceitemSequence, the implementation of this method may decide to join the parentnodeofcausewith some other nodes.voidsplit(ItemSequence itemSequence, Node node, Node cause) After the nodecausehas been inserted into the sequenceitemSequence, the implementation of this method may decide to split the parentnodeofcauseinto two or more new nodes.voidsplit(ItemSequence itemSequence, Node node, Property cause) After the propertycausehas been inserted into the sequenceitemSequence, the implementation of this method may decide to split the parentnodeofcauseinto two or more new nodes.
-
Method Details
-
getRoot
Node getRoot()- Returns:
- the root node of the JCR sub-tree where the items of the sequence are be mapped to.
-
isRoot
Determined whether the givennodeis the root node of the JCR sub-tree.- Parameters:
node- Node to test for root- Returns:
getRoot().isSame(node).- Throws:
RepositoryException
-
isLeaf
Determines whether the givennodeis a leaf. Leaf nodes are the nodes which are actually part of aNodeSequenceor the parents of the properties of aPropertySequence.- Parameters:
node- Node to test for leaf- Returns:
trueifnodeis a leaf node,falseotherwise.- Throws:
RepositoryException
-
getIgnoredProperties
Properties to ignore.- Returns:
-
getOrder
Comparator<String> getOrder()Comparatorused for establishing the order of the keys in the sequence.- Returns:
- a
Comparator<String>instance
-
split
After the nodecausehas been inserted into the sequenceitemSequence, the implementation of this method may decide to split the parentnodeofcauseinto two or more new nodes. Splitting must be done such that the overall order of the keys in this sequence obeys the order given bygetOrder()as much as possible.- Parameters:
itemSequence- theItemSequencewhere the new nodecausehas been inserted.node- the parent node of the newly inserted nodecause- the newly inserted node ornullif not known.- Throws:
RepositoryException
-
split
After the propertycausehas been inserted into the sequenceitemSequence, the implementation of this method may decide to split the parentnodeofcauseinto two or more new nodes. Splitting must be done such that the overall order of the keys in this sequence obeys the order given bygetOrder()as much as possible.- Parameters:
itemSequence- theItemSequencewhere the new propertycausehas been inserted.node- the parent node of the newly inserted propertycause- the newly inserted property ornullif not known.- Throws:
RepositoryException
-
join
After the nodecausehas been deleted from the sequenceitemSequence, the implementation of this method may decide to join the parentnodeofcausewith some other nodes. Joining must be done such that the overall order of the keys in this sequence obeys the order given bygetOrder()as much as possible.- Parameters:
itemSequence- theItemSequencewhere the nodecausehas been deleted from.node- the parent node from whichcausehas been deleted.cause- the deleted node ornullif not known. Note:causemight be stale.- Throws:
RepositoryException
-
join
After the propertycausehas been deleted from the sequenceitemSequence, the implementation of this method may decide to join the parentnodeofcausewith some other nodes. Joining must be done such that the overall order of the keys in this sequence obeys the order given bygetOrder()as much as possible.- Parameters:
itemSequence- theItemSequencewhere the propertycausehas been deleted from.node- the parent node from whichcausehas been deleted.cause- the deleted property ornullif not known. Note:causemight be stale.- Throws:
RepositoryException
-
getAutoSave
boolean getAutoSave()Whether to automatically save changes of the current session occurring from adding/removing nodes and properties.- Returns:
trueif changes should be automatically saved,falseotherwiese.
-