Class ItemDelegate
java.lang.Object
org.apache.jackrabbit.oak.jcr.delegate.ItemDelegate
- Direct Known Subclasses:
NodeDelegate
,PropertyDelegate
Abstract base class for
NodeDelegate
and PropertyDelegate
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
Performs a sanity check on this item and the associated session.protected boolean
Checks whether the session has changed since this delegate instance was last accessed, thus triggering anupdate
of the internal state of this delegate.abstract boolean
exists()
Determine whether the underlying item existsabstract @NotNull String
getName()
Get the name of this itemabstract @Nullable NodeDelegate
Get the parent of this item ornull
.abstract @NotNull String
getPath()
Get the path of this itemabstract @Nullable Tree.Status
Get the status of this item.abstract boolean
abstract boolean
remove()
Removes this item.void
save()
Save the subtree rooted at this item.protected void
update()
Called bycheckUpdate()
to update the internal state of this delegate.
-
Field Details
-
sessionDelegate
-
-
Method Details
-
checkUpdate
protected boolean checkUpdate()Checks whether the session has changed since this delegate instance was last accessed, thus triggering anupdate
of the internal state of this delegate.- Returns:
true
if the session was recently updated,false
if not
-
update
protected void update()Called bycheckUpdate()
to update the internal state of this delegate. -
checkAlive
Performs a sanity check on this item and the associated session.- Throws:
RepositoryException
- if this item has been rendered invalid for some reason or the associated session has been logged out
-
getName
Get the name of this item- Returns:
- oak name of this item
-
getPath
Get the path of this item- Returns:
- oak path of this item
-
getParent
Get the parent of this item ornull
.- Returns:
- parent of this item or
null
for root or if the parent is not accessible.
-
getStatus
Get the status of this item.- Returns:
Tree.Status
of this item ornull
if not available.
-
isProtected
- Throws:
InvalidItemStateException
-
exists
public abstract boolean exists()Determine whether the underlying item exists- Returns:
true
the underlying tree exists,false
otherwise.
-
remove
Removes this item.- Returns:
true
if this item was removed; orfalse
if this is the root node that can't be removed- Throws:
InvalidItemStateException
-
save
Save the subtree rooted at this item.- Throws:
RepositoryException
-