org.apache.jackrabbit.jcr2spi.hierarchy
Class NodeEntryImpl

java.lang.Object
  extended by org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntryImpl
All Implemented Interfaces:
HierarchyEntry, NodeEntry

public class NodeEntryImpl
extends Object
implements NodeEntry

NodeEntryImpl implements common functionality for child node entry implementations.


Field Summary
protected  EntryFactory factory
          The item state factory to create the item state.
 long generation
          The required generation of this entry.
protected  Name name
          The name of the target item state.
protected  NodeEntryImpl parent
          Hard reference to the parent NodeEntry.
 
Method Summary
 NodeEntry addNewNodeEntry(Name nodeName, String uniqueID, Name primaryNodeType, QNodeDefinition definition)
          Adds a new, transient child NodeEntry
 PropertyEntry addNewPropertyEntry(Name propName, QPropertyDefinition definition, QValue[] values, int propertyType)
          Add a new, transient PropertyEntry to this NodeEntry and return the PropertyState associated with the new entry.
 void calculateStatus()
          Calculates the status of the underlying ItemState: any pending changes to the underlying ItemState are applied.
 void complete(Operation operation)
          Clean up this entry upon Operation.undo() or Operation.persisted().
 boolean denotesNode()
          Returns true.
 NodeEntry getDeepNodeEntry(Path path)
          Traverse the tree below this entry and return the child entry matching the given path.
 PropertyEntry getDeepPropertyEntry(Path path)
          Traverse the tree below this entry and return the child entry matching the given path.
 long getGeneration()
          The required generation of this HierarchyEntry .
 NodeId getId()
           
protected  IdFactory getIdFactory()
          Shortcut for EntryFactory.getIdFactory()
 int getIndex()
           
protected  EntryFactory.InvalidationStrategy getInvalidationStrategy()
           
 ItemState getItemState()
          If this HierarchyEntry has already been resolved before (see HierarchyEntry.isAvailable()), that ItemState is returned.
protected  TransientItemStateFactory getItemStateFactory()
          Shortcut for EntryFactory.getItemStateFactory()
 Name getName()
           
 Iterator<NodeEntry> getNodeEntries()
          Returns a unmodifiable iterator of NodeEntry objects denoting the the valid child NodeEntries present on this NodeEntry.
 List<NodeEntry> getNodeEntries(Name nodeName)
          Returns a unmodifiable List of NodeEntrys with the specified name.
 NodeEntry getNodeEntry(Name nodeName, int index)
          Returns the valid NodeEntry with the specified name and index or null if there's no matching entry.
 NodeEntry getNodeEntry(Name nodeName, int index, boolean loadIfNotFound)
          Returns the valid NodeEntry with the specified name and index or null if there's no matching entry.
 NodeState getNodeState()
           
 NodeEntry getOrAddNodeEntry(Name nodeName, int index, String uniqueID)
          Adds a child NodeEntry to this entry if it not yet present with this node entry.
 PropertyEntry getOrAddPropertyEntry(Name propName)
          Add an existing PropertyEntry with the given name if it is not yet contained in this NodeEntry.
 NodeEntry getParent()
          Returns the NodeEntry being parent to this HierarchyEntry.
 Path getPath()
           
