public class HierarchyManagerImpl extends Object implements HierarchyManager
HierarchyManagerImpl
implements the HierarchyManager
interface.Constructor and Description |
---|
HierarchyManagerImpl(TransientItemStateFactory isf,
IdFactory idFactory,
PathFactory pathFactory) |
Modifier and Type | Method and Description |
---|---|
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. |
void |
setResolver(NamePathResolver resolver) |
public HierarchyManagerImpl(TransientItemStateFactory isf, IdFactory idFactory, PathFactory pathFactory)
public void setResolver(NamePathResolver resolver)
public void dispose()
HierarchyManager
HierarchyManager
dispose
in interface HierarchyManager
HierarchyManager.dispose()
public NodeEntry getRootEntry()
getRootEntry
in interface HierarchyManager
HierarchyManager.getRootEntry()
public HierarchyEntry lookup(ItemId workspaceItemId)
HierarchyManager
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 HierarchyManager.getNodeEntry(NodeId)
or HierarchyManager.getPropertyEntry(PropertyId)
for methods that resolves the
ItemId including lookup in the persistence layer if the entry has not been
loaded yet.
lookup
in interface HierarchyManager
workspaceItemId
.HierarchyManager.lookup(ItemId)
public HierarchyEntry lookup(Path workspacePath)
HierarchyManager
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 HierarchyManager.getNodeEntry(Path)
or HierarchyManager.getPropertyEntry(Path)
for methods that resolves the path
including lookup in the persistence layer if the entry has not been loaded yet.
lookup
in interface HierarchyManager
workspacePath
.HierarchyManager.lookup(Path)
public NodeEntry getNodeEntry(NodeId nodeId) throws javax.jcr.ItemNotFoundException, javax.jcr.RepositoryException
HierarchyManager
HierarchyEntry
.getNodeEntry
in interface HierarchyManager
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
javax.jcr.ItemNotFoundException
HierarchyManager.getNodeEntry(NodeId)
public NodeEntry getNodeEntry(Path qPath) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
HierarchyManager
NodeEntry
.getNodeEntry
in interface HierarchyManager
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
HierarchyManager.getNodeEntry(Path)
public PropertyEntry getPropertyEntry(PropertyId propertyId) throws javax.jcr.ItemNotFoundException, javax.jcr.RepositoryException
HierarchyManager
PropertyEntry
.getPropertyEntry
in interface HierarchyManager
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
javax.jcr.ItemNotFoundException
HierarchyManager.getPropertyEntry(PropertyId)
public PropertyEntry getPropertyEntry(Path qPath) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
HierarchyManager
PropertyEntry
.getPropertyEntry
in interface HierarchyManager
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
HierarchyManager.getPropertyEntry(Path)
public NodeState getNodeState(Path qPath) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
HierarchyManager
NodeEntry
corresponding to the given
path and resolves it to the underlying NodeState
.getNodeState
in interface HierarchyManager
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
HierarchyManager.getNodeState(Path)
public PropertyState getPropertyState(Path qPath) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
HierarchyManager
PropertyEntry
corresponding to the given
path and resolves it to the underlying PropertyState
.getPropertyState
in interface HierarchyManager
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
HierarchyManager.getPropertyState(Path)
public int getDepth(HierarchyEntry hierarchyEntry) throws javax.jcr.ItemNotFoundException, javax.jcr.RepositoryException
HierarchyManager
getDepth
in interface HierarchyManager
javax.jcr.RepositoryException
- if another error occursjavax.jcr.ItemNotFoundException
HierarchyManager.getDepth(HierarchyEntry)
public int getRelativeDepth(NodeEntry ancestor, HierarchyEntry descendant) throws javax.jcr.ItemNotFoundException, javax.jcr.RepositoryException
HierarchyManager
ancestor
and descendant
denote the same item 0 is returned. If ancestor
does not
denote an ancestor -1 is returned.getRelativeDepth
in interface HierarchyManager
ancestor
- NodeEntry that must be an ancestor of the descendantdescendant
- HierarchyEntryancestor
does not
denote an ancestor of the item denoted by descendant
(or itself).javax.jcr.ItemNotFoundException
- If either of the specified id's does not
denote an existing item.javax.jcr.RepositoryException
- If another error occurs.HierarchyManager.getRelativeDepth(NodeEntry, HierarchyEntry)
Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.