T - the delegate typepublic class NodeImpl<T extends NodeDelegate> extends Object implements Node, JackrabbitNode
| Modifier and Type | Field and 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 of
save(). |
protected SessionContext |
sessionContext |
protected SessionDelegate |
sessionDelegate |
JCR_CHILD_NODE_DEFINITION, JCR_CONTENT, JCR_FROZEN_NODE, JCR_PROPERTY_DEFINITION, JCR_ROOT_VERSION, JCR_VERSION_LABELS| Constructor and Description |
|---|
NodeImpl(T dlg,
SessionContext sessionContext) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetAncestor, getDepth, getName, getPath, getSession, isSame, refresh, savepublic static final String ITEM_SAVE_DOES_SESSION_SAVE
public static final int MV_PROPERTY_WARN_THRESHOLD
public static final boolean SAVE_SESSION
save(). If false,
save will throw a UnsupportedRepositoryOperationException if the
sub tree rooted at this item does not contain all transient changes. If
true, save will delegate to Session.save().protected final SessionContext sessionContext
protected final T extends ItemDelegate dlg
protected final SessionDelegate sessionDelegate
public NodeImpl(T dlg, SessionContext sessionContext)
@CheckForNull public static NodeImpl<? extends NodeDelegate> createNodeOrNull(@CheckForNull NodeDelegate delegate, @Nonnull SessionContext context) throws RepositoryException
RepositoryException@Nonnull public static NodeImpl<? extends NodeDelegate> createNode(@Nonnull NodeDelegate delegate, @Nonnull SessionContext context) throws RepositoryException
RepositoryExceptionpublic boolean isNode()
isNode in interface ItemItem.isNode()@Nonnull public Node getParent() throws RepositoryException
getParent in interface ItemRepositoryExceptionItem.getParent()public boolean isNew()
isNew in interface ItemItem.isNew()public boolean isModified()
isModified in interface ItemItem.isModified()public void remove()
throws RepositoryException
remove in interface ItemRepositoryExceptionItem.remove()public void accept(ItemVisitor visitor) throws RepositoryException
accept in interface ItemRepositoryException@Nonnull public Node addNode(String relPath) throws RepositoryException
addNode in interface NodeRepositoryExceptionNode.addNode(String)@Nonnull public Node addNode(String relPath, String primaryNodeTypeName) throws RepositoryException
addNode in interface NodeRepositoryExceptionpublic void orderBefore(String srcChildRelPath, String destChildRelPath) throws RepositoryException
orderBefore in interface NodeRepositoryException@Nonnull public Property setProperty(String name, Value value) throws RepositoryException
setProperty in interface NodeRepositoryException@Nonnull public Property setProperty(String name, Value value, int type) throws RepositoryException
setProperty in interface NodeRepositoryException@Nonnull public Property setProperty(String name, Value[] values) throws RepositoryException
setProperty in interface NodeRepositoryException@Nonnull public Property setProperty(String jcrName, Value[] values, int type) throws RepositoryException
setProperty in interface NodeRepositoryException@Nonnull public Property setProperty(String name, String[] values) throws RepositoryException
setProperty in interface NodeRepositoryException@Nonnull public Property setProperty(String name, String[] values, int type) throws RepositoryException
setProperty in interface NodeRepositoryException@Nonnull public Property setProperty(String name, String value) throws RepositoryException
setProperty in interface NodeRepositoryException@Nonnull public Property setProperty(String name, String value, int type) throws RepositoryException
setProperty in interface NodeRepositoryException@Nonnull public Property setProperty(String name, InputStream value) throws RepositoryException
setProperty in interface NodeRepositoryException@Nonnull public Property setProperty(String name, Binary value) throws RepositoryException
setProperty in interface NodeRepositoryException@Nonnull public Property setProperty(String name, boolean value) throws RepositoryException
setProperty in interface NodeRepositoryException@Nonnull public Property setProperty(String name, double value) throws RepositoryException
setProperty in interface NodeRepositoryException@Nonnull public Property setProperty(String name, BigDecimal value) throws RepositoryException
setProperty in interface NodeRepositoryException@Nonnull public Property setProperty(String name, long value) throws RepositoryException
setProperty in interface NodeRepositoryException@Nonnull public Property setProperty(String name, Calendar value) throws RepositoryException
setProperty in interface NodeRepositoryException@Nonnull public Property setProperty(String name, Node value) throws RepositoryException
setProperty in interface NodeRepositoryException@Nonnull public Node getNode(String relPath) throws RepositoryException
getNode in interface NodeRepositoryException@Nonnull public NodeIterator getNodes() throws RepositoryException
getNodes in interface NodeRepositoryException@Nonnull public NodeIterator getNodes(String namePattern) throws RepositoryException
getNodes in interface NodeRepositoryException@Nonnull public NodeIterator getNodes(String[] nameGlobs) throws RepositoryException
getNodes in interface NodeRepositoryException@Nonnull public Property getProperty(String relPath) throws RepositoryException
getProperty in interface NodeRepositoryException@Nonnull public PropertyIterator getProperties() throws RepositoryException
getProperties in interface NodeRepositoryException@Nonnull public PropertyIterator getProperties(String namePattern) throws RepositoryException
getProperties in interface NodeRepositoryException@Nonnull public PropertyIterator getProperties(String[] nameGlobs) throws RepositoryException
getProperties in interface NodeRepositoryException@Nonnull public Item getPrimaryItem() throws RepositoryException
getPrimaryItem in interface NodeRepositoryExceptionNode.getPrimaryItem()@Nonnull public String getUUID() throws RepositoryException
getUUID in interface NodeRepositoryExceptionNode.getUUID()@Nonnull public String getIdentifier() throws RepositoryException
getIdentifier in interface NodeRepositoryExceptionpublic int getIndex()
throws RepositoryException
getIndex in interface NodeRepositoryException@Nonnull public PropertyIterator getReferences() throws RepositoryException
getReferences in interface NodeRepositoryExceptionNode.getReferences()@Nonnull public PropertyIterator getReferences(String name) throws RepositoryException
getReferences in interface NodeRepositoryException@Nonnull public PropertyIterator getWeakReferences() throws RepositoryException
getWeakReferences in interface NodeRepositoryExceptionNode.getWeakReferences()@Nonnull public PropertyIterator getWeakReferences(String name) throws RepositoryException
getWeakReferences in interface NodeRepositoryExceptionpublic boolean hasNode(String relPath) throws RepositoryException
hasNode in interface NodeRepositoryExceptionpublic boolean hasProperty(String relPath) throws RepositoryException
hasProperty in interface NodeRepositoryExceptionpublic boolean hasNodes()
throws RepositoryException
hasNodes in interface NodeRepositoryExceptionpublic boolean hasProperties()
throws RepositoryException
hasProperties in interface NodeRepositoryException@Nonnull public NodeType getPrimaryNodeType() throws RepositoryException
getPrimaryNodeType in interface NodeRepositoryExceptionNode.getPrimaryNodeType()@Nonnull public NodeType[] getMixinNodeTypes() throws RepositoryException
getMixinNodeTypes in interface NodeRepositoryExceptionNode.getMixinNodeTypes()public boolean isNodeType(String nodeTypeName) throws RepositoryException
isNodeType in interface NodeRepositoryExceptionpublic void setPrimaryType(String nodeTypeName) throws RepositoryException
setPrimaryType in interface NodeRepositoryExceptionpublic void addMixin(String mixinName) throws RepositoryException
addMixin in interface NodeRepositoryExceptionpublic void removeMixin(String mixinName) throws RepositoryException
removeMixin in interface NodeRepositoryExceptionpublic boolean canAddMixin(String mixinName) throws RepositoryException
canAddMixin in interface NodeRepositoryException@Nonnull public NodeDefinition getDefinition() throws RepositoryException
getDefinition in interface NodeRepositoryException@Nonnull public String getCorrespondingNodePath(String workspaceName) throws RepositoryException
getCorrespondingNodePath in interface NodeRepositoryExceptionpublic void update(String srcWorkspace) throws RepositoryException
update in interface NodeRepositoryException@Nonnull public Version checkin() throws RepositoryException
checkin in interface NodeRepositoryExceptionNode.checkin()public void checkout()
throws RepositoryException
checkout in interface NodeRepositoryExceptionNode.checkout()public void doneMerge(Version version) throws RepositoryException
doneMerge in interface NodeRepositoryExceptionNode.doneMerge(javax.jcr.version.Version)public void cancelMerge(Version version) throws RepositoryException
cancelMerge in interface NodeRepositoryExceptionNode.cancelMerge(javax.jcr.version.Version)@Nonnull public NodeIterator merge(String srcWorkspace, boolean bestEffort) throws RepositoryException
merge in interface NodeRepositoryExceptionNode.merge(String, boolean)public boolean isCheckedOut()
throws RepositoryException
isCheckedOut in interface NodeRepositoryExceptionNode.isCheckedOut()public void restore(String versionName, boolean removeExisting) throws RepositoryException
restore in interface NodeRepositoryExceptionNode.restore(String, boolean)public void restore(Version version, boolean removeExisting) throws RepositoryException
restore in interface NodeRepositoryExceptionNode.restore(javax.jcr.version.Version, boolean)public void restore(Version version, String relPath, boolean removeExisting) throws RepositoryException
restore in interface NodeRepositoryExceptionNode.restore(Version, String, boolean)public void restoreByLabel(String versionLabel, boolean removeExisting) throws RepositoryException
restoreByLabel in interface NodeRepositoryExceptionNode.restoreByLabel(String, boolean)@Nonnull public VersionHistory getVersionHistory() throws RepositoryException
getVersionHistory in interface NodeRepositoryExceptionNode.getVersionHistory()@Nonnull public Version getBaseVersion() throws RepositoryException
getBaseVersion in interface NodeRepositoryExceptionNode.getBaseVersion()public boolean isLocked()
throws RepositoryException
isLocked in interface NodeRepositoryExceptionpublic boolean holdsLock()
throws RepositoryException
holdsLock in interface NodeRepositoryException@Nonnull public Lock getLock() throws RepositoryException
getLock in interface NodeRepositoryException@Nonnull public Lock lock(boolean isDeep, boolean isSessionScoped) throws RepositoryException
lock in interface NodeRepositoryExceptionpublic void unlock()
throws RepositoryException
unlock in interface NodeRepositoryException@Nonnull public NodeIterator getSharedSet()
getSharedSet in interface Nodepublic void removeSharedSet()
throws RepositoryException
removeSharedSet in interface NodeRepositoryExceptionpublic void removeShare()
throws RepositoryException
removeShare in interface NodeRepositoryExceptionpublic void followLifecycleTransition(String transition) throws RepositoryException
followLifecycleTransition in interface NodeRepositoryExceptionNode.followLifecycleTransition(String)@Nonnull public String[] getAllowedLifecycleTransistions() throws RepositoryException
getAllowedLifecycleTransistions in interface NodeRepositoryExceptionNode.getAllowedLifecycleTransistions()public void rename(String newName) throws RepositoryException
JackrabbitNode.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.rename in interface JackrabbitNodenewName - The new name of this node.RepositoryException - If an error occurs.public void setMixins(String[] mixinNames) throws RepositoryException
JackrabbitNode.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.setMixins in interface JackrabbitNodemixinNames - RepositoryException@Nonnull protected final <U> U perform(@Nonnull SessionOperation<U> op) throws RepositoryException
SessionOperation.U - return type of the operationop - operation to performop.perform()RepositoryException - as thrown by op.perform().@Nonnull public String getName() throws RepositoryException
getName in interface ItemRepositoryExceptionItem.getName()@Nonnull public String getPath() throws RepositoryException
getPath in interface ItemRepositoryExceptionItem.getPath()@Nonnull public Session getSession()
getSession in interface Itempublic Item getAncestor(int depth) throws RepositoryException
getAncestor in interface ItemRepositoryExceptionpublic int getDepth()
throws RepositoryException
getDepth in interface ItemRepositoryExceptionpublic boolean isSame(Item otherItem) throws RepositoryException
isSame in interface ItemRepositoryExceptionItem.isSame(javax.jcr.Item)public void save()
throws RepositoryException
Session.save() if SAVE_SESSION is
true. Otherwise it only performs the save if the subtree rooted at this item contains
all transient changes. That is, if calling Session.save() would have the same effect
as calling this method. In all other cases this method will throw an
UnsupportedRepositoryOperationExceptionsave in interface ItemRepositoryExceptionItem.save()public void refresh(boolean keepChanges)
throws RepositoryException
refresh in interface ItemRepositoryExceptionItem.refresh(boolean)@Nonnull protected org.apache.jackrabbit.oak.api.PropertyState createSingleState(String oakName, Value value, org.apache.jackrabbit.oak.api.Type<?> type) throws RepositoryException
RepositoryException@Nonnull protected org.apache.jackrabbit.oak.api.PropertyState createMultiState(String oakName, List<Value> values, org.apache.jackrabbit.oak.api.Type<?> type) throws RepositoryException
RepositoryExceptionCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.