protected  PathFactory getPathFactory()
          Shortcut for EntryFactory.getPathFactory()
 Iterator<PropertyEntry> getPropertyEntries()
          Returns an unmodifiable Iterator over those children that represent valid PropertyEntries.
 PropertyEntry getPropertyEntry(Name propName)
          Returns the valid PropertyEntry with the specified name or null if no matching entry exists.
 PropertyEntry getPropertyEntry(Name propName, boolean loadIfNotFound)
          Ignores the loadIfNotFound flag due to the fact, that NodeInfo.getPropertyIds() returns the complete list of property names currently available.
 int getStatus()
          If this HierarchyEntry provides an underlying ItemState this method returns the status of that state, otherwise it returns Status._UNDEFINED_.
 String getUniqueID()
           
 NodeId getWorkspaceId()
          Returns the ID that must be used for resolving this entry OR loading its children entries from the persistent layer.
 Path getWorkspacePath()
           
 boolean hasNodeEntry(Name nodeName)
          Determines if there is a valid NodeEntry with the specified nodeName.
 boolean hasNodeEntry(Name nodeName, int index)
          Determines if there is a valid NodeEntry with the specified name and index.
 boolean hasPropertyEntry(Name propName)
          Determines if there is a property entry with the specified Name.
 void invalidate(boolean recursive)
          Invalidates the underlying ItemState if available and if it is not transiently modified.
protected  void invalidateInternal(boolean recursive)
          Invalidates the underlying ItemState.
 boolean isAvailable()
          Returns true if the referenced ItemState is available.
 boolean isTransientlyMoved()
           
 HierarchyEntry lookupDeepEntry(Path workspacePath)
          Traverse the tree below this entry and return the child entry matching the given 'workspacePath', i.e. transient modifications and new entries are ignored.
 NodeEntry move(Name newName, NodeEntry newParent, boolean transientMove)
          Moves this NodeEntry as new child entry of the NodeEntry identified by newParent and/or renames it to newName.
 void orderBefore(NodeEntry beforeEntry)
          Reorders this NodeEntry before the sibling entry specified by the given beforeEntry.
 void refresh(Event childEvent)
          The parent entry of a external event gets informed about the modification.
 void reload(boolean recursive)
          If 'recursive' is true, the complete hierarchy below this entry is traversed and reloaded.
 void remove()
          Removes this HierarchyEntry from its parent and sets the status of the underlying ItemState to Status.REMOVED or to Status.STALE_DESTROYED, respectively.
 void revert()
          Calls HierarchyEntryImpl.revert() and moves all properties from the attic back into the properties map.
 void setItemState(ItemState state)
          Set the ItemState this hierarchyEntry will be resolved to.
 void setNodeEntries(Iterator<ChildInfo> childInfos)
          Creates or updates the ChildNodeEntries of this node.
 void setPropertyEntries(Collection<Name> propNames)
          Adds property entries for the given Names.
 void setUniqueID(String uniqueID)
           
 void transientRemove()
          Traverses the hierarchy and marks all available item states as transiently removed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntry
calculateStatus, getGeneration, getItemState, getName, getParent, getPath, getStatus, getWorkspacePath, invalidate, isAvailable, setItemState
 

Field Detail

generation

public long generation
The required generation of this entry. This is used by the ItemInfoCache to determine wheter an item info in the cache is up to date or not. That is whether the generation of the item info in the cache is the same or more recent as the required generation of this entry.


name

protected Name name
The name of the target item state.


parent

protected NodeEntryImpl parent
Hard reference to the parent NodeEntry.


factory

protected final EntryFactory factory
The item state factory to create the item state.

Method Detail

denotesNode

public boolean denotesNode()
Returns true.

Specified by:
denotesNode in interface HierarchyEntry
Returns:
See Also:
HierarchyEntry.denotesNode()

reload

public void reload(boolean recursive)
If 'recursive' is true, the complete hierarchy below this entry is traversed and reloaded. Otherwise only this entry and the direct descendants are reloaded.

Specified by:
reload in interface HierarchyEntry
See Also:
HierarchyEntry.reload(boolean)

revert

public void revert()
            throws RepositoryException
Calls HierarchyEntryImpl.revert() and moves all properties from the attic back into the properties map. If this HierarchyEntry has been transiently moved, it is in addition moved back to its old parent. Similarly reordering of child node entries is reverted.

Specified by:
revert in interface HierarchyEntry
Throws:
RepositoryException - if an error occurs.
See Also:
HierarchyEntry.revert()

transientRemove

public void transientRemove()
                     throws RepositoryException
