|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.core.HierarchyManagerImpl
public class HierarchyManagerImpl
HierarchyManagerImpl ...
| Field Summary | |
|---|---|
protected ItemStateManager |
provider
|
protected PathResolver |
resolver
Path resolver for outputting user-friendly paths in error messages. |
protected NodeId |
rootNodeId
|
| Constructor Summary | |
|---|---|
HierarchyManagerImpl(NodeId rootNodeId,
ItemStateManager provider,
PathResolver resolver)
|
|
| Method Summary | |
|---|---|
protected void |
beforeResolvePath(Path path,
ItemState state,
int next)
Called by recursively invoked method resolvePath(Path, ItemState, int, boolean);
May be overridden by some subclass to process/cache intermediate state. |
protected void |
buildPath(PathBuilder builder,
ItemState state)
Adds the path element of an item id to the path currently being built. |
protected NodeState.ChildNodeEntry |
getChildNodeEntry(NodeState parent,
Name name,
int index)
Returns the ChildNodeEntry of parent with the
specified name and index or null
if there's no such entry. |
protected NodeState.ChildNodeEntry |
getChildNodeEntry(NodeState parent,
NodeId id)
Returns the ChildNodeEntry of parent with the
specified uuid or null if there's no such entry. |
int |
getDepth(ItemId id)
Returns the depth of the specified item which is equivalent to getPath(id).getAncestorCount(). |
protected ItemState |
getItemState(ItemId id)
Return an item state, given its item id. |
Name |
getName(ItemId itemId)
Returns the name of the specified item. |
protected NodeId |
getParentId(ItemState state)
Returns the parentUUID of the given item. |
Path |
getPath(ItemId id)
Returns the path to the given item. |
int |
getRelativeDepth(NodeId ancestorId,
ItemId descendantId)
Returns the depth of the specified descendant relative to the given ancestor. |
NodeId |
getRootNodeId()
|
protected boolean |
hasItemState(ItemId id)
Determines whether an item state for a given item id exists. |
boolean |
isAncestor(NodeId nodeId,
ItemId itemId)
Determines whether the node with the specified nodeId
is an ancestor of the item denoted by the given itemId. |
NodeId |
resolveNodePath(Path path)
Resolves a path into a node id. |
ItemId |
resolvePath(Path path)
Resolves a path into an item id. |
protected ItemId |
resolvePath(Path path,
ItemId id,
int next,
boolean denotesNode)
Resolve a path into an item id. |
PropertyId |
resolvePropertyPath(Path path)
Resolves a path into a property id. |
String |
safeGetJCRPath(ItemId id)
Failsafe translation of internal ItemId to JCR path for use
in error messages etc. |
String |
safeGetJCRPath(Path path)
Failsafe conversion of internal Path to JCR path for use in
error messages etc. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final NodeId rootNodeId
protected final ItemStateManager provider
protected final PathResolver resolver
| Constructor Detail |
|---|
public HierarchyManagerImpl(NodeId rootNodeId,
ItemStateManager provider,
PathResolver resolver)
| Method Detail |
|---|
public NodeId getRootNodeId()
public String safeGetJCRPath(Path path)
Path to JCR path for use in
error messages etc.
path - path to convert
public String safeGetJCRPath(ItemId id)
ItemId to JCR path for use
in error messages etc.
id - id to translate
protected ItemState getItemState(ItemId id)
throws NoSuchItemStateException,
ItemStateException
id - item id
NoSuchItemStateException - if the item does not exist
ItemStateException - if an error occursZombieHierarchyManager.getItemState(ItemId)protected boolean hasItemState(ItemId id)
id - item id
true if an item state exists, otherwise
falseZombieHierarchyManager.hasItemState(ItemId)protected NodeId getParentId(ItemState state)
parentUUID of the given item.
Low-level hook provided for specialized derived classes.
state - item state
parentUUID of the given itemZombieHierarchyManager.getParentId(ItemState)
protected NodeState.ChildNodeEntry getChildNodeEntry(NodeState parent,
NodeId id)
ChildNodeEntry of parent with the
specified uuid or null if there's no such entry.
Low-level hook provided for specialized derived classes.
parent - node stateid - id of child node entry
ChildNodeEntry of parent with
the specified uuid or null if there's
no such entry.ZombieHierarchyManager.getChildNodeEntry(NodeState, NodeId)
protected NodeState.ChildNodeEntry getChildNodeEntry(NodeState parent,
Name name,
int index)
ChildNodeEntry of parent with the
specified name and index or null
if there's no such entry.
Low-level hook provided for specialized derived classes.
parent - node statename - name of child node entryindex - index of child node entry
ChildNodeEntry of parent with
the specified name and index or
null if there's no such entry.ZombieHierarchyManager.getChildNodeEntry(NodeState, Name, int)
protected ItemId resolvePath(Path path,
ItemId id,
int next,
boolean denotesNode)
throws RepositoryException
path - full path of item to resolveid - intermediate item idnext - next path element index to resolvedenotesNode - flag indicating whether path refers to a
node (true) or a property (false)
path
RepositoryException - if an error occured
protected void beforeResolvePath(Path path,
ItemState state,
int next)
resolvePath(Path, ItemState, int, boolean);
May be overridden by some subclass to process/cache intermediate state.
path - full path of item to resolvestate - intermediate statenext - next path element index to resolve
protected void buildPath(PathBuilder builder,
ItemState state)
throws ItemStateException,
RepositoryException
builder contains the path of state.
builder - builder currently being usedstate - item to find path of
ItemStateException
RepositoryException
public ItemId resolvePath(Path path)
throws RepositoryException
null
rather than throwing a PathNotFoundException if there's no
item to be found at path.
resolvePath in interface HierarchyManagerpath - path to resolve
path or null
if there's no item at path.
RepositoryException - if an error occurs
public NodeId resolveNodePath(Path path)
throws RepositoryException
null
rather than throwing a PathNotFoundException if there's no
node to be found at path.
resolveNodePath in interface HierarchyManagerpath - path to resolve
path or null
if there's no node at path.
RepositoryException - if an error occurs
public PropertyId resolvePropertyPath(Path path)
throws RepositoryException
null
rather than throwing a PathNotFoundException if there's no
property to be found at path.
resolvePropertyPath in interface HierarchyManagerpath - path to resolve
path or null
if there's no property at path.
RepositoryException - if an error occurs
public Path getPath(ItemId id)
throws ItemNotFoundException,
RepositoryException
getPath in interface HierarchyManagerItemNotFoundException
RepositoryException
public Name getName(ItemId itemId)
throws ItemNotFoundException,
RepositoryException
getName in interface HierarchyManageritemId - id of item whose name should be returned
ItemNotFoundException
RepositoryException
public int getDepth(ItemId id)
throws ItemNotFoundException,
RepositoryException
getPath(id).getAncestorCount(). The depth reflects the
absolute hierarchy level.
getDepth in interface HierarchyManagerid - item id
ItemNotFoundException - if the specified id does not
denote an existing item.
RepositoryException - if another error occurs
public int getRelativeDepth(NodeId ancestorId,
ItemId descendantId)
throws ItemNotFoundException,
RepositoryException
ancestorId and descendantId
denote the same item 0 is returned. If ancestorId does not
denote an ancestor -1 is returned.
getRelativeDepth in interface HierarchyManagerancestorId - ancestor iddescendantId - descendant id
ancestorId does not
denote an ancestor of the item denoted by descendantId
(or itself).
ItemNotFoundException - if either of the specified id's does not
denote an existing item.
RepositoryException - if another error occurs
public boolean isAncestor(NodeId nodeId,
ItemId itemId)
throws ItemNotFoundException,
RepositoryException
nodeId
is an ancestor of the item denoted by the given itemId.
This is equivalent to
getPath(nodeId).isAncestorOf(getPath(itemId)).
isAncestor in interface HierarchyManagernodeId - node iditemId - item id
true if the node with the specified
nodeId is an ancestor of the item denoted by the
given itemIdfalse otherwise
ItemNotFoundException - if any of the specified id's does not
denote an existing item.
RepositoryException - if another error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||