Class NodeEntryImpl
- java.lang.Object
-
- 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
Fields Modifier and Type Field Description protected EntryFactory
factory
The item state factory to create the item state.protected Name
name
The name of the target item state.protected NodeEntryImpl
parent
Hard reference to the parentNodeEntry
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NodeEntry
addNewNodeEntry(Name nodeName, String uniqueID, Name primaryNodeType, QNodeDefinition definition)
Adds a new, transient childNodeEntry
PropertyEntry
addNewPropertyEntry(Name propName, QPropertyDefinition definition, QValue[] values, int propertyType)
Add a new, transientPropertyEntry
to thisNodeEntry
and return thePropertyState
associated with the new entry.void
calculateStatus()
Calculates the status of the underlyingItemState
: any pending changes to the underlyingItemState
are applied.void
complete(Operation operation)
Clean up this entry uponOperation.undo()
orOperation.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 thisHierarchyEntry
.NodeId
getId()
protected IdFactory
getIdFactory()
Shortcut forEntryFactory.getIdFactory()
int
getIndex()
protected EntryFactory.InvalidationStrategy
getInvalidationStrategy()
ItemState
getItemState()
If thisHierarchyEntry
has already been resolved before (seeHierarchyEntry.isAvailable()
), thatItemState
is returned.protected TransientItemStateFactory
getItemStateFactory()
Shortcut forEntryFactory.getItemStateFactory()
Name
getName()
Iterator<NodeEntry>
getNodeEntries()
Returns a unmodifiable iterator ofNodeEntry
objects denoting the the valid child NodeEntries present on thisNodeEntry
.List<NodeEntry>
getNodeEntries(Name nodeName)
Returns a unmodifiable List ofNodeEntry
s with the specified name.NodeEntry
getNodeEntry(Name nodeName, int index)
Returns the validNodeEntry
with the specified name and index ornull
if there's no matching entry.NodeEntry
getNodeEntry(Name nodeName, int index, boolean loadIfNotFound)
Returns the validNodeEntry
with the specified name and index ornull
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 existingPropertyEntry
with the given name if it is not yet contained in thisNodeEntry
.NodeEntry
getParent()
Returns theNodeEntry
being parent to thisHierarchyEntry
.Path
getPath()
protected PathFactory
getPathFactory()
Shortcut forEntryFactory.getPathFactory()
Iterator<PropertyEntry>
getPropertyEntries()
Returns an unmodifiable Iterator over those children that represent valid PropertyEntries.PropertyEntry
getPropertyEntry(Name propName)
Returns the validPropertyEntry
with the specified name ornull
if no matching entry exists.PropertyEntry
getPropertyEntry(Name propName, boolean loadIfNotFound)
Ignores theloadIfNotFound
flag due to the fact, thatNodeInfo.getPropertyIds()
returns the complete list of property names currently available.int
getStatus()
If thisHierarchyEntry
provides an underlyingItemState
this method returns the status of that state, otherwise it returnsStatus._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 validNodeEntry
with the specifiednodeName
.boolean
hasNodeEntry(Name nodeName, int index)
Determines if there is a validNodeEntry
with the specifiedname
andindex
.boolean
hasPropertyEntry(Name propName)
Determines if there is a property entry with the specifiedName
.void
invalidate(boolean recursive)
Invalidates the underlyingItemState
if available and if it is not transiently modified.protected void
invalidateInternal(boolean recursive)
Invalidates the underlyingItemState
.boolean
isAvailable()
Returnstrue
if the referencedItemState
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.NodeEntry
move(Name newName, NodeEntry newParent, boolean transientMove)
Moves thisNodeEntry
as new child entry of theNodeEntry
identified bynewParent
and/or renames it tonewName
.void
orderBefore(NodeEntry beforeEntry)
Reorders this NodeEntry before the sibling entry specified by the givenbeforeEntry
.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 thisHierarchyEntry
from its parent and sets the status of the underlying ItemState toStatus.REMOVED
or toStatus.STALE_DESTROYED
, respectively.void
revert()
CallsHierarchyEntry.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 theChildNodeEntries
of this node.void
setPropertyEntries(Collection<Name> propNames)
Adds property entries for the givenName
s.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
-
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:
denotesNode
in 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:
reload
in interfaceHierarchyEntry
- See Also:
HierarchyEntry.reload(boolean)
-
revert
public void revert() throws RepositoryException
CallsHierarchyEntry.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 interfaceHierarchyEntry
- 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 eitherStatus.EXISTING_REMOVED
if the item is existing in the persistent storage orStatus.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 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:HierarchyEntry
Removes thisHierarchyEntry
from its parent and sets the status of the underlying ItemState toStatus.REMOVED
or toStatus.STALE_DESTROYED
, respectively. If this entry is a NodeEntry all descending ItemStates must get their status changed as well.- Specified by:
remove
in interfaceHierarchyEntry
- See Also:
HierarchyEntry.remove()
-
complete
public void complete(Operation operation) throws RepositoryException
Description copied from interface:HierarchyEntry
Clean up this entry uponOperation.undo()
orOperation.persisted()
.- Specified by:
complete
in interfaceHierarchyEntry
- Throws:
RepositoryException
- See Also:
HierarchyEntry.complete(Operation)
-
getId
public NodeId getId() throws InvalidItemStateException, RepositoryException
- Specified by:
getId
in interfaceNodeEntry
- 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 asgetId()
unless this entry or any of its ancestors has been transiently moved.- Specified by:
getWorkspaceId
in interfaceNodeEntry
- Returns:
- Throws:
InvalidItemStateException
RepositoryException
- See Also:
NodeEntry.getWorkspaceId()
-
getUniqueID
public String getUniqueID()
- Specified by:
getUniqueID
in interfaceNodeEntry
- 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 interfaceNodeEntry
- See Also:
NodeEntry.setUniqueID(String)
-
getIndex
public int getIndex() throws InvalidItemStateException, RepositoryException
- Specified by:
getIndex
in 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_UNDEFINED
is returned. - Throws:
InvalidItemStateException
RepositoryException
- See Also:
NodeEntry.getIndex()
-
getNodeState
public NodeState getNodeState() throws ItemNotFoundException, RepositoryException
- Specified by:
getNodeState
in interfaceNodeEntry
- Returns:
- the referenced
NodeState
. - Throws:
ItemNotFoundException
- if theNodeState
does 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: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 interfaceNodeEntry
- 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 interfaceNodeEntry
- 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 interfaceNodeEntry
- 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 validNodeEntry
with the specifiednodeName
.- Specified by:
hasNodeEntry
in interfaceNodeEntry
- Parameters:
nodeName
-Name
object specifying a node name- Returns:
true
if there is aNodeEntry
with the specifiednodeName
.- See Also:
NodeEntry.hasNodeEntry(Name)
-
hasNodeEntry
public boolean hasNodeEntry(Name nodeName, int index)
Description copied from interface:NodeEntry
Determines if there is a validNodeEntry
with the specifiedname
andindex
.- Specified by:
hasNodeEntry
in interfaceNodeEntry
- 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 aNodeEntry
with the specifiedname
andindex
.- See Also:
NodeEntry.hasNodeEntry(Name, int)
-
getNodeEntry
public NodeEntry getNodeEntry(Name nodeName, int index) throws RepositoryException
Description copied from interface:NodeEntry
Returns the validNodeEntry
with the specified name and index ornull
if there's no matching entry.- Specified by:
getNodeEntry
in interfaceNodeEntry
- 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 ornull
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 validNodeEntry
with the specified name and index ornull
if there's no matching entry. IfloadIfNotFound
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 interfaceNodeEntry
- 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 ornull
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 ofNodeEntry
objects denoting the the valid child NodeEntries present on thisNodeEntry
.- Specified by:
getNodeEntries
in interfaceNodeEntry
- 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 ofNodeEntry
s with the specified name.- Specified by:
getNodeEntries
in interfaceNodeEntry
- 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 theChildNodeEntries
of this node.- Specified by:
setNodeEntries
in interfaceNodeEntry
- 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 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:NodeEntry
Adds a new, transient childNodeEntry
- Specified by:
addNewNodeEntry
in 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:NodeEntry
Determines if there is a property entry with the specifiedName
.- Specified by:
hasPropertyEntry
in interfaceNodeEntry
- Parameters:
propName
-Name
object specifying a property name- Returns:
true
if there is a property entry with the specifiedName
.- See Also:
NodeEntry.hasPropertyEntry(Name)
-
getPropertyEntry
public PropertyEntry getPropertyEntry(Name propName)
Description copied from interface:NodeEntry
Returns the validPropertyEntry
with the specified name ornull
if no matching entry exists.- Specified by:
getPropertyEntry
in interfaceNodeEntry
- Parameters:
propName
-Name
object specifying a property name.- Returns:
- The
PropertyEntry
with the specified name ornull
if no matching entry exists. - See Also:
NodeEntry.getPropertyEntry(Name)
-
getPropertyEntry
public PropertyEntry getPropertyEntry(Name propName, boolean loadIfNotFound) throws RepositoryException
Ignores theloadIfNotFound
flag due to the fact, thatNodeInfo.getPropertyIds()
returns the complete list of property names currently available.- Specified by:
getPropertyEntry
in interfaceNodeEntry
- Parameters:
propName
-Name
object specifying a property name.- Returns:
- The
PropertyEntry
with the specified name ornull
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 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:NodeEntry
Add an existingPropertyEntry
with 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:
getOrAddPropertyEntry
in 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:NodeEntry
Adds property entries for the givenName
s. 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:
setPropertyEntries
in interfaceNodeEntry
- 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, transientPropertyEntry
to thisNodeEntry
and return thePropertyState
associated with the new entry.- Specified by:
addNewPropertyEntry
in interfaceNodeEntry
- 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 givenbeforeEntry
.- Specified by:
orderBefore
in interfaceNodeEntry
- Parameters:
beforeEntry
- the child node where to insert the node before. Ifnull
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 thisNodeEntry
as new child entry of theNodeEntry
identified bynewParent
and/or renames it tonewName
. IftransientMove
is 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:
move
in 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:
isTransientlyMoved
in interfaceNodeEntry
- 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, thatEvent.getParentId()
of the given childEvent must point to thisNodeEntry
.- Specified by:
refresh
in interfaceNodeEntry
- See Also:
NodeEntry.refresh(Event)
-
invalidateInternal
protected void invalidateInternal(boolean recursive)
Invalidates the underlyingItemState
. Ifrecursive
is 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:
getName
in interfaceHierarchyEntry
- Returns:
- the name of this hierarchy entry.
- See Also:
HierarchyEntry.getName()
-
getPath
public Path getPath() throws RepositoryException
- Specified by:
getPath
in interfaceHierarchyEntry
- Returns:
- the path of this hierarchy entry.
- Throws:
RepositoryException
- See Also:
HierarchyEntry.getPath()
-
getWorkspacePath
public Path getWorkspacePath() throws RepositoryException
- Specified by:
getWorkspacePath
in 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:HierarchyEntry
Returns theNodeEntry
being parent to thisHierarchyEntry
.- Specified by:
getParent
in interfaceHierarchyEntry
- Returns:
- the parent
HierarchyEntry
- See Also:
HierarchyEntry.getParent()
-
getStatus
public int getStatus()
Description copied from interface:HierarchyEntry
If thisHierarchyEntry
provides an underlyingItemState
this method returns the status of that state, otherwise it returnsStatus._UNDEFINED_
.- Specified by:
getStatus
in 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:HierarchyEntry
Returnstrue
if the referencedItemState
is available. That is, the referencedItemState
has already been resolved.
Note, that the validity of the ItemState is not checked.- Specified by:
isAvailable
in interfaceHierarchyEntry
- Returns:
true
if theItemState
is available; otherwisefalse
.- See Also:
HierarchyEntry.isAvailable()
-
getItemState
public ItemState getItemState() throws ItemNotFoundException, RepositoryException
If thisHierarchyEntry
has already been resolved before (seeHierarchyEntry.isAvailable()
), thatItemState
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 accessibleItemState
or if the corresponding state has been removed in the mean time.- Specified by:
getItemState
in interfaceHierarchyEntry
- Returns:
- the referenced
ItemState
. - Throws:
ItemNotFoundException
- if theItemState
does 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:
setItemState
in interfaceHierarchyEntry
- See Also:
HierarchyEntry.setItemState(ItemState)
-
invalidate
public void invalidate(boolean recursive)
Invalidates the underlyingItemState
if available and if it is not transiently modified. If therecursive
flag 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.INVALIDATED
and does not actually update it with the persistent state in the repository.- Specified by:
invalidate
in interfaceHierarchyEntry
- See Also:
HierarchyEntry.invalidate(boolean)
-
calculateStatus
public void calculateStatus()
Description copied from interface:HierarchyEntry
Calculates the status of the underlyingItemState
: any pending changes to the underlyingItemState
are applied.- Specified by:
calculateStatus
in interfaceHierarchyEntry
-
getGeneration
public long getGeneration()
Description copied from interface:HierarchyEntry
The required generation of thisHierarchyEntry
. This is used by theItemInfoCache
to 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:
getGeneration
in interfaceHierarchyEntry
-
-