org.apache.jackrabbit.core
Class ZombieHierarchyManager

java.lang.Object
  extended byorg.apache.jackrabbit.core.HierarchyManagerImpl
      extended byorg.apache.jackrabbit.core.ZombieHierarchyManager
All Implemented Interfaces:
HierarchyManager

public class ZombieHierarchyManager
extends HierarchyManagerImpl

HierarchyManager implementation that is also able to build/resolve paths of those items that have been moved or removed (i.e. moved to the attic).

todo make use of path caching


Field Summary
protected  ItemStateManager attic
          the attic
 
Fields inherited from class org.apache.jackrabbit.core.HierarchyManagerImpl
nsResolver, provider, rootNodeId
 
Constructor Summary
ZombieHierarchyManager(NodeId rootNodeId, ItemStateManager provider, ItemStateManager attic, NamespaceResolver nsResolver)
           
 
Method Summary
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.

Low-level hook provided for specialized derived classes.

Also allows for removed child node entries.

protected  NodeState.ChildNodeEntry getChildNodeEntry(NodeState parent, QName name, int index)
          Returns the 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.

Also allows for removed/renamed child node entries.

protected  ItemState getItemState(ItemId id)
          Return an item state, given its item id.

Low-level hook provided for specialized derived classes.

Delivers state from attic if such exists, otherwise calls base class.

protected  NodeId getParentId(ItemState state)
          Returns the parentUUID of the given item.

Low-level hook provided for specialized derived classes.

Also allows for removed items.

protected  boolean hasItemState(ItemId id)
          Determines whether an item state for a given item id exists.

Low-level hook provided for specialized derived classes.

Returns true if there's state on the attic for the requested item; otherwise delegates to base class.

 
Methods inherited from class org.apache.jackrabbit.core.HierarchyManagerImpl
buildPath, getDepth, getName, getNamespaceResolver, getPath, getRelativeDepth, getRootNodeId, isAncestor, resolvePath, resolvePath, resolvePath, safeGetJCRPath, safeGetJCRPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attic

protected ItemStateManager attic
the attic

Constructor Detail

ZombieHierarchyManager

public ZombieHierarchyManager(NodeId rootNodeId,
                              ItemStateManager provider,
                              ItemStateManager attic,
                              NamespaceResolver nsResolver)
Method Detail

getItemState

protected ItemState getItemState(ItemId id)
                          throws NoSuchItemStateException,
                                 ItemStateException
Return an item state, given its item id.

Low-level hook provided for specialized derived classes.

Delivers state from attic if such exists, otherwise calls base class.

Overrides:
getItemState in class HierarchyManagerImpl
Parameters:
id - item id
Returns:
item state
Throws:
ItemStateException - if an error occurs
NoSuchItemStateException - if the item does not exist
See Also:
getItemState(ItemId)

hasItemState

protected boolean hasItemState(ItemId id)
Determines whether an item state for a given item id exists.

Low-level hook provided for specialized derived classes.

Returns true if there's state on the attic for the requested item; otherwise delegates to base class.

Overrides:
hasItemState in class HierarchyManagerImpl
Parameters:
id - item id
Returns:
true if an item state exists, otherwise false
See Also:
hasItemState(ItemId)

getParentId

protected NodeId getParentId(ItemState state)
Returns the parentUUID of the given item.

Low-level hook provided for specialized derived classes.

Also allows for removed items.

Overrides:
getParentId in class HierarchyManagerImpl
Parameters:
state - item state
Returns:
parentUUID of the given item
See Also:
getParentId(ItemState)

getChildNodeEntry

protected NodeState.ChildNodeEntry getChildNodeEntry(NodeState parent,
                                                     QName name,
                                                     int index)
Returns the 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.

Also allows for removed/renamed child node entries.

Overrides:
getChildNodeEntry in class HierarchyManagerImpl
Parameters:
parent - node state
name - name of child node entry
index - index of child node entry
Returns:
the ChildNodeEntry of parent with the specified name and index or null if there's no such entry.
See Also:
getChildNodeEntry(NodeState, QName, int)

getChildNodeEntry

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.

Low-level hook provided for specialized derived classes.

Also allows for removed child node entries.

Overrides:
getChildNodeEntry in class HierarchyManagerImpl
Parameters:
parent - node state
id - id of child node entry
Returns:
the ChildNodeEntry of parent with the specified uuid or null if there's no such entry.
See Also:
getChildNodeEntry(NodeState, NodeId)


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