Class NodeImpl<T extends NodeDelegate>
- java.lang.Object
-
- org.apache.jackrabbit.oak.jcr.session.NodeImpl<T>
-
- Type Parameters:
T- the delegate type
- All Implemented Interfaces:
Item,Node,JackrabbitNode
- Direct Known Subclasses:
VersionHistoryImpl,VersionImpl
public class NodeImpl<T extends NodeDelegate> extends Object implements JackrabbitNode
TODO document
-
-
Field Summary
Fields Modifier and Type Field Description protected Tdlgstatic StringITEM_SAVE_DOES_SESSION_SAVEstatic intMV_PROPERTY_WARN_THRESHOLDstatic booleanSAVE_SESSIONThe value of this flag determines the behaviour ofItem.save().protected SessionContextsessionContextprotected SessionDelegatesessionDelegate-
Fields inherited from interface javax.jcr.Node
JCR_CHILD_NODE_DEFINITION, JCR_CONTENT, JCR_FROZEN_NODE, JCR_PROPERTY_DEFINITION, JCR_ROOT_VERSION, JCR_VERSION_LABELS
-
-
Constructor Summary
Constructors Constructor Description NodeImpl(T dlg, SessionContext sessionContext)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(ItemVisitor visitor)voidaddMixin(String mixinName)@NotNull NodeaddNode(String relPath)@NotNull NodeaddNode(String relPath, String primaryNodeTypeName)booleancanAddMixin(String mixinName)voidcancelMerge(Version version)@NotNull Versioncheckin()voidcheckout()protected @NotNull PropertyStatecreateMultiState(String oakName, List<Value> values, Type<?> type)static @NotNull NodeImpl<? extends NodeDelegate>createNode(@NotNull NodeDelegate delegate, @NotNull SessionContext context)static @Nullable NodeImpl<? extends NodeDelegate>createNodeOrNull(@Nullable NodeDelegate delegate, @NotNull SessionContext context)protected @NotNull PropertyStatecreateSingleState(String oakName, Value value, Type<?> type)voiddoneMerge(Version version)voidfollowLifecycleTransition(String transition)@NotNull String[]getAllowedLifecycleTransistions()ItemgetAncestor(int depth)@NotNull VersiongetBaseVersion()@NotNull StringgetCorrespondingNodePath(String workspaceName)@NotNull NodeDefinitiongetDefinition()intgetDepth()@NotNull StringgetIdentifier()intgetIndex()@NotNull LockgetLock()@NotNull NodeType[]getMixinNodeTypes()@NotNull StringgetName()@NotNull NodegetNode(String relPath)@Nullable JackrabbitNodegetNodeOrNull(@NotNull String relPath)Returns the node atrelPathrelative tothisnode ornullif no such node exists.@NotNull NodeIteratorgetNodes()@NotNull NodeIteratorgetNodes(String namePattern)@NotNull NodeIteratorgetNodes(String[] nameGlobs)@NotNull NodegetParent()@Nullable NodegetParentOrNull()Same asItem.getParent(), but instead of throwing an ItemNotFoundException or AccessDeniedException just returnnull.@NotNull StringgetPath()@NotNull ItemgetPrimaryItem()@NotNull NodeTypegetPrimaryNodeType()@NotNull PropertyIteratorgetProperties()@NotNull PropertyIteratorgetProperties(String namePattern)@NotNull PropertyIteratorgetProperties(String[] nameGlobs)@NotNull PropertygetProperty(String relPath)@Nullable PropertygetPropertyOrNull(@NotNull String relPath)Returns the property atrelPathrelative tothisnode ornullif no such property exists.@NotNull PropertyIteratorgetReferences()@NotNull PropertyIteratorgetReferences(String name)@NotNull SessiongetSession()@NotNull NodeIteratorgetSharedSet()@NotNull StringgetUUID()@NotNull VersionHistorygetVersionHistory()@NotNull PropertyIteratorgetWeakReferences()@NotNull PropertyIteratorgetWeakReferences(String name)booleanhasNode(String relPath)booleanhasNodes()booleanhasProperties()booleanhasProperty(String relPath)booleanholdsLock()booleaninternalIsCheckedOut()booleanisCheckedOut()booleanisLocked()booleanisModified()booleanisNew()booleanisNode()booleanisNodeType(String nodeTypeName)booleanisSame(Item otherItem)@NotNull Locklock(boolean isDeep, boolean isSessionScoped)@NotNull NodeIteratormerge(String srcWorkspace, boolean bestEffort)voidorderBefore(String srcChildRelPath, String destChildRelPath)protected <U> Uperform(@NotNull SessionOperation<U> op)Perform the passedSessionOperation.voidrefresh(boolean keepChanges)voidremove()voidremoveMixin(String mixinName)voidremoveShare()voidremoveSharedSet()voidrename(String newName)Simplified implementation ofJackrabbitNode.rename(String).voidrestore(String versionName, boolean removeExisting)voidrestore(Version version, boolean removeExisting)voidrestore(Version version, String relPath, boolean removeExisting)voidrestoreByLabel(String versionLabel, boolean removeExisting)voidsave()voidsetMixins(String[] mixinNames)Simplified implementation of theJackrabbitNode.setMixins(String[])method that adds all mixin types that are not yet present on this node and removes all mixins that are no longer contained in the specified array.voidsetPrimaryType(String nodeTypeName)@NotNull PropertysetProperty(String name, boolean value)@NotNull PropertysetProperty(String name, double value)@NotNull PropertysetProperty(String name, long value)@NotNull PropertysetProperty(String name, InputStream value)@NotNull PropertysetProperty(String name, String value)@NotNull PropertysetProperty(String name, String[] values)@NotNull PropertysetProperty(String name, String[] values, int type)@NotNull PropertysetProperty(String name, String value, int type)@NotNull PropertysetProperty(String name, BigDecimal value)@NotNull PropertysetProperty(String name, Calendar value)@NotNull PropertysetProperty(String name, Binary value)@NotNull PropertysetProperty(String name, Node value)@NotNull PropertysetProperty(String name, Value value)@NotNull PropertysetProperty(String name, Value[] values)@NotNull PropertysetProperty(String jcrName, Value[] values, int type)@NotNull PropertysetProperty(String name, Value value, int type)StringtoString()voidunlock()voidupdate(String srcWorkspace)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.jcr.Item
getAncestor, getDepth, getName, getPath, getSession, isSame, refresh, save
-
-
-
-
Field Detail
-
ITEM_SAVE_DOES_SESSION_SAVE
public static final String ITEM_SAVE_DOES_SESSION_SAVE
- See Also:
- Constant Field Values
-
MV_PROPERTY_WARN_THRESHOLD
public static final int MV_PROPERTY_WARN_THRESHOLD
- See Also:
- Constant Field Values
-
SAVE_SESSION
public static final boolean SAVE_SESSION
The value of this flag determines the behaviour ofItem.save(). Iffalse, save will throw aUnsupportedRepositoryOperationExceptionif the sub tree rooted at this item does not contain all transient changes. Iftrue, save will delegate toSession.save().
-
sessionContext
protected final SessionContext sessionContext
-
dlg
protected final T extends ItemDelegate dlg
-
sessionDelegate
protected final SessionDelegate sessionDelegate
-
-
Constructor Detail
-
NodeImpl
public NodeImpl(T dlg, SessionContext sessionContext)
-
-
Method Detail
-
createNodeOrNull
@Nullable public static @Nullable NodeImpl<? extends NodeDelegate> createNodeOrNull(@Nullable @Nullable NodeDelegate delegate, @NotNull @NotNull SessionContext context) throws RepositoryException
- Throws:
RepositoryException
-
createNode
@NotNull public static @NotNull NodeImpl<? extends NodeDelegate> createNode(@NotNull @NotNull NodeDelegate delegate, @NotNull @NotNull SessionContext context) throws RepositoryException
- Throws:
RepositoryException
-
isNode
public boolean isNode()
- Specified by:
isNodein interfaceItem- See Also:
Item.isNode()
-
getParent
@NotNull public @NotNull Node getParent() throws RepositoryException
- Specified by:
getParentin interfaceItem- Throws:
RepositoryException- See Also:
Item.getParent()
-
isNew
public boolean isNew()
- Specified by:
isNewin interfaceItem- See Also:
Item.isNew()
-
isModified
public boolean isModified()
- Specified by:
isModifiedin interfaceItem- See Also:
Item.isModified()
-
remove
public void remove() throws RepositoryException- Specified by:
removein interfaceItem- Throws:
RepositoryException- See Also:
Item.remove()
-
accept
public void accept(ItemVisitor visitor) throws RepositoryException
- Specified by:
acceptin interfaceItem- Throws:
RepositoryException
-
addNode
@NotNull public @NotNull Node addNode(String relPath) throws RepositoryException
- Specified by:
addNodein interfaceNode- Throws:
RepositoryException- See Also:
Node.addNode(String)
-
addNode
@NotNull public @NotNull Node addNode(String relPath, String primaryNodeTypeName) throws RepositoryException
- Specified by:
addNodein interfaceNode- Throws:
RepositoryException
-
orderBefore
public void orderBefore(String srcChildRelPath, String destChildRelPath) throws RepositoryException
- Specified by:
orderBeforein interfaceNode- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, Value value) throws RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, Value value, int type) throws RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, Value[] values) throws RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String jcrName, Value[] values, int type) throws RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, String[] values) throws RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, String[] values, int type) throws RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, String value) throws RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, String value, int type) throws RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, InputStream value) throws RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, Binary value) throws RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, boolean value) throws RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, double value) throws RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, BigDecimal value) throws RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, long value) throws RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, Calendar value) throws RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, Node value) throws RepositoryException
- Specified by:
setPropertyin interfaceNode- Throws:
RepositoryException
-
getNode
@NotNull public @NotNull Node getNode(String relPath) throws RepositoryException
- Specified by:
getNodein interfaceNode- Throws:
RepositoryException
-
getNodes
@NotNull public @NotNull NodeIterator getNodes() throws RepositoryException
- Specified by:
getNodesin interfaceNode- Throws:
RepositoryException
-
getNodes
@NotNull public @NotNull NodeIterator getNodes(String namePattern) throws RepositoryException
- Specified by:
getNodesin interfaceNode- Throws:
RepositoryException
-
getNodes
@NotNull public @NotNull NodeIterator getNodes(String[] nameGlobs) throws RepositoryException
- Specified by:
getNodesin interfaceNode- Throws:
RepositoryException
-
getProperty
@NotNull public @NotNull Property getProperty(String relPath) throws RepositoryException
- Specified by:
getPropertyin interfaceNode- Throws:
RepositoryException
-
getProperties
@NotNull public @NotNull PropertyIterator getProperties() throws RepositoryException
- Specified by:
getPropertiesin interfaceNode- Throws:
RepositoryException
-
getProperties
@NotNull public @NotNull PropertyIterator getProperties(String namePattern) throws RepositoryException
- Specified by:
getPropertiesin interfaceNode- Throws:
RepositoryException
-
getProperties
@NotNull public @NotNull PropertyIterator getProperties(String[] nameGlobs) throws RepositoryException
- Specified by:
getPropertiesin interfaceNode- Throws:
RepositoryException
-
getPrimaryItem
@NotNull public @NotNull Item getPrimaryItem() throws RepositoryException
- Specified by:
getPrimaryItemin interfaceNode- Throws:
RepositoryException- See Also:
Node.getPrimaryItem()
-
getUUID
@NotNull public @NotNull String getUUID() throws RepositoryException
- Specified by:
getUUIDin interfaceNode- Throws:
RepositoryException- See Also:
Node.getUUID()
-
getIdentifier
@NotNull public @NotNull String getIdentifier() throws RepositoryException
- Specified by:
getIdentifierin interfaceNode- Throws:
RepositoryException
-
getIndex
public int getIndex() throws RepositoryException- Specified by:
getIndexin interfaceNode- Throws:
RepositoryException
-
getReferences
@NotNull public @NotNull PropertyIterator getReferences() throws RepositoryException
- Specified by:
getReferencesin interfaceNode- Throws:
RepositoryException- See Also:
Node.getReferences()
-
getReferences
@NotNull public @NotNull PropertyIterator getReferences(String name) throws RepositoryException
- Specified by:
getReferencesin interfaceNode- Throws:
RepositoryException
-
getWeakReferences
@NotNull public @NotNull PropertyIterator getWeakReferences() throws RepositoryException
- Specified by:
getWeakReferencesin interfaceNode- Throws:
RepositoryException- See Also:
Node.getWeakReferences()
-
getWeakReferences
@NotNull public @NotNull PropertyIterator getWeakReferences(String name) throws RepositoryException
- Specified by:
getWeakReferencesin interfaceNode- Throws:
RepositoryException
-
hasNode
public boolean hasNode(String relPath) throws RepositoryException
- Specified by:
hasNodein interfaceNode- Throws:
RepositoryException
-
hasProperty
public boolean hasProperty(String relPath) throws RepositoryException
- Specified by:
hasPropertyin interfaceNode- Throws:
RepositoryException
-
hasNodes
public boolean hasNodes() throws RepositoryException- Specified by:
hasNodesin interfaceNode- Throws:
RepositoryException
-
hasProperties
public boolean hasProperties() throws RepositoryException- Specified by:
hasPropertiesin interfaceNode- Throws:
RepositoryException
-
getPrimaryNodeType
@NotNull public @NotNull NodeType getPrimaryNodeType() throws RepositoryException
- Specified by:
getPrimaryNodeTypein interfaceNode- Throws:
RepositoryException- See Also:
Node.getPrimaryNodeType()
-
getMixinNodeTypes
@NotNull public @NotNull NodeType[] getMixinNodeTypes() throws RepositoryException
- Specified by:
getMixinNodeTypesin interfaceNode- Throws:
RepositoryException- See Also:
Node.getMixinNodeTypes()
-
isNodeType
public boolean isNodeType(String nodeTypeName) throws RepositoryException
- Specified by:
isNodeTypein interfaceNode- Throws:
RepositoryException
-
setPrimaryType
public void setPrimaryType(String nodeTypeName) throws RepositoryException
- Specified by:
setPrimaryTypein interfaceNode- Throws:
RepositoryException
-
addMixin
public void addMixin(String mixinName) throws RepositoryException
- Specified by:
addMixinin interfaceNode- Throws:
RepositoryException
-
removeMixin
public void removeMixin(String mixinName) throws RepositoryException
- Specified by:
removeMixinin interfaceNode- Throws:
RepositoryException
-
canAddMixin
public boolean canAddMixin(String mixinName) throws RepositoryException
- Specified by:
canAddMixinin interfaceNode- Throws:
RepositoryException
-
getDefinition
@NotNull public @NotNull NodeDefinition getDefinition() throws RepositoryException
- Specified by:
getDefinitionin interfaceNode- Throws:
RepositoryException
-
getCorrespondingNodePath
@NotNull public @NotNull String getCorrespondingNodePath(String workspaceName) throws RepositoryException
- Specified by:
getCorrespondingNodePathin interfaceNode- Throws:
RepositoryException
-
update
public void update(String srcWorkspace) throws RepositoryException
- Specified by:
updatein interfaceNode- Throws:
RepositoryException
-
checkin
@NotNull public @NotNull Version checkin() throws RepositoryException
- Specified by:
checkinin interfaceNode- Throws:
RepositoryException- See Also:
Node.checkin()
-
checkout
public void checkout() throws RepositoryException- Specified by:
checkoutin interfaceNode- Throws:
RepositoryException- See Also:
Node.checkout()
-
doneMerge
public void doneMerge(Version version) throws RepositoryException
- Specified by:
doneMergein interfaceNode- Throws:
RepositoryException- See Also:
Node.doneMerge(javax.jcr.version.Version)
-
cancelMerge
public void cancelMerge(Version version) throws RepositoryException
- Specified by:
cancelMergein interfaceNode- Throws:
RepositoryException- See Also:
Node.cancelMerge(javax.jcr.version.Version)
-
merge
@NotNull public @NotNull NodeIterator merge(String srcWorkspace, boolean bestEffort) throws RepositoryException
- Specified by:
mergein interfaceNode- Throws:
RepositoryException- See Also:
Node.merge(String, boolean)
-
isCheckedOut
public boolean isCheckedOut() throws RepositoryException- Specified by:
isCheckedOutin interfaceNode- Throws:
RepositoryException- See Also:
Node.isCheckedOut()
-
restore
public void restore(String versionName, boolean removeExisting) throws RepositoryException
- Specified by:
restorein interfaceNode- Throws:
RepositoryException- See Also:
Node.restore(String, boolean)
-
restore
public void restore(Version version, boolean removeExisting) throws RepositoryException
- Specified by:
restorein interfaceNode- Throws:
RepositoryException- See Also:
Node.restore(javax.jcr.version.Version, boolean)
-
restore
public void restore(Version version, String relPath, boolean removeExisting) throws RepositoryException
- Specified by:
restorein interfaceNode- Throws:
RepositoryException- See Also:
Node.restore(Version, String, boolean)
-
restoreByLabel
public void restoreByLabel(String versionLabel, boolean removeExisting) throws RepositoryException
- Specified by:
restoreByLabelin interfaceNode- Throws:
RepositoryException- See Also:
Node.restoreByLabel(String, boolean)
-
getVersionHistory
@NotNull public @NotNull VersionHistory getVersionHistory() throws RepositoryException
- Specified by:
getVersionHistoryin interfaceNode- Throws:
RepositoryException- See Also:
Node.getVersionHistory()
-
getBaseVersion
@NotNull public @NotNull Version getBaseVersion() throws RepositoryException
- Specified by:
getBaseVersionin interfaceNode- Throws:
RepositoryException- See Also:
Node.getBaseVersion()
-
isLocked
public boolean isLocked() throws RepositoryException- Specified by:
isLockedin interfaceNode- Throws:
RepositoryException
-
holdsLock
public boolean holdsLock() throws RepositoryException- Specified by:
holdsLockin interfaceNode- Throws:
RepositoryException
-
getLock
@NotNull public @NotNull Lock getLock() throws RepositoryException
- Specified by:
getLockin interfaceNode- Throws:
RepositoryException
-
lock
@NotNull public @NotNull Lock lock(boolean isDeep, boolean isSessionScoped) throws RepositoryException
- Specified by:
lockin interfaceNode- Throws:
RepositoryException
-
unlock
public void unlock() throws RepositoryException- Specified by:
unlockin interfaceNode- Throws:
RepositoryException
-
getSharedSet
@NotNull public @NotNull NodeIterator getSharedSet()
- Specified by:
getSharedSetin interfaceNode
-
removeSharedSet
public void removeSharedSet() throws RepositoryException- Specified by:
removeSharedSetin interfaceNode- Throws:
RepositoryException
-
removeShare
public void removeShare() throws RepositoryException- Specified by:
removeSharein interfaceNode- Throws:
RepositoryException
-
followLifecycleTransition
public void followLifecycleTransition(String transition) throws RepositoryException
- Specified by:
followLifecycleTransitionin interfaceNode- Throws:
RepositoryException- See Also:
Node.followLifecycleTransition(String)
-
getAllowedLifecycleTransistions
@NotNull public @NotNull String[] getAllowedLifecycleTransistions() throws RepositoryException
- Specified by:
getAllowedLifecycleTransistionsin interfaceNode- Throws:
RepositoryException- See Also:
Node.getAllowedLifecycleTransistions()
-
internalIsCheckedOut
public boolean internalIsCheckedOut() throws RepositoryException- Throws:
RepositoryException
-
rename
public void rename(String newName) throws RepositoryException
Simplified implementation ofJackrabbitNode.rename(String). In contrast to the implementation in Jackrabbit 2.x which was operating on the NodeState level directly, this implementation does a move plus subsequent reorder on the JCR API due to a missing support for renaming on the OAK API. Note, that this also has an impact on how permissions are enforced: In Jackrabbit 2.x the rename just required permission to modify the child collection on the parent, whereas a move did the full permission check. With this simplified implementation that (somewhat inconsistent) difference has been removed.- Specified by:
renamein interfaceJackrabbitNode- Parameters:
newName- The new name of this node.- Throws:
RepositoryException- If an error occurs.
-
setMixins
public void setMixins(String[] mixinNames) throws RepositoryException
Simplified implementation of theJackrabbitNode.setMixins(String[])method that adds all mixin types that are not yet present on this node and removes all mixins that are no longer contained in the specified array. Note, that this implementation will not work exactly like the variant in Jackrabbit 2.x which first created the effective node type and adjusted the set of child items accordingly.- Specified by:
setMixinsin interfaceJackrabbitNode- Parameters:
mixinNames-- Throws:
RepositoryExceptionNoSuchNodeTypeExceptionVersionExceptionConstraintViolationExceptionLockException
-
getNodeOrNull
@Nullable public @Nullable JackrabbitNode getNodeOrNull(@NotNull @NotNull String relPath) throws RepositoryException
Description copied from interface:JackrabbitNodeReturns the node atrelPathrelative tothisnode ornullif no such node exists. The same reacquisition semantics apply as withNode.getNode(String).- Specified by:
getNodeOrNullin interfaceJackrabbitNode- Parameters:
relPath- The relative path of the node to retrieve.- Returns:
- The node at
relPathornull - Throws:
RepositoryException- If an error occurs.
-
getPropertyOrNull
@Nullable public @Nullable Property getPropertyOrNull(@NotNull @NotNull String relPath) throws RepositoryException
Description copied from interface:JackrabbitNodeReturns the property atrelPathrelative tothisnode ornullif no such property exists. The same reacquisition semantics apply as withNode.getNode(String).- Specified by:
getPropertyOrNullin interfaceJackrabbitNode- Parameters:
relPath- The relative path of the property to retrieve.- Returns:
- The property at
relPathornull - Throws:
RepositoryException- If an error occurs.
-
getParentOrNull
@Nullable public @Nullable Node getParentOrNull() throws RepositoryException
Description copied from interface:JackrabbitNodeSame asItem.getParent(), but instead of throwing an ItemNotFoundException or AccessDeniedException just returnnull.- Specified by:
getParentOrNullin interfaceJackrabbitNode- Returns:
- the parent node, or
nullif there is no parent or the parent node is not accessible. - Throws:
RepositoryException- if an error occurs.
-
perform
@NotNull protected final <U> U perform(@NotNull @NotNull SessionOperation<U> op) throws RepositoryExceptionPerform the passedSessionOperation.- Type Parameters:
U- return type of the operation- Parameters:
op- operation to perform- Returns:
- the result of
op.perform() - Throws:
RepositoryException- as thrown byop.perform().
-
getName
@NotNull public @NotNull String getName() throws RepositoryException
- Specified by:
getNamein interfaceItem- Throws:
RepositoryException- See Also:
Item.getName()
-
getPath
@NotNull public @NotNull String getPath() throws RepositoryException
- Specified by:
getPathin interfaceItem- Throws:
RepositoryException- See Also:
Item.getPath()
-
getSession
@NotNull public @NotNull Session getSession()
- Specified by:
getSessionin interfaceItem
-
getAncestor
public Item getAncestor(int depth) throws RepositoryException
- Specified by:
getAncestorin interfaceItem- Throws:
RepositoryException
-
getDepth
public int getDepth() throws RepositoryException- Specified by:
getDepthin interfaceItem- Throws:
RepositoryException
-
isSame
public boolean isSame(Item otherItem) throws RepositoryException
- Specified by:
isSamein interfaceItem- Throws:
RepositoryException- See Also:
Item.isSame(javax.jcr.Item)
-
save
public void save() throws RepositoryExceptionThis implementation delegates toSession.save()ifSAVE_SESSIONistrue. Otherwise it only performs the save if the subtree rooted at this item contains all transient changes. That is, if callingSession.save()would have the same effect as calling this method. In all other cases this method will throw anUnsupportedRepositoryOperationException- Specified by:
savein interfaceItem- Throws:
RepositoryException- See Also:
Item.save()
-
refresh
public void refresh(boolean keepChanges) throws RepositoryException- Specified by:
refreshin interfaceItem- Throws:
RepositoryException- See Also:
Item.refresh(boolean)
-
createSingleState
@NotNull protected @NotNull PropertyState createSingleState(String oakName, Value value, Type<?> type) throws RepositoryException
- Throws:
RepositoryException
-
createMultiState
@NotNull protected @NotNull PropertyState createMultiState(String oakName, List<Value> values, Type<?> type) throws RepositoryException
- Throws:
RepositoryException
-
-