Interface TreeManager
-
- All Known Implementing Classes:
BTreeManager
public interface TreeManager
TreeManager instances are responsible for the mapping between sequence views ofNode
s andProperty
s and an hierarchical JCR representation. They are passed to the various factory methods inItemSequence
to parameterize the behavior ofNodeSequence
s andPropertySequence
s.- See Also:
NodeSequence
,PropertySequence
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
getAutoSave()
Whether to automatically save changes of the current session occurring from adding/removing nodes and properties.Set<String>
getIgnoredProperties()
Properties to ignore.Comparator<String>
getOrder()
Comparator
used for establishing the order of the keys in the sequence.Node
getRoot()
boolean
isLeaf(Node node)
Determines whether the givennode
is a leaf.boolean
isRoot(Node node)
Determined whether the givennode
is the root node of the JCR sub-tree.void
join(ItemSequence itemSequence, Node node, Node cause)
After the nodecause
has been deleted from the sequenceitemSequence
, the implementation of this method may decide to join the parentnode
ofcause
with some other nodes.void
join(ItemSequence itemSequence, Node node, Property cause)
After the propertycause
has been deleted from the sequenceitemSequence
, the implementation of this method may decide to join the parentnode
ofcause
with some other nodes.void
split(ItemSequence itemSequence, Node node, Node cause)
After the nodecause
has been inserted into the sequenceitemSequence
, the implementation of this method may decide to split the parentnode
ofcause
into two or more new nodes.void
split(ItemSequence itemSequence, Node node, Property cause)
After the propertycause
has been inserted into the sequenceitemSequence
, the implementation of this method may decide to split the parentnode
ofcause
into two or more new nodes.
-
-
-
Method Detail
-
getRoot
Node getRoot()
- Returns:
- the root node of the JCR sub-tree where the items of the sequence are be mapped to.
-
isRoot
boolean isRoot(Node node) throws RepositoryException
Determined whether the givennode
is the root node of the JCR sub-tree.- Parameters:
node
- Node to test for root- Returns:
getRoot().isSame(node)
.- Throws:
RepositoryException
-
isLeaf
boolean isLeaf(Node node) throws RepositoryException
Determines whether the givennode
is a leaf. Leaf nodes are the nodes which are actually part of aNodeSequence
or the parents of the properties of aPropertySequence
.- Parameters:
node
- Node to test for leaf- Returns:
true
ifnode
is a leaf node,false
otherwise.- Throws:
RepositoryException
-
getOrder
Comparator<String> getOrder()
Comparator
used for establishing the order of the keys in the sequence.- Returns:
- a
Comparator<String>
instance
-
split
void split(ItemSequence itemSequence, Node node, Node cause) throws RepositoryException
After the nodecause
has been inserted into the sequenceitemSequence
, the implementation of this method may decide to split the parentnode
ofcause
into 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
- theItemSequence
where the new nodecause
has been inserted.node
- the parent node of the newly inserted nodecause
- the newly inserted node ornull
if not known.- Throws:
RepositoryException
-
split
void split(ItemSequence itemSequence, Node node, Property cause) throws RepositoryException
After the propertycause
has been inserted into the sequenceitemSequence
, the implementation of this method may decide to split the parentnode
ofcause
into 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
- theItemSequence
where the new propertycause
has been inserted.node
- the parent node of the newly inserted propertycause
- the newly inserted property ornull
if not known.- Throws:
RepositoryException
-
join
void join(ItemSequence itemSequence, Node node, Node cause) throws RepositoryException
After the nodecause
has been deleted from the sequenceitemSequence
, the implementation of this method may decide to join the parentnode
ofcause
with 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
- theItemSequence
where the nodecause
has been deleted from.node
- the parent node from whichcause
has been deleted.cause
- the deleted node ornull
if not known. Note:cause
might be stale.- Throws:
RepositoryException
-
join
void join(ItemSequence itemSequence, Node node, Property cause) throws RepositoryException
After the propertycause
has been deleted from the sequenceitemSequence
, the implementation of this method may decide to join the parentnode
ofcause
with 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
- theItemSequence
where the propertycause
has been deleted from.node
- the parent node from whichcause
has been deleted.cause
- the deleted property ornull
if not known. Note:cause
might be stale.- Throws:
RepositoryException
-
getAutoSave
boolean getAutoSave()
Whether to automatically save changes of the current session occurring from adding/removing nodes and properties.- Returns:
true
if changes should be automatically saved,false
otherwiese.
-
-