|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.jcr2spi.hierarchy.PropertyEntryImpl
public class PropertyEntryImpl
PropertyEntryImpl implements a reference to a property state.
| Field Summary | |
|---|---|
protected EntryFactory |
factory
The item state factory to create the the item state. |
protected Name |
name
The name of the target item state. |
protected NodeEntryImpl |
parent
Hard reference to the parent NodeEntry. |
| Method Summary | |
|---|---|
void |
collectStates(ChangeLog changeLog,
boolean throwOnStale)
Checks if the underlying ItemState is available and if it
has been transiently modified or if is new or stale modified. |
boolean |
denotesNode()
Returns false. |
PropertyId |
getId()
|
ItemState |
getItemState()
If this HierarchyEntry has already been resolved before
(see HierarchyEntry.isAvailable()), that ItemState is returned. |
Name |
getName()
|
NodeEntry |
getParent()
Returns the NodeEntry being parent to this
HierarchyEntry. |
Path |
getPath()
|
PropertyState |
getPropertyState()
|
int |
getStatus()
Unless this HierarchyEntry has been resolved this method
returns Status._UNDEFINED_ otherwise it returns the status of
the underlying ItemState. |
PropertyId |
getWorkspaceId()
Returns the ID that must be used for resolving this entry OR loading its children entries from the persistent layer. |
Path |
getWorkspacePath()
|
void |
invalidate(boolean recursive)
Invalidates the underlying ItemState if available. |
boolean |
isAvailable()
Returns true if the referenced ItemState is
available. |
void |
reload(boolean keepChanges,
boolean recursive)
Reloads this hierarchy entry and the corresponding ItemState, if this entry has already been resolved. |
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()
Traverses the hierarchy and reverts all transient modifications such as adding, modifying or removing item states. |
void |
setItemState(ItemState state)
Set the ItemState this hierarchyEntry will be resolved to. |
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 |
|---|
collectStates, getItemState, getName, getParent, getPath, getStatus, getWorkspacePath, invalidate, isAvailable, reload, revert, setItemState, transientRemove |
| Field Detail |
|---|
protected Name name
protected NodeEntryImpl parent
NodeEntry.
protected final EntryFactory factory
| Method Detail |
|---|
public PropertyId getId()
getId in interface PropertyEntryNodeId of this child node entry.PropertyEntry.getId()public PropertyId getWorkspaceId()
PropertyEntrygetId() unless any of its ancestors has been transiently
moved.
getWorkspaceId in interface PropertyEntryPropertyEntry.getWorkspaceId()
public PropertyState getPropertyState()
throws ItemNotFoundException,
RepositoryException
getPropertyState in interface PropertyEntryPropertyState.
ItemNotFoundException - if the PropertyState does not
exist anymore.
RepositoryException - if an error occurs while retrieving the
PropertyState.PropertyEntry.getPropertyState()public boolean denotesNode()
denotesNode in interface HierarchyEntryHierarchyEntry.denotesNode()public void remove()
HierarchyEntryHierarchyEntry 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.
remove in interface HierarchyEntryHierarchyEntry.remove()public Name getName()
getName in interface HierarchyEntryHierarchyEntry.getName()
public Path getPath()
throws RepositoryException
getPath in interface HierarchyEntryRepositoryExceptionHierarchyEntry.getPath()
public Path getWorkspacePath()
throws RepositoryException
getWorkspacePath in interface HierarchyEntryHierarchyEntry.getPath(). In case of moved items this method return the
original path as it is present on the persistent layer.
RepositoryExceptionHierarchyEntry.getWorkspacePath()public NodeEntry getParent()
HierarchyEntryNodeEntry being parent to this
HierarchyEntry.
getParent in interface HierarchyEntryHierarchyEntryHierarchyEntry.getParent()public int getStatus()
HierarchyEntryHierarchyEntry has been resolved this method
returns Status._UNDEFINED_ otherwise it returns the status of
the underlying ItemState.
getStatus in interface HierarchyEntryStatus._UNDEFINED_ if this
entry has not been resolved yet.HierarchyEntry.getStatus()public boolean isAvailable()
HierarchyEntrytrue if the referenced ItemState is
available. That is, the referenced ItemState has already
been resolved.
isAvailable in interface HierarchyEntrytrue if the ItemState is available;
otherwise false.HierarchyEntry.isAvailable()
public ItemState getItemState()
throws ItemNotFoundException,
RepositoryException
HierarchyEntry has already been resolved before
(see HierarchyEntry.isAvailable()), that ItemState is returned.
Note however, that the validity of the State is not asserted.ItemState
or if the corresponding state has been removed in the mean time.
getItemState in interface HierarchyEntryItemState.
ItemNotFoundException - if the ItemState does not
exist anymore.
RepositoryException - If an error occurs while retrieving the
ItemState.HierarchyEntry.getItemState()public void setItemState(ItemState state)
setItemState in interface HierarchyEntryHierarchyEntry.setItemState(ItemState)public void invalidate(boolean recursive)
ItemState if available. If the
recursive flag is true, the hierarchy is traverses and
HierarchyEntry.invalidate(boolean) is called on all child entries.HierarchyEntry.reload(boolean, boolean)
this method only sets the status of this item state to Status.INVALIDATED and does not acutally update it with the persistent
state in the repository.
invalidate in interface HierarchyEntryHierarchyEntry.invalidate(boolean)
public void revert()
throws RepositoryException
Status.EXISTING.
revert in interface HierarchyEntryRepositoryException - if an error occurs.HierarchyEntry.revert()
public void reload(boolean keepChanges,
boolean recursive)
keepChanges' is true,
states with transient changes are left untouched in order to obtain stale
item states. Otherwise this state gets its data reloaded from the
persistent storage. If 'recursive' the complete hierarchy
below this entry is reloaded as well.
reload in interface HierarchyEntryHierarchyEntry.reload(boolean, boolean)
public void transientRemove()
throws InvalidItemStateException,
RepositoryException
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.
transientRemove in interface HierarchyEntryInvalidItemStateException - 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.HierarchyEntry.transientRemove()
public void collectStates(ChangeLog changeLog,
boolean throwOnStale)
throws InvalidItemStateException
ItemState is available and if it
has been transiently modified or if is new or stale modified. If either of
the conditions is true, the state is added to the ChangeLog.
If this HierarchyEntry has children it will call
HierarchyEntry.collectStates(ChangeLog, boolean) recursively.
collectStates in interface HierarchyEntrychangeLog - the ChangeLog collecting the transient
item states present in a given tree.throwOnStale - If the given flag is true, this methods throws
InvalidItemStateException if this state is stale.
InvalidItemStateException - if throwOnStale is true and
this state is stale.HierarchyEntry.collectStates(ChangeLog, boolean)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||