Traverses the hierarchy and marks all available item states as transiently removed. They will change their status to either Status.EXISTING_REMOVED if the item is existing in the persistent storage or Status.REMOVED if the item has been transiently added before. In the latter case, the corresponding HierarchyEntries can be removed as well from their parent.

Specified by:
transientRemove in interface HierarchyEntry
Throws:
InvalidItemStateException - if this entry has been removed in the mean time.
RepositoryException - if an error occurs while removing any of the item states e.g. an item state is not valid anymore.
See Also:
HierarchyEntry.transientRemove()

remove

public void remove()
Description copied from interface: HierarchyEntry
Removes this HierarchyEntry from its parent and sets the status of the underlying ItemState to Status.REMOVED or to Status.STALE_DESTROYED, respectively. If this entry is a NodeEntry all descending ItemStates must get their status changed as well.

Specified by:
remove in interface HierarchyEntry
See Also:
HierarchyEntry.remove()

complete

public void complete(Operation operation)
              throws RepositoryException
Description copied from interface: HierarchyEntry
Clean up this entry upon Operation.undo() or Operation.persisted().

Specified by:
complete in interface HierarchyEntry
Throws:
RepositoryException
See Also:
HierarchyEntry.complete(Operation)

getId

public NodeId getId()
             throws InvalidItemStateException,
                    RepositoryException
Specified by:
getId in interface NodeEntry
Returns:
the NodeId of this child node entry.
Throws:
InvalidItemStateException
RepositoryException
See Also:
NodeEntry.getId()

getWorkspaceId

public NodeId getWorkspaceId()
                      throws InvalidItemStateException,
                             RepositoryException
Description copied from interface: NodeEntry
Returns the ID that must be used for resolving this entry OR loading its children entries from the persistent layer. This is the same as getId() unless this entry or any of its ancestors has been transiently moved.

Specified by:
getWorkspaceId in interface NodeEntry
Returns:
Throws:
InvalidItemStateException
RepositoryException
See Also:
NodeEntry.getWorkspaceId()

getUniqueID

public String getUniqueID()
Specified by:
getUniqueID in interface NodeEntry
Returns:
the unique ID of the node state which is referenced by this child node entry or null if the node state cannot be identified with a unique ID.
See Also:
NodeEntry.getUniqueID()

setUniqueID

public void setUniqueID(String uniqueID)
Specified by:
setUniqueID in interface NodeEntry
See Also:
NodeEntry.setUniqueID(String)

getIndex

public int getIndex()
             throws InvalidItemStateException,
                    RepositoryException
Specified by:
getIndex in interface NodeEntry
Returns:
the index of this child node entry to suppport same-name siblings. If the index of this entry cannot be determined Path.INDEX_UNDEFINED is returned.
Throws:
InvalidItemStateException
RepositoryException
See Also:
NodeEntry.getIndex()

getNodeState

public NodeState getNodeState()
                       throws ItemNotFoundException,
                              RepositoryException
Specified by:
getNodeState in interface NodeEntry
Returns:
the referenced NodeState.
Throws:
ItemNotFoundException - if the NodeState does not exist.
RepositoryException - If an error occurs while retrieving the NodeState.
See Also:
NodeEntry.getNodeState()

getDeepNodeEntry

public NodeEntry getDeepNodeEntry(Path path)
                           throws PathNotFoundException,
                                  RepositoryException
Description copied from interface: NodeEntry
Traverse the tree below this entry and return the child entry matching the given path. If that entry has not been loaded yet, try to do so. NOTE: In contrast to getNodeEntry, getNodeEntries this method may return invalid entries, i.e. entries connected to a removed or stale ItemState.

Specified by:
getDeepNodeEntry in interface NodeEntry
Returns:
the entry at the given path.
Throws:
PathNotFoundException
RepositoryException
See Also:
NodeEntry.getDeepNodeEntry(Path)

getDeepPropertyEntry

