Class NodeEntryImpl
- java.lang.Object
-
- org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntryImpl
-
- All Implemented Interfaces:
HierarchyEntry,NodeEntry
public class NodeEntryImpl extends Object implements NodeEntry
NodeEntryImplimplements common functionality for child node entry implementations.
-
-
Field Summary
Fields Modifier and Type Field Description protected EntryFactoryfactoryThe item state factory to create the item state.protected NamenameThe name of the target item state.protected NodeEntryImplparentHard reference to the parentNodeEntry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NodeEntryaddNewNodeEntry(Name nodeName, String uniqueID, Name primaryNodeType, QNodeDefinition definition)Adds a new, transient childNodeEntryPropertyEntryaddNewPropertyEntry(Name propName, QPropertyDefinition definition, QValue[] values, int propertyType)Add a new, transientPropertyEntryto thisNodeEntryand return thePropertyStateassociated with the new entry.voidcalculateStatus()Calculates the status of the underlyingItemState: any pending changes to the underlyingItemStateare applied.voidcomplete(Operation operation)Clean up this entry uponOperation.undo()orOperation.persisted().booleandenotesNode()Returns true.NodeEntrygetDeepNodeEntry(Path path)Traverse the tree below this entry and return the child entry matching the given path.PropertyEntrygetDeepPropertyEntry(Path path)Traverse the tree below this entry and return the child entry matching the given path.longgetGeneration()The required generation of thisHierarchyEntry.NodeIdgetId()protected IdFactorygetIdFactory()Shortcut forEntryFactory.getIdFactory()intgetIndex()protected EntryFactory.InvalidationStrategygetInvalidationStrategy()ItemStategetItemState()If thisHierarchyEntryhas already been resolved before (seeHierarchyEntry.isAvailable()), thatItemStateis returned.protected TransientItemStateFactorygetItemStateFactory()Shortcut forEntryFactory.getItemStateFactory()NamegetName()Iterator<NodeEntry>getNodeEntries()Returns a unmodifiable iterator ofNodeEntryobjects denoting the the valid child NodeEntries present on thisNodeEntry.List<NodeEntry>getNodeEntries(Name nodeName)Returns a unmodifiable List ofNodeEntrys with the specified name.NodeEntrygetNodeEntry(Name nodeName, int index)Returns the validNodeEntrywith the specified name and index ornullif there's no matching entry.NodeEntrygetNodeEntry(Name nodeName, int index, boolean loadIfNotFound)Returns the validNodeEntrywith the specified name and index ornullif there's no matching entry.NodeStategetNodeState()NodeEntrygetOrAddNodeEntry(Name nodeName, int index, String uniqueID)Adds a child NodeEntry to this entry if it not yet present with this node entry.PropertyEntrygetOrAddPropertyEntry(Name propName)Add an existingPropertyEntrywith the given name if it is not yet contained in thisNodeEntry.NodeEntrygetParent()Returns theNodeEntrybeing parent to thisHierarchyEntry.PathgetPath()protected PathFactorygetPathFactory()Shortcut forEntryFactory.getPathFactory()Iterator<PropertyEntry>getPropertyEntries()Returns an unmodifiable Iterator over those children that represent valid PropertyEntries.PropertyEntrygetPropertyEntry(Name propName)Returns the validPropertyEntrywith the specified name ornullif no matching entry exists.PropertyEntrygetPropertyEntry(Name propName, boolean loadIfNotFound)Ignores theloadIfNotFoundflag due to the fact, thatNodeInfo.getPropertyIds()returns the complete list of property names currently available.intgetStatus()If thisHierarchyEntryprovides an underlyingItemStatethis method returns the status of that state, otherwise it returnsStatus._UNDEFINED_.StringgetUniqueID()NodeIdgetWorkspaceId()Returns the ID that must be used for resolving this entry OR loading its children entries from the persistent layer.PathgetWorkspacePath()booleanhasNodeEntry(Name nodeName)Determines if there is a validNodeEntrywith the specifiednodeName.booleanhasNodeEntry(Name nodeName, int index)Determines if there is a validNodeEntrywith the specifiednameandindex.booleanhasPropertyEntry(Name propName)Determines if there is a property entry with the specifiedName.voidinvalidate(boolean recursive)Invalidates the underlyingItemStateif available and if it is not transiently modified.protected voidinvalidateInternal(boolean recursive)Invalidates the underlyingItemState.booleanisAvailable()Returnstrueif the referencedItemStateis available.booleanisTransientlyMoved()HierarchyEntrylookupDeepEntry(Path workspacePath)Traverse the tree below this entry and return the child entry matching the given 'workspacePath', i.e.NodeEntrymove(Name newName, NodeEntry newParent, boolean transientMove)Moves thisNodeEntryas new child entry of theNodeEntryidentified bynewParentand/or renames it tonewName.voidorderBefore(NodeEntry beforeEntry)Reorders this NodeEntry before the sibling entry specified by the givenbeforeEntry.voidrefresh(Event childEvent)The parent entry of a external event gets informed about the modification.voidreload(boolean recursive)If 'recursive' is true, the complete hierarchy below this entry is traversed and reloaded.voidremove()Removes thisHierarchyEntryfrom its parent and sets the status of the underlying ItemState toStatus.REMOVEDor toStatus.STALE_DESTROYED, respectively.voidrevert()CallsHierarchyEntry.revert()and moves all properties from the attic back into the properties map.voidsetItemState(ItemState state)Set the ItemState this hierarchyEntry will be resolved to.voidsetNodeEntries(Iterator<ChildInfo> childInfos)Creates or updates theChildNodeEntriesof this node.voidsetPropertyEntries(Collection<Name> propNames)Adds property entries for the givenNames.voidsetUniqueID(String uniqueID)voidtransientRemove()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
-
name
protected Name name
The name of the target item state.
-
parent
protected NodeEntryImpl parent
Hard reference to the parentNodeEntry.
-
factory
protected final EntryFactory factory
The item state factory to create the item state.
-
-
Method Detail
-
denotesNode
public boolean denotesNode()
Returns true.- Specified by:
denotesNodein interfaceHierarchyEntry- 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:
reloadin interfaceHierarchyEntry- See Also:
HierarchyEntry.reload(boolean)
-
revert
public void revert() throws RepositoryExceptionCallsHierarchyEntry.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:
revertin interfaceHierarchyEntry- Throws:
RepositoryException- if an error occurs.- See Also:
HierarchyEntry.revert()
-
transientRemove
public void transientRemove() throws RepositoryExceptionTraverses the hierarchy and marks all available item states as transiently removed. They will change their status to eitherStatus.EXISTING_REMOVEDif the item is existing in the persistent storage orStatus.REMOVEDif the item has been transiently added before. In the latter case, the corresponding HierarchyEntries can be removed as well from their parent.- Specified by:
transientRemovein interfaceHierarchyEntry- 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:HierarchyEntryRemoves thisHierarchyEntryfrom its parent and sets the status of the underlying ItemState toStatus.REMOVEDor toStatus.STALE_DESTROYED, respectively. If this entry is a NodeEntry all descending ItemStates must get their status changed as well.- Specified by:
removein interfaceHierarchyEntry- See Also:
HierarchyEntry.remove()
-
complete
public void complete(Operation operation) throws RepositoryException
Description copied from interface:HierarchyEntryClean up this entry uponOperation.undo()orOperation.persisted().- Specified by:
completein interfaceHierarchyEntry- Throws:
RepositoryException- See Also:
HierarchyEntry.complete(Operation)
-
getId
public NodeId getId() throws InvalidItemStateException, RepositoryException
- Specified by:
getIdin interfaceNodeEntry- Returns:
- the
NodeIdof this child node entry. - Throws:
InvalidItemStateExceptionRepositoryException- See Also:
NodeEntry.getId()
-
getWorkspaceId
public NodeId getWorkspaceId() throws InvalidItemStateException, RepositoryException
Description copied from interface:NodeEntryReturns the ID that must be used for resolving this entry OR loading its children entries from the persistent layer. This is the same asgetId()unless this entry or any of its ancestors has been transiently moved.- Specified by:
getWorkspaceIdin interfaceNodeEntry- Returns:
- Throws:
InvalidItemStateExceptionRepositoryException- See Also:
NodeEntry.getWorkspaceId()
-
getUniqueID
public String getUniqueID()
- Specified by:
getUniqueIDin interfaceNodeEntry- Returns:
- the unique ID of the node state which is referenced by this
child node entry or
nullif the node state cannot be identified with a unique ID. - See Also:
NodeEntry.getUniqueID()
-
setUniqueID
public void setUniqueID(String uniqueID)
- Specified by:
setUniqueIDin interfaceNodeEntry- See Also:
NodeEntry.setUniqueID(String)
-
getIndex
public int getIndex() throws InvalidItemStateException, RepositoryException- Specified by:
getIndexin interfaceNodeEntry- Returns:
- the index of this child node entry to support same-name siblings.
If the index of this entry cannot be determined
Path.INDEX_UNDEFINEDis returned. - Throws:
InvalidItemStateExceptionRepositoryException- See Also:
NodeEntry.getIndex()
-
getNodeState
public NodeState getNodeState() throws ItemNotFoundException, RepositoryException
- Specified by:
getNodeStatein interfaceNodeEntry- Returns:
- the referenced
NodeState. - Throws:
ItemNotFoundException- if theNodeStatedoes not exist.RepositoryException- If an error occurs while retrieving theNodeState.- See Also:
NodeEntry.getNodeState()
-
getDeepNodeEntry
public NodeEntry getDeepNodeEntry(Path path) throws PathNotFoundException, RepositoryException
Description copied from interface:NodeEntryTraverse 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:
getDeepNodeEntryin interfaceNodeEntry- Returns:
- the entry at the given path.
- Throws:
PathNotFoundExceptionRepositoryException- See Also:
NodeEntry.getDeepNodeEntry(Path)
-
getDeepPropertyEntry
public PropertyEntry getDeepPropertyEntry(Path path) throws PathNotFoundException, RepositoryException
Description copied from interface:NodeEntryTraverse 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:
getDeepPropertyEntryin interfaceNodeEntry- Returns:
- the property entry at the given path.
- Throws:
PathNotFoundExceptionRepositoryException- See Also:
NodeEntry.getDeepPropertyEntry(Path)
-
lookupDeepEntry
public HierarchyEntry lookupDeepEntry(Path workspacePath)
Description copied from interface:NodeEntryTraverse 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,
nullis return.- Specified by:
lookupDeepEntryin interfaceNodeEntry- Returns:
- matching entry or
null. - See Also:
NodeEntry.lookupDeepEntry(Path)
-
hasNodeEntry
public boolean hasNodeEntry(Name nodeName)
Description copied from interface:NodeEntryDetermines if there is a validNodeEntrywith the specifiednodeName.- Specified by:
hasNodeEntryin interfaceNodeEntry- Parameters:
nodeName-Nameobject specifying a node name- Returns:
trueif there is aNodeEntrywith the specifiednodeName.- See Also:
NodeEntry.hasNodeEntry(Name)
-
hasNodeEntry
public boolean hasNodeEntry(Name nodeName, int index)
Description copied from interface:NodeEntryDetermines if there is a validNodeEntrywith the specifiednameandindex.- Specified by:
hasNodeEntryin interfaceNodeEntry- Parameters:
nodeName-Nameobject specifying a node name.index- 1-based index if there are same-name child node entries.- Returns:
trueif there is aNodeEntrywith the specifiednameandindex.- See Also:
NodeEntry.hasNodeEntry(Name, int)
-
getNodeEntry
public NodeEntry getNodeEntry(Name nodeName, int index) throws RepositoryException
Description copied from interface:NodeEntryReturns the validNodeEntrywith the specified name and index ornullif there's no matching entry.- Specified by:
getNodeEntryin interfaceNodeEntry- Parameters:
nodeName-Nameobject specifying a node name.index- 1-based index if there are same-name child node entries.- Returns:
- The
NodeEntrywith the specified name and index ornullif 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:NodeEntryReturns the validNodeEntrywith the specified name and index ornullif there's no matching entry. IfloadIfNotFoundis 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:
getNodeEntryin interfaceNodeEntry- Parameters:
nodeName-Nameobject specifying a node name.index- 1-based index if there are same-name child node entries.- Returns:
- The
NodeEntrywith the specified name and index ornullif 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:NodeEntryReturns a unmodifiable iterator ofNodeEntryobjects denoting the the valid child NodeEntries present on thisNodeEntry.- Specified by:
getNodeEntriesin interfaceNodeEntry- Returns:
- iterator of
NodeEntryobjects - Throws:
RepositoryException- If an unexpected error occurs.- See Also:
NodeEntry.getNodeEntries()
-
getNodeEntries
public List<NodeEntry> getNodeEntries(Name nodeName) throws RepositoryException
Description copied from interface:NodeEntryReturns a unmodifiable List ofNodeEntrys with the specified name.- Specified by:
getNodeEntriesin interfaceNodeEntry- Parameters:
nodeName- name of the child node entries that should be returned- Returns:
- list of
NodeEntryobjects - 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:NodeEntryCreates or updates theChildNodeEntriesof this node.- Specified by:
setNodeEntriesin interfaceNodeEntry- Throws:
RepositoryException- See Also:
NodeEntry.setNodeEntries(Iterator)
-
getOrAddNodeEntry
public NodeEntry getOrAddNodeEntry(Name nodeName, int index, String uniqueID) throws RepositoryException
Description copied from interface:NodeEntryAdds a child NodeEntry to this entry if it not yet present with this node entry.- Specified by:
getOrAddNodeEntryin interfaceNodeEntry- 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:NodeEntryAdds a new, transient childNodeEntry- Specified by:
addNewNodeEntryin interfaceNodeEntry- 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:NodeEntryDetermines if there is a property entry with the specifiedName.- Specified by:
hasPropertyEntryin interfaceNodeEntry- Parameters:
propName-Nameobject specifying a property name- Returns:
trueif there is a property entry with the specifiedName.- See Also:
NodeEntry.hasPropertyEntry(Name)
-
getPropertyEntry
public PropertyEntry getPropertyEntry(Name propName)
Description copied from interface:NodeEntryReturns the validPropertyEntrywith the specified name ornullif no matching entry exists.- Specified by:
getPropertyEntryin interfaceNodeEntry- Parameters:
propName-Nameobject specifying a property name.- Returns:
- The
PropertyEntrywith the specified name ornullif no matching entry exists. - See Also:
NodeEntry.getPropertyEntry(Name)
-
getPropertyEntry
public PropertyEntry getPropertyEntry(Name propName, boolean loadIfNotFound) throws RepositoryException
Ignores theloadIfNotFoundflag due to the fact, thatNodeInfo.getPropertyIds()returns the complete list of property names currently available.- Specified by:
getPropertyEntryin interfaceNodeEntry- Parameters:
propName-Nameobject specifying a property name.- Returns:
- The
PropertyEntrywith the specified name ornullif 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:NodeEntryReturns an unmodifiable Iterator over those children that represent valid PropertyEntries.- Specified by:
getPropertyEntriesin interfaceNodeEntry- 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:NodeEntryAdd an existingPropertyEntrywith the given name if it is not yet contained in thisNodeEntry. Please note the difference toNodeEntry.addNewPropertyEntry(Name, QPropertyDefinition, QValue[], int)which adds a new, transient entry.- Specified by:
getOrAddPropertyEntryin interfaceNodeEntry- 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:NodeEntryAdds property entries for the givenNames. It depends on the status of thisNodeEntry, how conflicts are resolved and whether or not existing entries that are missing in the iterator get removed.- Specified by:
setPropertyEntriesin interfaceNodeEntry- Throws:
ItemExistsExceptionRepositoryException- 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:NodeEntryAdd a new, transientPropertyEntryto thisNodeEntryand return thePropertyStateassociated with the new entry.- Specified by:
addNewPropertyEntryin interfaceNodeEntry- Returns:
- the new entry.
- Throws:
ItemExistsExceptionRepositoryException- See Also:
NodeEntry.addNewPropertyEntry(Name, QPropertyDefinition, QValue[], int)
-
orderBefore
public void orderBefore(NodeEntry beforeEntry) throws RepositoryException
Description copied from interface:NodeEntryReorders this NodeEntry before the sibling entry specified by the givenbeforeEntry.- Specified by:
orderBeforein interfaceNodeEntry- Parameters:
beforeEntry- the child node where to insert the node before. Ifnullthis 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:NodeEntryMoves thisNodeEntryas new child entry of theNodeEntryidentified bynewParentand/or renames it tonewName. IftransientMoveis true, an implementation must make sure, that reverting this modification by callingHierarchyEntry.revert()on the common ancestor of both parents moves this NodeEntry back and resets the name to its original value.- Specified by:
movein interfaceNodeEntry- 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:
isTransientlyMovedin interfaceNodeEntry- Returns:
- true if this
NodeEntryis transiently moved. - See Also:
NodeEntry.isTransientlyMoved()
-
refresh
public void refresh(Event childEvent)
Description copied from interface:NodeEntryThe parent entry of a external event gets informed about the modification. Note, thatEvent.getParentId()of the given childEvent must point to thisNodeEntry.- Specified by:
refreshin interfaceNodeEntry- See Also:
NodeEntry.refresh(Event)
-
invalidateInternal
protected void invalidateInternal(boolean recursive)
Invalidates the underlyingItemState. Ifrecursiveis true also invalidates the underlying item states of all child entries.
-
getItemStateFactory
protected TransientItemStateFactory getItemStateFactory()
Shortcut forEntryFactory.getItemStateFactory()- Returns:
-
getPathFactory
protected PathFactory getPathFactory()
Shortcut forEntryFactory.getPathFactory()- Returns:
-
getIdFactory
protected IdFactory getIdFactory()
Shortcut forEntryFactory.getIdFactory()- Returns:
-
getInvalidationStrategy
protected EntryFactory.InvalidationStrategy getInvalidationStrategy()
-
getName
public Name getName()
- Specified by:
getNamein interfaceHierarchyEntry- Returns:
- the name of this hierarchy entry.
- See Also:
HierarchyEntry.getName()
-
getPath
public Path getPath() throws RepositoryException
- Specified by:
getPathin interfaceHierarchyEntry- Returns:
- the path of this hierarchy entry.
- Throws:
RepositoryException- See Also:
HierarchyEntry.getPath()
-
getWorkspacePath
public Path getWorkspacePath() throws RepositoryException
- Specified by:
getWorkspacePathin interfaceHierarchyEntry- 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:HierarchyEntryReturns theNodeEntrybeing parent to thisHierarchyEntry.- Specified by:
getParentin interfaceHierarchyEntry- Returns:
- the parent
HierarchyEntry - See Also:
HierarchyEntry.getParent()
-
getStatus
public int getStatus()
Description copied from interface:HierarchyEntryIf thisHierarchyEntryprovides an underlyingItemStatethis method returns the status of that state, otherwise it returnsStatus._UNDEFINED_.- Specified by:
getStatusin interfaceHierarchyEntry- 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:HierarchyEntryReturnstrueif the referencedItemStateis available. That is, the referencedItemStatehas already been resolved.
Note, that the validity of the ItemState is not checked.- Specified by:
isAvailablein interfaceHierarchyEntry- Returns:
trueif theItemStateis available; otherwisefalse.- See Also:
HierarchyEntry.isAvailable()
-
getItemState
public ItemState getItemState() throws ItemNotFoundException, RepositoryException
If thisHierarchyEntryhas already been resolved before (seeHierarchyEntry.isAvailable()), thatItemStateis 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 accessibleItemStateor if the corresponding state has been removed in the mean time.- Specified by:
getItemStatein interfaceHierarchyEntry- Returns:
- the referenced
ItemState. - Throws:
ItemNotFoundException- if theItemStatedoes not exist anymore.RepositoryException- If an error occurs while retrieving theItemState.- See Also:
HierarchyEntry.getItemState()
-
setItemState
public void setItemState(ItemState state)
Set the ItemState this hierarchyEntry will be resolved to.- Specified by:
setItemStatein interfaceHierarchyEntry- See Also:
HierarchyEntry.setItemState(ItemState)
-
invalidate
public void invalidate(boolean recursive)
Invalidates the underlyingItemStateif available and if it is not transiently modified. If therecursiveflag is true, also invalidates the child entries recursively.
Note, that in contrast toHierarchyEntry.reload(boolean)this method only sets the status of this item state toStatus.INVALIDATEDand does not actually update it with the persistent state in the repository.- Specified by:
invalidatein interfaceHierarchyEntry- See Also:
HierarchyEntry.invalidate(boolean)
-
calculateStatus
public void calculateStatus()
Description copied from interface:HierarchyEntryCalculates the status of the underlyingItemState: any pending changes to the underlyingItemStateare applied.- Specified by:
calculateStatusin interfaceHierarchyEntry
-
getGeneration
public long getGeneration()
Description copied from interface:HierarchyEntryThe required generation of thisHierarchyEntry. This is used by theItemInfoCacheto determine whether 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:
getGenerationin interfaceHierarchyEntry
-
-