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 T
dlg
static String
ITEM_SAVE_DOES_SESSION_SAVE
static int
MV_PROPERTY_WARN_THRESHOLD
static boolean
SAVE_SESSION
The value of this flag determines the behaviour ofItem.save()
.protected SessionContext
sessionContext
protected SessionDelegate
sessionDelegate
-
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 void
accept(ItemVisitor visitor)
void
addMixin(String mixinName)
@NotNull Node
addNode(String relPath)
@NotNull Node
addNode(String relPath, String primaryNodeTypeName)
boolean
canAddMixin(String mixinName)
void
cancelMerge(Version version)
@NotNull Version
checkin()
void
checkout()
protected @NotNull PropertyState
createMultiState(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 PropertyState
createSingleState(String oakName, Value value, Type<?> type)
void
doneMerge(Version version)
void
followLifecycleTransition(String transition)
@NotNull String[]
getAllowedLifecycleTransistions()
Item
getAncestor(int depth)
@NotNull Version
getBaseVersion()
@NotNull String
getCorrespondingNodePath(String workspaceName)
@NotNull NodeDefinition
getDefinition()
int
getDepth()
@NotNull String
getIdentifier()
int
getIndex()
@NotNull Lock
getLock()
@NotNull NodeType[]
getMixinNodeTypes()
@NotNull String
getName()
@NotNull Node
getNode(String relPath)
@Nullable JackrabbitNode
getNodeOrNull(@NotNull String relPath)
Returns the node atrelPath
relative tothis
node ornull
if no such node exists.@NotNull NodeIterator
getNodes()
@NotNull NodeIterator
getNodes(String namePattern)
@NotNull NodeIterator
getNodes(String[] nameGlobs)
@NotNull Node
getParent()
@NotNull String
getPath()
@NotNull Item
getPrimaryItem()
@NotNull NodeType
getPrimaryNodeType()
@NotNull PropertyIterator
getProperties()
@NotNull PropertyIterator
getProperties(String namePattern)
@NotNull PropertyIterator
getProperties(String[] nameGlobs)
@NotNull Property
getProperty(String relPath)
@Nullable Property
getPropertyOrNull(@NotNull String relPath)
Returns the property atrelPath
relative tothis
node ornull
if no such property exists.@NotNull PropertyIterator
getReferences()
@NotNull PropertyIterator
getReferences(String name)
@NotNull Session
getSession()
@NotNull NodeIterator
getSharedSet()
@NotNull String
getUUID()
@NotNull VersionHistory
getVersionHistory()
@NotNull PropertyIterator
getWeakReferences()
@NotNull PropertyIterator
getWeakReferences(String name)
boolean
hasNode(String relPath)
boolean
hasNodes()
boolean
hasProperties()
boolean
hasProperty(String relPath)
boolean
holdsLock()
boolean
internalIsCheckedOut()
boolean
isCheckedOut()
boolean
isLocked()
boolean
isModified()
boolean
isNew()
boolean
isNode()
boolean
isNodeType(String nodeTypeName)
boolean
isSame(Item otherItem)
@NotNull Lock
lock(boolean isDeep, boolean isSessionScoped)
@NotNull NodeIterator
merge(String srcWorkspace, boolean bestEffort)
void
orderBefore(String srcChildRelPath, String destChildRelPath)
protected <U> U
perform(@NotNull SessionOperation<U> op)
Perform the passedSessionOperation
.void
refresh(boolean keepChanges)
void
remove()
void
removeMixin(String mixinName)
void
removeShare()
void
removeSharedSet()
void
rename(String newName)
Simplified implementation ofJackrabbitNode.rename(String)
.void
restore(String versionName, boolean removeExisting)
void
restore(Version version, boolean removeExisting)
void
restore(Version version, String relPath, boolean removeExisting)
void
restoreByLabel(String versionLabel, boolean removeExisting)
void
save()
void
setMixins(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.void
setPrimaryType(String nodeTypeName)
@NotNull Property
setProperty(String name, boolean value)
@NotNull Property
setProperty(String name, double value)
@NotNull Property
setProperty(String name, long value)
@NotNull Property
setProperty(String name, InputStream value)
@NotNull Property
setProperty(String name, String value)
@NotNull Property
setProperty(String name, String[] values)
@NotNull Property
setProperty(String name, String[] values, int type)
@NotNull Property
setProperty(String name, String value, int type)
@NotNull Property
setProperty(String name, BigDecimal value)
@NotNull Property
setProperty(String name, Calendar value)
@NotNull Property
setProperty(String name, Binary value)
@NotNull Property
setProperty(String name, Node value)
@NotNull Property
setProperty(String name, Value value)
@NotNull Property
setProperty(String name, Value[] values)
@NotNull Property
setProperty(String jcrName, Value[] values, int type)
@NotNull Property
setProperty(String name, Value value, int type)
String
toString()
void
unlock()
void
update(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 aUnsupportedRepositoryOperationException
if 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:
isNode
in interfaceItem
- See Also:
Item.isNode()
-
getParent
@NotNull public @NotNull Node getParent() throws RepositoryException
- Specified by:
getParent
in interfaceItem
- Throws:
RepositoryException
- See Also:
Item.getParent()
-
isNew
public boolean isNew()
- Specified by:
isNew
in interfaceItem
- See Also:
Item.isNew()
-
isModified
public boolean isModified()
- Specified by:
isModified
in interfaceItem
- See Also:
Item.isModified()
-
remove
public void remove() throws RepositoryException
- Specified by:
remove
in interfaceItem
- Throws:
RepositoryException
- See Also:
Item.remove()
-
accept
public void accept(ItemVisitor visitor) throws RepositoryException
- Specified by:
accept
in interfaceItem
- Throws:
RepositoryException
-
addNode
@NotNull public @NotNull Node addNode(String relPath) throws RepositoryException
- Specified by:
addNode
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.addNode(String)
-
addNode
@NotNull public @NotNull Node addNode(String relPath, String primaryNodeTypeName) throws RepositoryException
- Specified by:
addNode
in interfaceNode
- Throws:
RepositoryException
-
orderBefore
public void orderBefore(String srcChildRelPath, String destChildRelPath) throws RepositoryException
- Specified by:
orderBefore
in interfaceNode
- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, Value value) throws RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, Value value, int type) throws RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, Value[] values) throws RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String jcrName, Value[] values, int type) throws RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, String[] values) throws RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, String[] values, int type) throws RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, String value) throws RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, String value, int type) throws RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, InputStream value) throws RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, Binary value) throws RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, boolean value) throws RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, double value) throws RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, BigDecimal value) throws RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, long value) throws RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, Calendar value) throws RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
RepositoryException
-
setProperty
@NotNull public @NotNull Property setProperty(String name, Node value) throws RepositoryException
- Specified by:
setProperty
in interfaceNode
- Throws:
RepositoryException
-
getNode
@NotNull public @NotNull Node getNode(String relPath) throws RepositoryException
- Specified by:
getNode
in interfaceNode
- Throws:
RepositoryException
-
getNodes
@NotNull public @NotNull NodeIterator getNodes() throws RepositoryException
- Specified by:
getNodes
in interfaceNode
- Throws:
RepositoryException
-
getNodes
@NotNull public @NotNull NodeIterator getNodes(String namePattern) throws RepositoryException
- Specified by:
getNodes
in interfaceNode
- Throws:
RepositoryException
-
getNodes
@NotNull public @NotNull NodeIterator getNodes(String[] nameGlobs) throws RepositoryException
- Specified by:
getNodes
in interfaceNode
- Throws:
RepositoryException
-
getProperty
@NotNull public @NotNull Property getProperty(String relPath) throws RepositoryException
- Specified by:
getProperty
in interfaceNode
- Throws:
RepositoryException
-
getProperties
@NotNull public @NotNull PropertyIterator getProperties() throws RepositoryException
- Specified by:
getProperties
in interfaceNode
- Throws:
RepositoryException
-
getProperties
@NotNull public @NotNull PropertyIterator getProperties(String namePattern) throws RepositoryException
- Specified by:
getProperties
in interfaceNode
- Throws:
RepositoryException
-
getProperties
@NotNull public @NotNull PropertyIterator getProperties(String[] nameGlobs) throws RepositoryException
- Specified by:
getProperties
in interfaceNode
- Throws:
RepositoryException
-
getPrimaryItem
@NotNull public @NotNull Item getPrimaryItem() throws RepositoryException
- Specified by:
getPrimaryItem
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getPrimaryItem()
-
getUUID
@NotNull public @NotNull String getUUID() throws RepositoryException
- Specified by:
getUUID
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getUUID()
-
getIdentifier
@NotNull public @NotNull String getIdentifier() throws RepositoryException
- Specified by:
getIdentifier
in interfaceNode
- Throws:
RepositoryException
-
getIndex
public int getIndex() throws RepositoryException
- Specified by:
getIndex
in interfaceNode
- Throws:
RepositoryException
-
getReferences
@NotNull public @NotNull PropertyIterator getReferences() throws RepositoryException
- Specified by:
getReferences
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getReferences()
-
getReferences
@NotNull public @NotNull PropertyIterator getReferences(String name) throws RepositoryException
- Specified by:
getReferences
in interfaceNode
- Throws:
RepositoryException
-
getWeakReferences
@NotNull public @NotNull PropertyIterator getWeakReferences() throws RepositoryException
- Specified by:
getWeakReferences
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getWeakReferences()
-
getWeakReferences
@NotNull public @NotNull PropertyIterator getWeakReferences(String name) throws RepositoryException
- Specified by:
getWeakReferences
in interfaceNode
- Throws:
RepositoryException
-
hasNode
public boolean hasNode(String relPath) throws RepositoryException
- Specified by:
hasNode
in interfaceNode
- Throws:
RepositoryException
-
hasProperty
public boolean hasProperty(String relPath) throws RepositoryException
- Specified by:
hasProperty
in interfaceNode
- Throws:
RepositoryException
-
hasNodes
public boolean hasNodes() throws RepositoryException
- Specified by:
hasNodes
in interfaceNode
- Throws:
RepositoryException
-
hasProperties
public boolean hasProperties() throws RepositoryException
- Specified by:
hasProperties
in interfaceNode
- Throws:
RepositoryException
-
getPrimaryNodeType
@NotNull public @NotNull NodeType getPrimaryNodeType() throws RepositoryException
- Specified by:
getPrimaryNodeType
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getPrimaryNodeType()
-
getMixinNodeTypes
@NotNull public @NotNull NodeType[] getMixinNodeTypes() throws RepositoryException
- Specified by:
getMixinNodeTypes
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getMixinNodeTypes()
-
isNodeType
public boolean isNodeType(String nodeTypeName) throws RepositoryException
- Specified by:
isNodeType
in interfaceNode
- Throws:
RepositoryException
-
setPrimaryType
public void setPrimaryType(String nodeTypeName) throws RepositoryException
- Specified by:
setPrimaryType
in interfaceNode
- Throws:
RepositoryException
-
addMixin
public void addMixin(String mixinName) throws RepositoryException
- Specified by:
addMixin
in interfaceNode
- Throws:
RepositoryException
-
removeMixin
public void removeMixin(String mixinName) throws RepositoryException
- Specified by:
removeMixin
in interfaceNode
- Throws:
RepositoryException
-
canAddMixin
public boolean canAddMixin(String mixinName) throws RepositoryException
- Specified by:
canAddMixin
in interfaceNode
- Throws:
RepositoryException
-
getDefinition
@NotNull public @NotNull NodeDefinition getDefinition() throws RepositoryException
- Specified by:
getDefinition
in interfaceNode
- Throws:
RepositoryException
-
getCorrespondingNodePath
@NotNull public @NotNull String getCorrespondingNodePath(String workspaceName) throws RepositoryException
- Specified by:
getCorrespondingNodePath
in interfaceNode
- Throws:
RepositoryException
-
update
public void update(String srcWorkspace) throws RepositoryException
- Specified by:
update
in interfaceNode
- Throws:
RepositoryException
-
checkin
@NotNull public @NotNull Version checkin() throws RepositoryException
- Specified by:
checkin
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.checkin()
-
checkout
public void checkout() throws RepositoryException
- Specified by:
checkout
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.checkout()
-
doneMerge
public void doneMerge(Version version) throws RepositoryException
- Specified by:
doneMerge
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.doneMerge(javax.jcr.version.Version)
-
cancelMerge
public void cancelMerge(Version version) throws RepositoryException
- Specified by:
cancelMerge
in 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:
merge
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.merge(String, boolean)
-
isCheckedOut
public boolean isCheckedOut() throws RepositoryException
- Specified by:
isCheckedOut
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.isCheckedOut()
-
restore
public void restore(String versionName, boolean removeExisting) throws RepositoryException
- Specified by:
restore
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.restore(String, boolean)
-
restore
public void restore(Version version, boolean removeExisting) throws RepositoryException
- Specified by:
restore
in 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:
restore
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.restore(Version, String, boolean)
-
restoreByLabel
public void restoreByLabel(String versionLabel, boolean removeExisting) throws RepositoryException
- Specified by:
restoreByLabel
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.restoreByLabel(String, boolean)
-
getVersionHistory
@NotNull public @NotNull VersionHistory getVersionHistory() throws RepositoryException
- Specified by:
getVersionHistory
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getVersionHistory()
-
getBaseVersion
@NotNull public @NotNull Version getBaseVersion() throws RepositoryException
- Specified by:
getBaseVersion
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.getBaseVersion()
-
isLocked
public boolean isLocked() throws RepositoryException
- Specified by:
isLocked
in interfaceNode
- Throws:
RepositoryException
-
holdsLock
public boolean holdsLock() throws RepositoryException
- Specified by:
holdsLock
in interfaceNode
- Throws:
RepositoryException
-
getLock
@NotNull public @NotNull Lock getLock() throws RepositoryException
- Specified by:
getLock
in interfaceNode
- Throws:
RepositoryException
-
lock
@NotNull public @NotNull Lock lock(boolean isDeep, boolean isSessionScoped) throws RepositoryException
- Specified by:
lock
in interfaceNode
- Throws:
RepositoryException
-
unlock
public void unlock() throws RepositoryException
- Specified by:
unlock
in interfaceNode
- Throws:
RepositoryException
-
getSharedSet
@NotNull public @NotNull NodeIterator getSharedSet()
- Specified by:
getSharedSet
in interfaceNode
-
removeSharedSet
public void removeSharedSet() throws RepositoryException
- Specified by:
removeSharedSet
in interfaceNode
- Throws:
RepositoryException
-
removeShare
public void removeShare() throws RepositoryException
- Specified by:
removeShare
in interfaceNode
- Throws:
RepositoryException
-
followLifecycleTransition
public void followLifecycleTransition(String transition) throws RepositoryException
- Specified by:
followLifecycleTransition
in interfaceNode
- Throws:
RepositoryException
- See Also:
Node.followLifecycleTransition(String)
-
getAllowedLifecycleTransistions
@NotNull public @NotNull String[] getAllowedLifecycleTransistions() throws RepositoryException
- Specified by:
getAllowedLifecycleTransistions
in 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:
rename
in 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:
setMixins
in interfaceJackrabbitNode
- Parameters:
mixinNames
-- Throws:
RepositoryException
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
-
getNodeOrNull
@Nullable public @Nullable JackrabbitNode getNodeOrNull(@NotNull @NotNull String relPath) throws RepositoryException
Description copied from interface:JackrabbitNode
Returns the node atrelPath
relative tothis
node ornull
if no such node exists. The same reacquisition semantics apply as withNode.getNode(String)
.- Specified by:
getNodeOrNull
in interfaceJackrabbitNode
- Parameters:
relPath
- The relative path of the node to retrieve.- Returns:
- The node at
relPath
ornull
- Throws:
RepositoryException
- If an error occurs.
-
getPropertyOrNull
@Nullable public @Nullable Property getPropertyOrNull(@NotNull @NotNull String relPath) throws RepositoryException
Description copied from interface:JackrabbitNode
Returns the property atrelPath
relative tothis
node ornull
if no such property exists. The same reacquisition semantics apply as withNode.getNode(String)
.- Specified by:
getPropertyOrNull
in interfaceJackrabbitNode
- Parameters:
relPath
- The relative path of the property to retrieve.- Returns:
- The property at
relPath
ornull
- Throws:
RepositoryException
- If an error occurs.
-
perform
@NotNull protected final <U> U perform(@NotNull @NotNull SessionOperation<U> op) throws RepositoryException
Perform 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:
getName
in interfaceItem
- Throws:
RepositoryException
- See Also:
Item.getName()
-
getPath
@NotNull public @NotNull String getPath() throws RepositoryException
- Specified by:
getPath
in interfaceItem
- Throws:
RepositoryException
- See Also:
Item.getPath()
-
getSession
@NotNull public @NotNull Session getSession()
- Specified by:
getSession
in interfaceItem
-
getAncestor
public Item getAncestor(int depth) throws RepositoryException
- Specified by:
getAncestor
in interfaceItem
- Throws:
RepositoryException
-
getDepth
public int getDepth() throws RepositoryException
- Specified by:
getDepth
in interfaceItem
- Throws:
RepositoryException
-
isSame
public boolean isSame(Item otherItem) throws RepositoryException
- Specified by:
isSame
in interfaceItem
- Throws:
RepositoryException
- See Also:
Item.isSame(javax.jcr.Item)
-
save
public void save() throws RepositoryException
This implementation delegates toSession.save()
ifSAVE_SESSION
istrue
. 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:
save
in interfaceItem
- Throws:
RepositoryException
- See Also:
Item.save()
-
refresh
public void refresh(boolean keepChanges) throws RepositoryException
- Specified by:
refresh
in 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
-
-