public PropertyEntry getDeepPropertyEntry(Path path)
                                   throws PathNotFoundException,
                                          RepositoryException
Description copied from interface: NodeEntry
Traverse the tree below this entry and return the child entry matching the given path. If that entry has not been loaded yet, try to do so. NOTE: In contrast to getPropertyEntry and getPropertyEntries this method may return invalid entries, i.e. entries connected to a removed or stale ItemState.

Specified by:
getDeepPropertyEntry in interface NodeEntry
Returns:
the property entry at the given path.
Throws:
PathNotFoundException
RepositoryException
See Also:
NodeEntry.getDeepPropertyEntry(Path)

lookupDeepEntry

public HierarchyEntry lookupDeepEntry(Path workspacePath)
Description copied from interface: NodeEntry
Traverse the tree below this entry and return the child entry matching the given 'workspacePath', i.e. transient modifications and new entries are ignored.

If no matching entry can be found, null is return.

Specified by:
lookupDeepEntry in interface NodeEntry
Returns:
matching entry or null.
See Also:
NodeEntry.lookupDeepEntry(Path)

hasNodeEntry

public boolean hasNodeEntry(Name nodeName)
Description copied from interface: NodeEntry
Determines if there is a valid NodeEntry with the specified nodeName.

Specified by:
hasNodeEntry in interface NodeEntry
Parameters:
nodeName - Name object specifying a node name
Returns:
true if there is a NodeEntry with the specified nodeName.
See Also:
NodeEntry.hasNodeEntry(Name)

hasNodeEntry

public boolean hasNodeEntry(Name nodeName,
                            int index)
Description copied from interface: NodeEntry
Determines if there is a valid NodeEntry with the specified name and index.

Specified by:
hasNodeEntry in interface NodeEntry
Parameters:
nodeName - Name object specifying a node name.
index - 1-based index if there are same-name child node entries.
Returns:
true if there is a NodeEntry with the specified name and index.
See Also:
NodeEntry.hasNodeEntry(Name, int)

getNodeEntry

public NodeEntry getNodeEntry(Name nodeName,
                              int index)
                       throws RepositoryException
Description copied from interface: NodeEntry
Returns the valid NodeEntry with the specified name and index or null if there's no matching entry.

Specified by:
getNodeEntry in interface NodeEntry
Parameters:
nodeName - Name object specifying a node name.
index - 1-based index if there are same-name child node entries.
Returns:
The NodeEntry with the specified name and index or null if there's no matching entry.
Throws:
RepositoryException - If an unexpected error occurs.
See Also:
NodeEntry.getNodeEntry(Name, int)

getNodeEntry

public NodeEntry getNodeEntry(Name nodeName,
                              int index,
                              boolean loadIfNotFound)
                       throws RepositoryException
Description copied from interface: NodeEntry
Returns the valid NodeEntry with the specified name and index or null if there's no matching entry. If loadIfNotFound is true, the implementation must make sure, that it's list of child entries is up to date and eventually try to load the node entry.

Specified by:
getNodeEntry in interface NodeEntry
Parameters:
nodeName - Name object specifying a node name.
index - 1-based index if there are same-name child node entries.
Returns:
The NodeEntry with the specified name and index or null if there's no matching entry.
Throws:
RepositoryException - If an unexpected error occurs.
See Also:
NodeEntry.getNodeEntry(Name, int, boolean)

getNodeEntries

public Iterator<NodeEntry> getNodeEntries()
                                   throws RepositoryException
Description copied from interface: NodeEntry
Returns a unmodifiable iterator of NodeEntry objects denoting the the valid child NodeEntries present on this NodeEntry.

Specified by:
getNodeEntries in interface NodeEntry
Returns:
iterator of NodeEntry objects
Throws:
RepositoryException - If an unexpected error occurs.
See Also:
NodeEntry.getNodeEntries()

getNodeEntries

public List<NodeEntry> getNodeEntries(Name nodeName)
                               throws RepositoryException
