Package org.apache.jackrabbit.core
Interface HierarchyManager
-
- All Known Implementing Classes:
CachingHierarchyManager,HierarchyManagerImpl,ZombieHierarchyManager
public interface HierarchyManagerTheHierarchyManagerinterface ...
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description intgetDepth(ItemId id)Returns the depth of the specified item which is equivalent togetPath(id).getAncestorCount().NamegetName(ItemId id)Returns the name of the specified item.NamegetName(NodeId id, NodeId parentId)Returns the name of the specified item, with the given parent id.PathgetPath(ItemId id)Returns the path to the given item.intgetRelativeDepth(NodeId ancestorId, ItemId descendantId)Returns the depth of the specified descendant relative to the given ancestor.intgetShareRelativeDepth(NodeId ancestorId, ItemId descendantId)Returns the depth of the specified share-descendant relative to the given share-ancestor.booleanisAncestor(NodeId nodeId, ItemId itemId)Determines whether the node with the specifiednodeIdis an ancestor of the item denoted by the givenitemId.booleanisShareAncestor(NodeId ancestor, NodeId descendant)Determines whether the node with the specifiedancestoris a share ancestor of the item denoted by the givendescendant.NodeIdresolveNodePath(Path path)Resolves a path into a node id.ItemIdresolvePath(Path path)Deprecated.As of JSR 283, aPathdoesn't anymore uniquely identify anItem, thereforeresolveNodePath(Path)andresolvePropertyPath(Path)should be used instead.PropertyIdresolvePropertyPath(Path path)Resolves a path into a property id.
-
-
-
Method Detail
-
resolvePath
@Deprecated ItemId resolvePath(Path path) throws RepositoryException
Deprecated.As of JSR 283, aPathdoesn't anymore uniquely identify anItem, thereforeresolveNodePath(Path)andresolvePropertyPath(Path)should be used instead.Resolves a path into an item id.If there is both a node and a property at the specified path, this method will return the id of the node.
Note that, for performance reasons, this method returns
nullrather than throwing aPathNotFoundExceptionif there's no item to be found atpath.- Parameters:
path- path to resolve- Returns:
- item id referred to by
pathornullif there's no item atpath. - Throws:
RepositoryException- if an error occurs
-
resolveNodePath
NodeId resolveNodePath(Path path) throws RepositoryException
Resolves a path into a node id.Note that, for performance reasons, this method returns
nullrather than throwing aPathNotFoundExceptionif there's no node to be found atpath.- Parameters:
path- path to resolve- Returns:
- node id referred to by
pathornullif there's no node atpath. - Throws:
RepositoryException- if an error occurs
-
resolvePropertyPath
PropertyId resolvePropertyPath(Path path) throws RepositoryException
Resolves a path into a property id.Note that, for performance reasons, this method returns
nullrather than throwing aPathNotFoundExceptionif there's no property to be found atpath.- Parameters:
path- path to resolve- Returns:
- property id referred to by
pathornullif there's no property atpath. - Throws:
RepositoryException- if an error occurs
-
getPath
Path getPath(ItemId id) throws ItemNotFoundException, RepositoryException
Returns the path to the given item.- Parameters:
id-- Returns:
- Throws:
ItemNotFoundExceptionRepositoryException
-
getName
Name getName(ItemId id) throws ItemNotFoundException, RepositoryException
Returns the name of the specified item.- Parameters:
id- id of item whose name should be returned- Returns:
- Throws:
ItemNotFoundExceptionRepositoryException
-
getName
Name getName(NodeId id, NodeId parentId) throws ItemNotFoundException, RepositoryException
Returns the name of the specified item, with the given parent id. If the given item is not shareable, this is identical togetName(ItemId).- Parameters:
id- node idparentId- parent node id- Returns:
- name
- Throws:
ItemNotFoundExceptionRepositoryException
-
getDepth
int getDepth(ItemId id) throws ItemNotFoundException, RepositoryException
Returns the depth of the specified item which is equivalent togetPath(id).getAncestorCount(). The depth reflects the absolute hierarchy level.- Parameters:
id- item id- Returns:
- the depth of the specified item
- Throws:
ItemNotFoundException- if the specifiediddoes not denote an existing item.RepositoryException- if another error occurs
-
getRelativeDepth
int getRelativeDepth(NodeId ancestorId, ItemId descendantId) throws ItemNotFoundException, RepositoryException
Returns the depth of the specified descendant relative to the given ancestor. IfancestorIdanddescendantIddenote the same item 0 is returned. IfancestorIddoes not denote an ancestor -1 is returned.- Parameters:
ancestorId- ancestor iddescendantId- descendant id- Returns:
- the relative depth; -1 if
ancestorIddoes not denote an ancestor of the item denoted bydescendantId(or itself). - Throws:
ItemNotFoundException- if either of the specified id's does not denote an existing item.RepositoryException- if another error occurs
-
isAncestor
boolean isAncestor(NodeId nodeId, ItemId itemId) throws ItemNotFoundException, RepositoryException
Determines whether the node with the specifiednodeIdis an ancestor of the item denoted by the givenitemId. This is equivalent togetPath(nodeId).isAncestorOf(getPath(itemId)).- Parameters:
nodeId- node iditemId- item id- Returns:
trueif the node with the specifiednodeIdis an ancestor of the item denoted by the givenitemId;falseotherwise- Throws:
ItemNotFoundException- if any of the specified id's does not denote an existing item.RepositoryException- if another error occurs
-
isShareAncestor
boolean isShareAncestor(NodeId ancestor, NodeId descendant) throws ItemNotFoundException, RepositoryException
Determines whether the node with the specifiedancestoris a share ancestor of the item denoted by the givendescendant. This istruefor two nodesA,Bif either:Ais a (proper) ancestor ofB- there is a non-empty sequence of nodes
N1,... ,Nksuch thatA=N1andB=NkandNiis the parent or a share-parent ofNi+1(for everyiin1...k-1.
- Parameters:
ancestor- node iddescendant- item id- Returns:
trueif the node denoted byancestoris a share ancestor of the item denoted bydescendant,falseotherwise- Throws:
ItemNotFoundException- if any of the specified id's does not denote an existing item.RepositoryException- if another error occurs
-
getShareRelativeDepth
int getShareRelativeDepth(NodeId ancestorId, ItemId descendantId) throws ItemNotFoundException, RepositoryException
Returns the depth of the specified share-descendant relative to the given share-ancestor. Ifancestoranddescendantdenote the same item,0is returned. Ifancestordoes not denote an share-ancestor-1is returned.- Parameters:
ancestorId- ancestor iddescendantId- descendant id- Returns:
- the relative depth;
-1ifancestordoes not denote a share-ancestor of the item denoted bydescendant(or itself). - Throws:
ItemNotFoundException- if either of the specified id's does not denote an existing item.RepositoryException- if another error occurs
-
-