T - the delegate typepublic class NodeImpl<T extends NodeDelegate> extends Object implements Node, org.apache.jackrabbit.api.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) |
| Modifier and Type | Method and 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 org.apache.jackrabbit.oak.api.PropertyState |
createMultiState(String oakName,
List<Value> values,
org.apache.jackrabbit.oak.api.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 org.apache.jackrabbit.oak.api.PropertyState |
createSingleState(String oakName,
Value value,
org.apache.jackrabbit.oak.api.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) |
@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) |
@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 |
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 passed
SessionOperation. |
void |
refresh(boolean keepChanges) |
void |
remove() |
void |
removeMixin(String mixinName) |
void |
removeShare() |
void |
removeSharedSet() |
void |
rename(String newName)
Simplified implementation of
JackrabbitNode.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 the
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. |
void |
setPrimaryType(String nodeTypeName) |
@NotNull Property |
setProperty(String name,
BigDecimal value) |
@NotNull Property |
setProperty(String name,
Binary value) |
@NotNull Property |
setProperty(String name,
boolean value) |
@NotNull Property |
setProperty(String name,
Calendar value) |
@NotNull Property |
setProperty(String name,
double value) |
@NotNull Property |
setProperty(String name,
InputStream value) |
@NotNull Property |
setProperty(String name,
long value) |
@NotNull Property |
setProperty(String name,
Node 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,
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) |
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)
@Nullable public static @Nullable NodeImpl<? extends NodeDelegate> createNodeOrNull(@Nullable @Nullable NodeDelegate delegate, @NotNull @NotNull SessionContext context) throws RepositoryException
RepositoryException@NotNull public static @NotNull NodeImpl<? extends NodeDelegate> createNode(@NotNull @NotNull NodeDelegate delegate, @NotNull @NotNull SessionContext context) throws RepositoryException
RepositoryExceptionpublic boolean isNode()
isNode in interface ItemItem.isNode()@NotNull public @NotNull 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@NotNull public @NotNull Node addNode(String relPath) throws RepositoryException
addNode in interface NodeRepositoryExceptionNode.addNode(String)@NotNull public @NotNull Node addNode(String relPath, String primaryNodeTypeName) throws RepositoryException
addNode in interface NodeRepositoryExceptionpublic void orderBefore(String srcChildRelPath, String destChildRelPath) throws RepositoryException
orderBefore in interface NodeRepositoryException@NotNull public @NotNull Property setProperty(String name, Value value) throws RepositoryException
setProperty in interface NodeRepositoryException@NotNull public @NotNull Property setProperty(String name, Value value, int type) throws RepositoryException
setProperty in interface NodeRepositoryException@NotNull public @NotNull Property setProperty(String name, Value[] values) throws RepositoryException
setProperty in interface NodeRepositoryException@NotNull public @NotNull Property setProperty(String jcrName, Value[] values, int type) throws RepositoryException
setProperty in interface NodeRepositoryException@NotNull public @NotNull Property setProperty(String name, String[] values) throws RepositoryException
setProperty in interface NodeRepositoryException@NotNull public @NotNull Property setProperty(String name, String[] values, int type) throws RepositoryException
setProperty in interface NodeRepositoryException@NotNull public @NotNull Property setProperty(String name, String value) throws RepositoryException
setProperty in interface NodeRepositoryException@NotNull public @NotNull Property setProperty(String name, String value, int type) throws RepositoryException
setProperty in interface NodeRepositoryException@NotNull public @NotNull Property setProperty(String name, InputStream value) throws RepositoryException
setProperty in interface NodeRepositoryException@NotNull public @NotNull Property setProperty(String name, Binary value) throws RepositoryException
setProperty in interface NodeRepositoryException@NotNull public @NotNull Property setProperty(String name, boolean value) throws RepositoryException
setProperty in interface NodeRepositoryException@NotNull public @NotNull Property setProperty(String name, double value) throws RepositoryException
setProperty in interface NodeRepositoryException@NotNull public @NotNull Property setProperty(String name, BigDecimal value) throws RepositoryException
setProperty in interface NodeRepositoryException@NotNull public @NotNull Property setProperty(String name, long value) throws RepositoryException
setProperty in interface NodeRepositoryException@NotNull public @NotNull Property setProperty(String name, Calendar value) throws RepositoryException
setProperty in interface NodeRepositoryException@NotNull public @NotNull Property setProperty(String name, Node value) throws RepositoryException
setProperty in interface NodeRepositoryException@NotNull public @NotNull Node getNode(String relPath) throws RepositoryException
getNode in interface NodeRepositoryException@NotNull public @NotNull NodeIterator getNodes() throws RepositoryException
getNodes in interface NodeRepositoryException@NotNull public @NotNull NodeIterator getNodes(String namePattern) throws RepositoryException
getNodes in interface NodeRepositoryException@NotNull public @NotNull NodeIterator getNodes(String[] nameGlobs) throws RepositoryException
getNodes in interface NodeRepositoryException@NotNull public @NotNull Property getProperty(String relPath) throws RepositoryException
getProperty in interface NodeRepositoryException@NotNull public @NotNull PropertyIterator getProperties() throws RepositoryException
getProperties in interface NodeRepositoryException@NotNull public @NotNull PropertyIterator getProperties(String namePattern) throws RepositoryException
getProperties in interface NodeRepositoryException@NotNull public @NotNull PropertyIterator getProperties(String[] nameGlobs) throws RepositoryException
getProperties in interface NodeRepositoryException@NotNull public @NotNull Item getPrimaryItem() throws RepositoryException
getPrimaryItem in interface NodeRepositoryExceptionNode.getPrimaryItem()@NotNull public @NotNull String getUUID() throws RepositoryException
getUUID in interface NodeRepositoryExceptionNode.getUUID()@NotNull public @NotNull String getIdentifier() throws RepositoryException
getIdentifier in interface NodeRepositoryExceptionpublic int getIndex()
throws RepositoryException
getIndex in interface NodeRepositoryException@NotNull public @NotNull PropertyIterator getReferences() throws RepositoryException
getReferences in interface NodeRepositoryExceptionNode.getReferences()@NotNull public @NotNull PropertyIterator getReferences(String name) throws RepositoryException
getReferences in interface NodeRepositoryException@NotNull public @NotNull PropertyIterator getWeakReferences() throws RepositoryException
getWeakReferences in interface NodeRepositoryExceptionNode.getWeakReferences()@NotNull public @NotNull 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@NotNull public @NotNull NodeType getPrimaryNodeType() throws RepositoryException
getPrimaryNodeType in interface NodeRepositoryExceptionNode.getPrimaryNodeType()@NotNull public @NotNull 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@NotNull public @NotNull NodeDefinition getDefinition() throws RepositoryException
getDefinition in interface NodeRepositoryException@NotNull public @NotNull String getCorrespondingNodePath(String workspaceName) throws RepositoryException
getCorrespondingNodePath in interface NodeRepositoryExceptionpublic void update(String srcWorkspace) throws RepositoryException
update in interface NodeRepositoryException@NotNull public @NotNull 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)@NotNull public @NotNull 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)@NotNull public @NotNull VersionHistory getVersionHistory() throws RepositoryException
getVersionHistory in interface NodeRepositoryExceptionNode.getVersionHistory()@NotNull public @NotNull 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@NotNull public @NotNull Lock getLock() throws RepositoryException
getLock in interface NodeRepositoryException@NotNull public @NotNull Lock lock(boolean isDeep, boolean isSessionScoped) throws RepositoryException
lock in interface NodeRepositoryExceptionpublic void unlock()
throws RepositoryException
unlock in interface NodeRepositoryException@NotNull public @NotNull 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)@NotNull public @NotNull 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 org.apache.jackrabbit.api.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 org.apache.jackrabbit.api.JackrabbitNodemixinNames - RepositoryException@NotNull
protected final <U> U perform(@NotNull
@NotNull SessionOperation<U> op)
throws RepositoryException
SessionOperation.U - return type of the operationop - operation to performop.perform()RepositoryException - as thrown by op.perform().@NotNull public @NotNull String getName() throws RepositoryException
getName in interface ItemRepositoryExceptionItem.getName()@NotNull public @NotNull String getPath() throws RepositoryException
getPath in interface ItemRepositoryExceptionItem.getPath()@NotNull public @NotNull 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)@NotNull protected @NotNull org.apache.jackrabbit.oak.api.PropertyState createSingleState(String oakName, Value value, org.apache.jackrabbit.oak.api.Type<?> type) throws RepositoryException
RepositoryException@NotNull protected @NotNull org.apache.jackrabbit.oak.api.PropertyState createMultiState(String oakName, List<Value> values, org.apache.jackrabbit.oak.api.Type<?> type) throws RepositoryException
RepositoryExceptionCopyright © 2012–2020 The Apache Software Foundation. All rights reserved.