Description copied from interface: NodeEntry
Returns a unmodifiable List of NodeEntrys with the specified name.

Specified by:
getNodeEntries in interface NodeEntry
Parameters:
nodeName - name of the child node entries that should be returned
Returns:
list of NodeEntry objects
Throws:
RepositoryException - If an unexpected error occurs.
See Also:
NodeEntry.getNodeEntries(Name)

setNodeEntries

public void setNodeEntries(Iterator<ChildInfo> childInfos)
                    throws RepositoryException
Description copied from interface: NodeEntry
Creates or updates the ChildNodeEntries of this node.

Specified by:
setNodeEntries in interface NodeEntry
Throws:
RepositoryException
See Also:
NodeEntry.setNodeEntries(Iterator)

getOrAddNodeEntry

public NodeEntry getOrAddNodeEntry(Name nodeName,
                                   int index,
                                   String uniqueID)
                            throws RepositoryException
Description copied from interface: NodeEntry
Adds a child NodeEntry to this entry if it not yet present with this node entry.

Specified by:
getOrAddNodeEntry in interface NodeEntry
Returns:
the NodeEntry.
Throws:
RepositoryException - If an unexpected error occurs.
See Also:
NodeEntry.getOrAddNodeEntry(Name, int, String)

addNewNodeEntry

public NodeEntry addNewNodeEntry(Name nodeName,
                                 String uniqueID,
                                 Name primaryNodeType,
                                 QNodeDefinition definition)
                          throws RepositoryException
Description copied from interface: NodeEntry
Adds a new, transient child NodeEntry

Specified by:
addNewNodeEntry in interface NodeEntry
Returns:
Throws:
RepositoryException - If an error occurs.
See Also:
NodeEntry.addNewNodeEntry(Name, String, Name, QNodeDefinition)

hasPropertyEntry

public boolean hasPropertyEntry(Name propName)
Description copied from interface: NodeEntry
Determines if there is a property entry with the specified Name.

Specified by:
hasPropertyEntry in interface NodeEntry
Parameters:
propName - Name object specifying a property name
Returns:
true if there is a property entry with the specified Name.
See Also:
NodeEntry.hasPropertyEntry(Name)

getPropertyEntry

public PropertyEntry getPropertyEntry(Name propName)
Description copied from interface: NodeEntry
Returns the valid PropertyEntry with the specified name or null if no matching entry exists.

Specified by:
getPropertyEntry in interface NodeEntry
Parameters:
propName - Name object specifying a property name.
Returns:
The PropertyEntry with the specified name or null if no matching entry exists.
See Also:
NodeEntry.getPropertyEntry(Name)

getPropertyEntry

public PropertyEntry getPropertyEntry(Name propName,
                                      boolean loadIfNotFound)
                               throws RepositoryException
Ignores the loadIfNotFound flag due to the fact, that NodeInfo.getPropertyIds() returns the complete list of property names currently available.

Specified by:
getPropertyEntry in interface NodeEntry
Parameters:
propName - Name object specifying a property name.
Returns:
The PropertyEntry with the specified name or null if no matching entry exists.
Throws:
RepositoryException - If an unexpected error occurs.
See Also:
NodeEntry.getPropertyEntry(Name, boolean)

getPropertyEntries

public Iterator<PropertyEntry> getPropertyEntries()
Description copied from interface: NodeEntry
Returns an unmodifiable Iterator over those children that represent valid PropertyEntries.

Specified by:
getPropertyEntries in interface NodeEntry
Returns:
an unmodifiable Iterator over those children that represent valid PropertyEntries.
See Also:
NodeEntry.getPropertyEntries()

getOrAddPropertyEntry

public PropertyEntry getOrAddPropertyEntry(Name propName)
                                    throws ItemExistsException
