org.apache.jackrabbit.jcr2spi.hierarchy
Interface HierarchyManager

All Known Implementing Classes:
HierarchyManagerImpl

public interface HierarchyManager

HierarchyManager...


Method Summary
 void dispose()
          Dispose this HierarchyManager
 int getDepth(HierarchyEntry hierarchyEntry)
          Returns the depth of the specified item.
 NodeEntry getNodeEntry(NodeId nodeId)
          Resolves a itemId into a HierarchyEntry.
 NodeEntry getNodeEntry(Path qPath)
          Resolves a path into a NodeEntry.
 NodeState getNodeState(Path qPath)
          Retrieves the NodeEntry corresponding to the given path and resolves it to the underlying NodeState.
 PropertyEntry getPropertyEntry(Path qPath)
          Resolves a path into a PropertyEntry.
 PropertyEntry getPropertyEntry(PropertyId propertyId)
          Resolves a propertyId into a PropertyEntry.
 PropertyState getPropertyState(Path qPath)
          Retrieves the PropertyEntry corresponding to the given path and resolves it to the underlying PropertyState.
 int getRelativeDepth(NodeEntry ancestor, HierarchyEntry descendant)
          Returns the depth of the specified descendant relative to the given ancestor.
 NodeEntry getRootEntry()
           
 HierarchyEntry lookup(ItemId workspaceItemId)
          Lookup of HierarchyEntry by its workspace Id that may be different if a entry (or any of its ancestors) has been transiently moved or reordered.
 HierarchyEntry lookup(Path workspacePath)
          Lookup of HierarchyEntry by its workspace path that may be different if a entry (or any of its ancestors) has been transiently moved or reordered.
 

Method Detail

dispose

void dispose()
Dispose this HierarchyManager


getRootEntry

NodeEntry getRootEntry()
Returns:
the root entry.

lookup

HierarchyEntry lookup(ItemId workspaceItemId)
Lookup of HierarchyEntry by 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. See getNodeEntry(NodeId) or getPropertyEntry(PropertyId) for methods that resolves the ItemId including lookup in the persistence layer if the entry has not been loaded yet.

Parameters:
workspaceItemId -
Returns:
the HierarchyEntry with the given workspaceItemId.

lookup

HierarchyEntry lookup(Path workspacePath)
Lookup of HierarchyEntry by 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. See getNodeEntry(Path) or getPropertyEntry(Path) for methods that resolves the path including lookup in the persistence layer if the entry has not been loaded yet.

Parameters:
workspacePath -
Returns:
the HierarchyEntry with the given workspacePath.

getNodeEntry

NodeEntry getNodeEntry(NodeId nodeId)
                       throws ItemNotFoundException,
                              RepositoryException
Resolves a itemId into a HierarchyEntry.

Parameters:
nodeId -
Returns:
Throws:
PathNotFoundException
RepositoryException
ItemNotFoundException

getNodeEntry

NodeEntry getNodeEntry(Path qPath)
                       throws PathNotFoundException,
                              RepositoryException
Resolves a path into a NodeEntry.

Parameters:
qPath -
Returns:
Throws:
PathNotFoundException
RepositoryException

getPropertyEntry

PropertyEntry getPropertyEntry(PropertyId propertyId)
                               throws ItemNotFoundException,
                                      RepositoryException
Resolves a propertyId into a PropertyEntry.

Parameters:
propertyId -
Returns:
Throws:
PathNotFoundException
RepositoryException
ItemNotFoundException

getPropertyEntry

PropertyEntry getPropertyEntry(Path qPath)
                               throws PathNotFoundException,
                                      RepositoryException
Resolves a path into a PropertyEntry.

Parameters:
qPath -
Returns:
Throws:
PathNotFoundException
RepositoryException

getNodeState

NodeState getNodeState(Path qPath)
                       throws PathNotFoundException,
                              RepositoryException
Retrieves the NodeEntry corresponding to the given path and resolves it to the underlying NodeState.

Parameters:
qPath -
Returns:
Throws:
PathNotFoundException
RepositoryException

getPropertyState

PropertyState getPropertyState(Path qPath)
                               throws PathNotFoundException,
                                      RepositoryException
Retrieves the PropertyEntry corresponding to the given path and resolves it to the underlying PropertyState.

Parameters:
qPath -
Returns:
Throws:
PathNotFoundException
RepositoryException

getDepth

int getDepth(HierarchyEntry hierarchyEntry)
             throws ItemNotFoundException,
                    RepositoryException
Returns the depth of the specified item. The depth reflects the absolute hierarchy level.

Parameters:
hierarchyEntry -
Returns:
the depth of the specified item
Throws:
RepositoryException - if another error occurs
ItemNotFoundException

getRelativeDepth

int getRelativeDepth(NodeEntry ancestor,
                     HierarchyEntry descendant)
                     throws ItemNotFoundException,
                            RepositoryException
Returns the depth of the specified descendant relative to the given ancestor. If ancestor and descendant denote the same item 0 is returned. If ancestor does not denote an ancestor -1 is returned.

Parameters:
ancestor - NodeEntry that must be an ancestor of the descendant
descendant - HierarchyEntry
Returns:
the relative depth; -1 if ancestor does not denote an ancestor of the item denoted by descendant (or itself).
Throws:
ItemNotFoundException - If either of the specified id's does not denote an existing item.
RepositoryException - If another error occurs.


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.