Interface HierarchyEntry
-
- All Known Subinterfaces:
NodeEntry,PropertyEntry
- All Known Implementing Classes:
NodeEntryImpl,PropertyEntryImpl
public interface HierarchyEntryHierarchyEntry...
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcalculateStatus()Calculates the status of the underlyingItemState: any pending changes to the underlyingItemStateare applied.voidcomplete(Operation transientOperation)Clean up this entry uponOperation.undo()orOperation.persisted().booleandenotesNode()True if thisHierarchyEntrywould resolve to aNodeState.longgetGeneration()The required generation of thisHierarchyEntry.ItemStategetItemState()If thisHierarchyEntryhas already been resolved before (seeisAvailable()), thatItemStateis returned.NamegetName()NodeEntrygetParent()Returns theNodeEntrybeing parent to thisHierarchyEntry.PathgetPath()intgetStatus()If thisHierarchyEntryprovides an underlyingItemStatethis method returns the status of that state, otherwise it returnsStatus._UNDEFINED_.PathgetWorkspacePath()voidinvalidate(boolean recursive)Invalidates the underlyingItemStateif available and if it is not transiently modified.booleanisAvailable()Returnstrueif the referencedItemStateis available.voidreload(boolean recursive)Reloads this hierarchy entry and the corresponding ItemState, if this entry has already been resolved.voidremove()Removes thisHierarchyEntryfrom its parent and sets the status of the underlying ItemState toStatus.REMOVEDor toStatus.STALE_DESTROYED, respectively.voidrevert()Traverses the hierarchy and reverts all transient modifications such as adding, modifying or removing item states.voidsetItemState(ItemState state)Set the ItemState this hierarchyEntry will be resolved to.voidtransientRemove()Traverses the hierarchy and marks all available item states as transiently removed.
-
-
-
Method Detail
-
denotesNode
boolean denotesNode()
True if thisHierarchyEntrywould resolve to aNodeState.- Returns:
-
getName
Name getName()
- Returns:
- the name of this hierarchy entry.
-
getPath
Path getPath() throws RepositoryException
- Returns:
- the path of this hierarchy entry.
- Throws:
RepositoryException
-
getWorkspacePath
Path getWorkspacePath() throws RepositoryException
- Returns:
- If this entry has not been modified this method returns the same
as
getPath(). In case of moved items this method return the original path as it is present on the persistent layer. - Throws:
RepositoryException
-
getParent
NodeEntry getParent()
Returns theNodeEntrybeing parent to thisHierarchyEntry.- Returns:
- the parent
HierarchyEntry
-
getStatus
int getStatus()
If thisHierarchyEntryprovides an underlyingItemStatethis method returns the status of that state, otherwise it returnsStatus._UNDEFINED_.- Returns:
- Status of the ItemState or
Status._UNDEFINED_if this entry has not been resolved yet. - See Also:
ItemState.getStatus()
-
isAvailable
boolean isAvailable()
Returnstrueif the referencedItemStateis available. That is, the referencedItemStatehas already been resolved.
Note, that the validity of the ItemState is not checked.- Returns:
trueif theItemStateis available; otherwisefalse.- See Also:
getItemState()
-
getItemState
ItemState getItemState() throws ItemNotFoundException, RepositoryException
If thisHierarchyEntryhas already been resolved before (seeisAvailable()), 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.- Returns:
- the referenced
ItemState. - Throws:
ItemNotFoundException- if theItemStatedoes not exist anymore.RepositoryException- If an error occurs while retrieving theItemState.
-
setItemState
void setItemState(ItemState state)
Set the ItemState this hierarchyEntry will be resolved to.- Parameters:
state-
-
invalidate
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 toreload(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.
-
calculateStatus
void calculateStatus()
Calculates the status of the underlyingItemState: any pending changes to the underlyingItemStateare applied.
-
revert
void revert() throws RepositoryExceptionTraverses the hierarchy and reverts all transient modifications such as adding, modifying or removing item states. 'Existing' item states are reverted to their initial state and their status is reset toStatus.EXISTING.- Throws:
RepositoryException- if an error occurs.
-
reload
void reload(boolean recursive)
Reloads this hierarchy entry and the corresponding ItemState, if this entry has already been resolved. If 'recursive' the complete hierarchy below this entry is reloaded as well.- Parameters:
recursive-
-
transientRemove
void transientRemove() throws InvalidItemStateException, 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.- 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.
-
remove
void remove()
Removes 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.
-
complete
void complete(Operation transientOperation) throws RepositoryException
Clean up this entry uponOperation.undo()orOperation.persisted().- Parameters:
transientOperation-- Throws:
RepositoryException
-
getGeneration
long getGeneration()
The 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.
-
-