Description copied from interface: NodeEntry
Add an existing PropertyEntry with the given name if it is not yet contained in this NodeEntry. Please note the difference to NodeEntry.addNewPropertyEntry(Name, QPropertyDefinition, QValue[], int) which adds a new, transient entry.

Specified by:
getOrAddPropertyEntry in interface NodeEntry
Returns:
the PropertyEntry
Throws:
ItemExistsException - if a child item exists with the given name
See Also:
NodeEntry.getOrAddPropertyEntry(Name)

setPropertyEntries

public void setPropertyEntries(Collection<Name> propNames)
                        throws ItemExistsException,
                               RepositoryException
Description copied from interface: NodeEntry
Adds property entries for the given Names. It depends on the status of this NodeEntry, how conflicts are resolved and whether or not existing entries that are missing in the iterator get removed.

Specified by:
setPropertyEntries in interface NodeEntry
Throws:
ItemExistsException
RepositoryException - if an unexpected error occurs.
See Also:
NodeEntry.setPropertyEntries(Collection)

addNewPropertyEntry

public PropertyEntry addNewPropertyEntry(Name propName,
                                         QPropertyDefinition definition,
                                         QValue[] values,
                                         int propertyType)
                                  throws ItemExistsException,
                                         RepositoryException
Description copied from interface: NodeEntry
Add a new, transient PropertyEntry to this NodeEntry and return the PropertyState associated with the new entry.

Specified by:
addNewPropertyEntry in interface NodeEntry
Returns:
the new entry.
Throws:
ItemExistsException
RepositoryException
See Also:
NodeEntry.addNewPropertyEntry(Name, QPropertyDefinition, QValue[], int)

orderBefore

public void orderBefore(NodeEntry beforeEntry)
                 throws RepositoryException
Description copied from interface: NodeEntry
Reorders this NodeEntry before the sibling entry specified by the given beforeEntry.

Specified by:
orderBefore in interface NodeEntry
Parameters:
beforeEntry - the child node where to insert the node before. If null this entry is moved to the end of its parents child node entries.
Throws:
RepositoryException - If an unexpected error occurs.
See Also:
NodeEntry.orderBefore(NodeEntry)

move

public NodeEntry move(Name newName,
                      NodeEntry newParent,
                      boolean transientMove)
               throws RepositoryException
Description copied from interface: NodeEntry
Moves this NodeEntry as new child entry of the NodeEntry identified by newParent and/or renames it to newName. If transientMove is true, an implementation must make sure, that reverting this modification by calling HierarchyEntry.revert() on the common ancestor of both parents moves this NodeEntry back and resets the name to its original value.

Specified by:
move in interface NodeEntry
Returns:
the moved entry
Throws:
RepositoryException - If the entry to be moved is not a child of this NodeEntry or if an unexpected error occurs.
See Also:
NodeEntry.move(Name, NodeEntry, boolean)

isTransientlyMoved

public boolean isTransientlyMoved()
Specified by:
isTransientlyMoved in interface NodeEntry
Returns:
true if this NodeEntry is transiently moved.
See Also:
NodeEntry.isTransientlyMoved()

refresh

public void refresh(Event childEvent)
Description copied from interface: NodeEntry
The parent entry of a external event gets informed about the modification. Note, that Event.getParentId() of the given childEvent must point to this NodeEntry.

Specified by:
refresh in interface NodeEntry
See Also:
NodeEntry.refresh(Event)

invalidateInternal

protected void invalidateInternal(boolean recursive)
Invalidates the underlying ItemState. If recursive is true also invalidates the underlying item states of all child entries.


getItemStateFactory

protected TransientItemStateFactory getItemStateFactory()
Shortcut for EntryFactory.getItemStateFactory()

Returns:

getPathFactory

protected PathFactory getPathFactory()
Shortcut for EntryFactory.getPathFactory()

Returns:

getIdFactory

protected IdFactory getIdFactory()
Shortcut for EntryFactory.getIdFactory()

Returns:

getInvalidationStrategy

