Class HierarchyManagerImpl
- java.lang.Object
-
- org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyManagerImpl
-
- All Implemented Interfaces:
HierarchyManager
public class HierarchyManagerImpl extends Object implements HierarchyManager
HierarchyManagerImplimplements theHierarchyManagerinterface.
-
-
Constructor Summary
Constructors Constructor Description HierarchyManagerImpl(TransientItemStateFactory isf, IdFactory idFactory, PathFactory pathFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Dispose thisHierarchyManagerintgetDepth(HierarchyEntry hierarchyEntry)Returns the depth of the specified item.NodeEntrygetNodeEntry(NodeId nodeId)Resolves a itemId into aHierarchyEntry.NodeEntrygetNodeEntry(Path qPath)Resolves a path into aNodeEntry.NodeStategetNodeState(Path qPath)Retrieves theNodeEntrycorresponding to the given path and resolves it to the underlyingNodeState.PropertyEntrygetPropertyEntry(Path qPath)Resolves a path into aPropertyEntry.PropertyEntrygetPropertyEntry(PropertyId propertyId)Resolves a propertyId into aPropertyEntry.PropertyStategetPropertyState(Path qPath)Retrieves thePropertyEntrycorresponding to the given path and resolves it to the underlyingPropertyState.intgetRelativeDepth(NodeEntry ancestor, HierarchyEntry descendant)Returns the depth of the specified descendant relative to the given ancestor.NodeEntrygetRootEntry()HierarchyEntrylookup(ItemId workspaceItemId)Lookup ofHierarchyEntryby its workspace Id that may be different if a entry (or any of its ancestors) has been transiently moved or reordered.HierarchyEntrylookup(Path workspacePath)Lookup ofHierarchyEntryby its workspace path that may be different if a entry (or any of its ancestors) has been transiently moved or reordered.voidsetResolver(NamePathResolver resolver)
-
-
-
Constructor Detail
-
HierarchyManagerImpl
public HierarchyManagerImpl(TransientItemStateFactory isf, IdFactory idFactory, PathFactory pathFactory)
-
-
Method Detail
-
setResolver
public void setResolver(NamePathResolver resolver)
-
dispose
public void dispose()
Description copied from interface:HierarchyManagerDispose thisHierarchyManager- Specified by:
disposein interfaceHierarchyManager- See Also:
HierarchyManager.dispose()
-
getRootEntry
public NodeEntry getRootEntry()
- Specified by:
getRootEntryin interfaceHierarchyManager- Returns:
- the root entry.
- See Also:
HierarchyManager.getRootEntry()
-
lookup
public HierarchyEntry lookup(ItemId workspaceItemId)
Description copied from interface:HierarchyManagerLookup ofHierarchyEntryby its workspace Id that may be different if a entry (or any of its ancestors) has been transiently moved or reordered.If the Hierarchy already lists the entry with the given workspaceItemId it is returned otherwise
null. SeeHierarchyManager.getNodeEntry(NodeId)orHierarchyManager.getPropertyEntry(PropertyId)for methods that resolves the ItemId including lookup in the persistence layer if the entry has not been loaded yet.- Specified by:
lookupin interfaceHierarchyManager- Returns:
- the HierarchyEntry with the given
workspaceItemId. - See Also:
HierarchyManager.lookup(ItemId)
-
lookup
public HierarchyEntry lookup(Path workspacePath)
Description copied from interface:HierarchyManagerLookup ofHierarchyEntryby its workspace path that may be different if a entry (or any of its ancestors) has been transiently moved or reordered.If the Hierarchy already lists the entry with the given path it is returned otherwise
null. SeeHierarchyManager.getNodeEntry(Path)orHierarchyManager.getPropertyEntry(Path)for methods that resolves the path including lookup in the persistence layer if the entry has not been loaded yet.- Specified by:
lookupin interfaceHierarchyManager- Returns:
- the HierarchyEntry with the given
workspacePath. - See Also:
HierarchyManager.lookup(Path)
-
getNodeEntry
public NodeEntry getNodeEntry(NodeId nodeId) throws ItemNotFoundException, RepositoryException
Description copied from interface:HierarchyManagerResolves a itemId into aHierarchyEntry.- Specified by:
getNodeEntryin interfaceHierarchyManager- Returns:
- Throws:
PathNotFoundExceptionRepositoryExceptionItemNotFoundException- See Also:
HierarchyManager.getNodeEntry(NodeId)
-
getNodeEntry
public NodeEntry getNodeEntry(Path qPath) throws PathNotFoundException, RepositoryException
Description copied from interface:HierarchyManagerResolves a path into aNodeEntry.- Specified by:
getNodeEntryin interfaceHierarchyManager- Returns:
- Throws:
PathNotFoundExceptionRepositoryException- See Also:
HierarchyManager.getNodeEntry(Path)
-
getPropertyEntry
public PropertyEntry getPropertyEntry(PropertyId propertyId) throws ItemNotFoundException, RepositoryException
Description copied from interface:HierarchyManagerResolves a propertyId into aPropertyEntry.- Specified by:
getPropertyEntryin interfaceHierarchyManager- Returns:
- Throws:
PathNotFoundExceptionRepositoryExceptionItemNotFoundException- See Also:
HierarchyManager.getPropertyEntry(PropertyId)
-
getPropertyEntry
public PropertyEntry getPropertyEntry(Path qPath) throws PathNotFoundException, RepositoryException
Description copied from interface:HierarchyManagerResolves a path into aPropertyEntry.- Specified by:
getPropertyEntryin interfaceHierarchyManager- Returns:
- Throws:
PathNotFoundExceptionRepositoryException- See Also:
HierarchyManager.getPropertyEntry(Path)
-
getNodeState
public NodeState getNodeState(Path qPath) throws PathNotFoundException, RepositoryException
Description copied from interface:HierarchyManagerRetrieves theNodeEntrycorresponding to the given path and resolves it to the underlyingNodeState.- Specified by:
getNodeStatein interfaceHierarchyManager- Returns:
- Throws:
PathNotFoundExceptionRepositoryException- See Also:
HierarchyManager.getNodeState(Path)
-
getPropertyState
public PropertyState getPropertyState(Path qPath) throws PathNotFoundException, RepositoryException
Description copied from interface:HierarchyManagerRetrieves thePropertyEntrycorresponding to the given path and resolves it to the underlyingPropertyState.- Specified by:
getPropertyStatein interfaceHierarchyManager- Returns:
- Throws:
PathNotFoundExceptionRepositoryException- See Also:
HierarchyManager.getPropertyState(Path)
-
getDepth
public int getDepth(HierarchyEntry hierarchyEntry) throws ItemNotFoundException, RepositoryException
Description copied from interface:HierarchyManagerReturns the depth of the specified item. The depth reflects the absolute hierarchy level.- Specified by:
getDepthin interfaceHierarchyManager- Returns:
- the depth of the specified item
- Throws:
RepositoryException- if another error occursItemNotFoundException- See Also:
HierarchyManager.getDepth(HierarchyEntry)
-
getRelativeDepth
public int getRelativeDepth(NodeEntry ancestor, HierarchyEntry descendant) throws ItemNotFoundException, RepositoryException
Description copied from interface:HierarchyManagerReturns the depth of the specified descendant relative to the given ancestor. Ifancestoranddescendantdenote the same item 0 is returned. Ifancestordoes not denote an ancestor -1 is returned.- Specified by:
getRelativeDepthin interfaceHierarchyManager- Parameters:
ancestor- NodeEntry that must be an ancestor of the descendantdescendant- HierarchyEntry- Returns:
- the relative depth; -1 if
ancestordoes not denote an 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.- See Also:
HierarchyManager.getRelativeDepth(NodeEntry, HierarchyEntry)
-
-