protected EntryFactory.InvalidationStrategy getInvalidationStrategy()

getName

public Name getName()
Specified by:
getName in interface HierarchyEntry
Returns:
the name of this hierarchy entry.
See Also:
HierarchyEntry.getName()

getPath

public Path getPath()
             throws RepositoryException
Specified by:
getPath in interface HierarchyEntry
Returns:
the path of this hierarchy entry.
Throws:
RepositoryException
See Also:
HierarchyEntry.getPath()

getWorkspacePath

public Path getWorkspacePath()
                      throws RepositoryException
Specified by:
getWorkspacePath in interface HierarchyEntry
Returns:
If this entry has not been modified this method returns the same as HierarchyEntry.getPath(). In case of moved items this method return the original path as it is present on the persistent layer.
Throws:
RepositoryException
See Also:
HierarchyEntry.getWorkspacePath()

getParent

public NodeEntry getParent()
Description copied from interface: HierarchyEntry
Returns the NodeEntry being parent to this HierarchyEntry.

Specified by:
getParent in interface HierarchyEntry
Returns:
the parent HierarchyEntry
See Also:
HierarchyEntry.getParent()

getStatus

public int getStatus()
Description copied from interface: HierarchyEntry
If this HierarchyEntry provides an underlying ItemState this method returns the status of that state, otherwise it returns Status._UNDEFINED_.

Specified by:
getStatus in interface HierarchyEntry
Returns:
Status of the ItemState or Status._UNDEFINED_ if this entry has not been resolved yet.
See Also:
HierarchyEntry.getStatus()

isAvailable

public boolean isAvailable()
Description copied from interface: HierarchyEntry
Returns true if the referenced ItemState is available. That is, the referenced ItemState has already been resolved.
Note, that the validity of the ItemState is not checked.

Specified by:
isAvailable in interface HierarchyEntry
Returns:
true if the ItemState is available; otherwise false.
See Also:
HierarchyEntry.isAvailable()

getItemState

public ItemState getItemState()
                       throws ItemNotFoundException,
                              RepositoryException
If this HierarchyEntry has already been resolved before (see HierarchyEntry.isAvailable()), that ItemState is returned. Note however, that the validity of the State is not asserted.
If the entry has not been resolved yet an attempt is made to resolve this entry, which may fail if there exists no accessible ItemState or if the corresponding state has been removed in the mean time.

Specified by:
getItemState in interface HierarchyEntry
Returns:
the referenced ItemState.
Throws:
ItemNotFoundException - if the ItemState does not exist anymore.
RepositoryException - If an error occurs while retrieving the ItemState.
See Also:
HierarchyEntry.getItemState()

setItemState

public void setItemState(ItemState state)
Set the ItemState this hierarchyEntry will be resolved to.

Specified by:
setItemState in interface HierarchyEntry
See Also:
HierarchyEntry.setItemState(ItemState)

invalidate

public void invalidate(boolean recursive)
Invalidates the underlying ItemState if available and if it is not transiently modified. If the recursive flag is true, also invalidates the child entries recursively.
Note, that in contrast to HierarchyEntry.reload(boolean) this method only sets the status of this item state to Status.INVALIDATED and does not actually update it with the persistent state in the repository.

Specified by:
invalidate in interface HierarchyEntry
See Also:
HierarchyEntry.invalidate(boolean)

calculateStatus

public void calculateStatus()
Description copied from interface: HierarchyEntry
Calculates the status of the underlying ItemState: any pending changes to the underlying ItemState are applied.

Specified by:
calculateStatus in interface HierarchyEntry

getGeneration

public long getGeneration()
Description copied from interface: HierarchyEntry
The required generation of this HierarchyEntry . This is used by the ItemInfoCache to determine wheter an item info in the cache is up to date or not. That is whether the generation of the item info in the cache is the same or more recent as the required generation of this entry.

Specified by:
getGeneration in interface HierarchyEntry


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