org.apache.jackrabbit.oak.jcr.session
Class NodeImpl<T extends NodeDelegate>

java.lang.Object
  extended by org.apache.jackrabbit.oak.jcr.session.NodeImpl<T>
Type Parameters:
T - the delegate type
All Implemented Interfaces:
javax.jcr.Item, javax.jcr.Node, org.apache.jackrabbit.api.JackrabbitNode
Direct Known Subclasses:
VersionHistoryImpl, VersionImpl

public class NodeImpl<T extends NodeDelegate>
extends Object
implements javax.jcr.Node, org.apache.jackrabbit.api.JackrabbitNode

TODO document


Field Summary
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
           
 
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
NodeImpl(T dlg, SessionContext sessionContext)
           
 
Method Summary
 void accept(javax.jcr.ItemVisitor visitor)
           
 void addMixin(String mixinName)
           
 javax.jcr.Node addNode(String relPath)
           
 javax.jcr.Node addNode(String relPath, String primaryNodeTypeName)
           
 boolean canAddMixin(String mixinName)
           
 void cancelMerge(javax.jcr.version.Version version)
           
 javax.jcr.version.Version checkin()
           
 void checkout()
           
protected  org.apache.jackrabbit.oak.api.PropertyState createMultiState(String oakName, List<javax.jcr.Value> values, org.apache.jackrabbit.oak.api.Type<?> type)
           
static NodeImpl<? extends NodeDelegate> createNode(NodeDelegate delegate, SessionContext context)
           
static NodeImpl<? extends NodeDelegate> createNodeOrNull(NodeDelegate delegate, SessionContext context)
           
protected  org.apache.jackrabbit.oak.api.PropertyState createSingleState(String oakName, javax.jcr.Value value, org.apache.jackrabbit.oak.api.Type<?> type)
           
 void doneMerge(javax.jcr.version.Version version)
           
 void followLifecycleTransition(String transition)
           
 String[] getAllowedLifecycleTransistions()
           
 javax.jcr.Item getAncestor(int depth)
           
 javax.jcr.version.Version getBaseVersion()
           
 String getCorrespondingNodePath(String workspaceName)
           
 javax.jcr.nodetype.NodeDefinition getDefinition()
           
 int getDepth()
           
 String getIdentifier()
           
 int getIndex()
           
 javax.jcr.lock.Lock getLock()
           
 javax.jcr.nodetype.NodeType[] getMixinNodeTypes()
           
 String getName()
           
 javax.jcr.Node getNode(String relPath)
           
 javax.jcr.NodeIterator getNodes()
           
 javax.jcr.NodeIterator getNodes(String namePattern)
           
 javax.jcr.NodeIterator getNodes(String[] nameGlobs)
           
 javax.jcr.Node getParent()
           
 String getPath()
           
 javax.jcr.Item getPrimaryItem()
           
 javax.jcr.nodetype.NodeType getPrimaryNodeType()
           
 javax.jcr.PropertyIterator getProperties()
           
 javax.jcr.PropertyIterator getProperties(String namePattern)
           
 javax.jcr.PropertyIterator getProperties(String[] nameGlobs)
           
 javax.jcr.Property getProperty(String relPath)
           
 javax.jcr.PropertyIterator getReferences()
           
 javax.jcr.PropertyIterator getReferences(String name)
           
 javax.jcr.Session getSession()
           
 javax.jcr.NodeIterator getSharedSet()
           
 String getUUID()
           
 javax.jcr.version.VersionHistory getVersionHistory()
           
 javax.jcr.PropertyIterator getWeakReferences()
           
 javax.jcr.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(javax.jcr.Item otherItem)
           
 javax.jcr.lock.Lock lock(boolean isDeep, boolean isSessionScoped)
           
 javax.jcr.NodeIterator merge(String srcWorkspace, boolean bestEffort)
           
 void orderBefore(String srcChildRelPath, String destChildRelPath)
           
protected
<U> U
perform(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(javax.jcr.version.Version version, boolean removeExisting)
           
 void restore(javax.jcr.version.Version version, String relPath, boolean removeExisting)
           
 void restoreByLabel(String versionLabel, boolean removeExisting)
           
protected
<U> U
safePerform(SessionOperation<U> op)
          Perform the passed SessionOperation assuming it does not throw an RepositoryException.
 void save()
          This implementation delegates to Session.save() if SAVE_SESSION is true.
 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)
           
 javax.jcr.Property setProperty(String name, BigDecimal value)
           
 javax.jcr.Property setProperty(String name, javax.jcr.Binary value)
           
 javax.jcr.Property setProperty(String name, boolean value)
           
 javax.jcr.Property setProperty(String name, Calendar value)
           
 javax.jcr.Property setProperty(String name, double value)
           
 javax.jcr.Property setProperty(String name, InputStream value)
           
 javax.jcr.Property setProperty(String name, long value)
           
 javax.jcr.Property setProperty(String name, javax.jcr.Node value)
           
 javax.jcr.Property setProperty(String name, String value)
           
 javax.jcr.Property setProperty(String name, String[] values)
           
 javax.jcr.Property setProperty(String name, String[] values, int type)
           
 javax.jcr.Property setProperty(String name, String value, int type)
           
 javax.jcr.Property setProperty(String name, javax.jcr.Value value)
           
 javax.jcr.Property setProperty(String name, javax.jcr.Value[] values)
           
 javax.jcr.Property setProperty(String jcrName, javax.jcr.Value[] values, int type)
           
 javax.jcr.Property setProperty(String name, javax.jcr.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 of 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().


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

public static NodeImpl<? extends NodeDelegate> createNodeOrNull(NodeDelegate delegate,
                                                                SessionContext context)
                                                         throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

createNode

public static NodeImpl<? extends NodeDelegate> createNode(NodeDelegate delegate,
                                                          SessionContext context)
                                                   throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

isNode

public boolean isNode()
Specified by:
isNode in interface javax.jcr.Item
See Also:
Item.isNode()

getParent

@Nonnull
public javax.jcr.Node getParent()
                         throws javax.jcr.RepositoryException
Specified by:
getParent in interface javax.jcr.Item
Throws:
javax.jcr.RepositoryException
See Also:
Item.getParent()

isNew

public boolean isNew()
Specified by:
isNew in interface javax.jcr.Item
See Also:
Item.isNew()

isModified

public boolean isModified()
Specified by:
isModified in interface javax.jcr.Item
See Also:
Item.isModified()

remove

public void remove()
            throws javax.jcr.RepositoryException
Specified by:
remove in interface javax.jcr.Item
Throws:
javax.jcr.RepositoryException
See Also:
Item.remove()

accept

public void accept(javax.jcr.ItemVisitor visitor)
            throws javax.jcr.RepositoryException
Specified by:
accept in interface javax.jcr.Item
Throws:
javax.jcr.RepositoryException

addNode

@Nonnull
public javax.jcr.Node addNode(String relPath)
                       throws javax.jcr.RepositoryException
Specified by:
addNode in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.addNode(String)

addNode

@Nonnull
public javax.jcr.Node addNode(String relPath,
                                      String primaryNodeTypeName)
                       throws javax.jcr.RepositoryException
Specified by:
addNode in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

orderBefore

public void orderBefore(String srcChildRelPath,
                        String destChildRelPath)
                 throws javax.jcr.RepositoryException
Specified by:
orderBefore in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

@Nonnull
public javax.jcr.Property setProperty(String name,
                                              javax.jcr.Value value)
                               throws javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

@Nonnull
public javax.jcr.Property setProperty(String name,
                                              javax.jcr.Value value,
                                              int type)
                               throws javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

@Nonnull
public javax.jcr.Property setProperty(String name,
                                              javax.jcr.Value[] values)
                               throws javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

@Nonnull
public javax.jcr.Property setProperty(String jcrName,
                                              javax.jcr.Value[] values,
                                              int type)
                               throws javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

@Nonnull
public javax.jcr.Property setProperty(String name,
                                              String[] values)
                               throws javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

@Nonnull
public javax.jcr.Property setProperty(String name,
                                              String[] values,
                                              int type)
                               throws javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

@Nonnull
public javax.jcr.Property setProperty(String name,
                                              String value)
                               throws javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

@Nonnull
public javax.jcr.Property setProperty(String name,
                                              String value,
                                              int type)
                               throws javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

@Nonnull
public javax.jcr.Property setProperty(String name,
                                              InputStream value)
                               throws javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

@Nonnull
public javax.jcr.Property setProperty(String name,
                                              javax.jcr.Binary value)
                               throws javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

@Nonnull
public javax.jcr.Property setProperty(String name,
                                              boolean value)
                               throws javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

@Nonnull
public javax.jcr.Property setProperty(String name,
                                              double value)
                               throws javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

@Nonnull
public javax.jcr.Property setProperty(String name,
                                              BigDecimal value)
                               throws javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

@Nonnull
public javax.jcr.Property setProperty(String name,
                                              long value)
                               throws javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

@Nonnull
public javax.jcr.Property setProperty(String name,
                                              Calendar value)
                               throws javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

@Nonnull
public javax.jcr.Property setProperty(String name,
                                              javax.jcr.Node value)
                               throws javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getNode

@Nonnull
public javax.jcr.Node getNode(String relPath)
                       throws javax.jcr.RepositoryException
Specified by:
getNode in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getNodes

@Nonnull
public javax.jcr.NodeIterator getNodes()
                                throws javax.jcr.RepositoryException
Specified by:
getNodes in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getNodes

@Nonnull
public javax.jcr.NodeIterator getNodes(String namePattern)
                                throws javax.jcr.RepositoryException
Specified by:
getNodes in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getNodes

@Nonnull
public javax.jcr.NodeIterator getNodes(String[] nameGlobs)
                                throws javax.jcr.RepositoryException
Specified by:
getNodes in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getProperty

@Nonnull
public javax.jcr.Property getProperty(String relPath)
                               throws javax.jcr.RepositoryException
Specified by:
getProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getProperties

@Nonnull
public javax.jcr.PropertyIterator getProperties()
                                         throws javax.jcr.RepositoryException
Specified by:
getProperties in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getProperties

@Nonnull
public javax.jcr.PropertyIterator getProperties(String namePattern)
                                         throws javax.jcr.RepositoryException
Specified by:
getProperties in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getProperties

@Nonnull
public javax.jcr.PropertyIterator getProperties(String[] nameGlobs)
                                         throws javax.jcr.RepositoryException
Specified by:
getProperties in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getPrimaryItem

@Nonnull
public javax.jcr.Item getPrimaryItem()
                              throws javax.jcr.RepositoryException
Specified by:
getPrimaryItem in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.getPrimaryItem()

getUUID

@Nonnull
public String getUUID()
               throws javax.jcr.RepositoryException
Specified by:
getUUID in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.getUUID()

getIdentifier

@Nonnull
public String getIdentifier()
                     throws javax.jcr.RepositoryException
Specified by:
getIdentifier in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getIndex

public int getIndex()
             throws javax.jcr.RepositoryException
Specified by:
getIndex in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getReferences

@Nonnull
public javax.jcr.PropertyIterator getReferences()
                                         throws javax.jcr.RepositoryException
Specified by:
getReferences in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.getReferences()

getReferences

@Nonnull
public javax.jcr.PropertyIterator getReferences(String name)
                                         throws javax.jcr.RepositoryException
Specified by:
getReferences in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getWeakReferences

@Nonnull
public javax.jcr.PropertyIterator getWeakReferences()
                                             throws javax.jcr.RepositoryException
Specified by:
getWeakReferences in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.getWeakReferences()

getWeakReferences

@Nonnull
public javax.jcr.PropertyIterator getWeakReferences(String name)
                                             throws javax.jcr.RepositoryException
Specified by:
getWeakReferences in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

hasNode

public boolean hasNode(String relPath)
                throws javax.jcr.RepositoryException
Specified by:
hasNode in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

hasProperty

public boolean hasProperty(String relPath)
                    throws javax.jcr.RepositoryException
Specified by:
hasProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

hasNodes

public boolean hasNodes()
                 throws javax.jcr.RepositoryException
Specified by:
hasNodes in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

hasProperties

public boolean hasProperties()
                      throws javax.jcr.RepositoryException
Specified by:
hasProperties in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getPrimaryNodeType

@Nonnull
public javax.jcr.nodetype.NodeType getPrimaryNodeType()
                                               throws javax.jcr.RepositoryException
Specified by:
getPrimaryNodeType in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.getPrimaryNodeType()

getMixinNodeTypes

@Nonnull
public javax.jcr.nodetype.NodeType[] getMixinNodeTypes()
                                                throws javax.jcr.RepositoryException
Specified by:
getMixinNodeTypes in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.getMixinNodeTypes()

isNodeType

public boolean isNodeType(String nodeTypeName)
                   throws javax.jcr.RepositoryException
Specified by:
isNodeType in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setPrimaryType

public void setPrimaryType(String nodeTypeName)
                    throws javax.jcr.RepositoryException
Specified by:
setPrimaryType in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

addMixin

public void addMixin(String mixinName)
              throws javax.jcr.RepositoryException
Specified by:
addMixin in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

removeMixin

public void removeMixin(String mixinName)
                 throws javax.jcr.RepositoryException
Specified by:
removeMixin in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

canAddMixin

public boolean canAddMixin(String mixinName)
                    throws javax.jcr.RepositoryException
Specified by:
canAddMixin in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getDefinition

@Nonnull
public javax.jcr.nodetype.NodeDefinition getDefinition()
                                                throws javax.jcr.RepositoryException
Specified by:
getDefinition in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getCorrespondingNodePath

@Nonnull
public String getCorrespondingNodePath(String workspaceName)
                                throws javax.jcr.RepositoryException
Specified by:
getCorrespondingNodePath in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

update

public void update(String srcWorkspace)
            throws javax.jcr.RepositoryException
Specified by:
update in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

checkin

@Nonnull
public javax.jcr.version.Version checkin()
                                  throws javax.jcr.RepositoryException
Specified by:
checkin in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.checkin()

checkout

public void checkout()
              throws javax.jcr.RepositoryException
Specified by:
checkout in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.checkout()

doneMerge

public void doneMerge(javax.jcr.version.Version version)
               throws javax.jcr.RepositoryException
Specified by:
doneMerge in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.doneMerge(javax.jcr.version.Version)

cancelMerge

public void cancelMerge(javax.jcr.version.Version version)
                 throws javax.jcr.RepositoryException
Specified by:
cancelMerge in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.cancelMerge(javax.jcr.version.Version)

merge

@Nonnull
public javax.jcr.NodeIterator merge(String srcWorkspace,
                                            boolean bestEffort)
                             throws javax.jcr.RepositoryException
Specified by:
merge in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.merge(String, boolean)

isCheckedOut

public boolean isCheckedOut()
                     throws javax.jcr.RepositoryException
Specified by:
isCheckedOut in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.isCheckedOut()

restore

public void restore(String versionName,
                    boolean removeExisting)
             throws javax.jcr.RepositoryException
Specified by:
restore in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.restore(String, boolean)

restore

public void restore(javax.jcr.version.Version version,
                    boolean removeExisting)
             throws javax.jcr.RepositoryException
Specified by:
restore in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.restore(javax.jcr.version.Version, boolean)

restore

public void restore(javax.jcr.version.Version version,
                    String relPath,
                    boolean removeExisting)
             throws javax.jcr.RepositoryException
Specified by:
restore in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.restore(Version, String, boolean)

restoreByLabel

public void restoreByLabel(String versionLabel,
                           boolean removeExisting)
                    throws javax.jcr.RepositoryException
Specified by:
restoreByLabel in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.restoreByLabel(String, boolean)

getVersionHistory

@Nonnull
public javax.jcr.version.VersionHistory getVersionHistory()
                                                   throws javax.jcr.RepositoryException
Specified by:
getVersionHistory in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.getVersionHistory()

getBaseVersion

@Nonnull
public javax.jcr.version.Version getBaseVersion()
                                         throws javax.jcr.RepositoryException
Specified by:
getBaseVersion in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.getBaseVersion()

isLocked

public boolean isLocked()
                 throws javax.jcr.RepositoryException
Specified by:
isLocked in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

holdsLock

public boolean holdsLock()
                  throws javax.jcr.RepositoryException
Specified by:
holdsLock in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getLock

@Nonnull
public javax.jcr.lock.Lock getLock()
                            throws javax.jcr.RepositoryException
Specified by:
getLock in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

lock

@Nonnull
public javax.jcr.lock.Lock lock(boolean isDeep,
                                        boolean isSessionScoped)
                         throws javax.jcr.RepositoryException
Specified by:
lock in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

unlock

public void unlock()
            throws javax.jcr.RepositoryException
Specified by:
unlock in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getSharedSet

@Nonnull
public javax.jcr.NodeIterator getSharedSet()
Specified by:
getSharedSet in interface javax.jcr.Node

removeSharedSet

public void removeSharedSet()
                     throws javax.jcr.RepositoryException
Specified by:
removeSharedSet in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

removeShare

public void removeShare()
                 throws javax.jcr.RepositoryException
Specified by:
removeShare in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

followLifecycleTransition

public void followLifecycleTransition(String transition)
                               throws javax.jcr.RepositoryException
Specified by:
followLifecycleTransition in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.followLifecycleTransition(String)

getAllowedLifecycleTransistions

@Nonnull
public String[] getAllowedLifecycleTransistions()
                                         throws javax.jcr.RepositoryException
Specified by:
getAllowedLifecycleTransistions in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException
See Also:
Node.getAllowedLifecycleTransistions()

rename

public void rename(String newName)
            throws javax.jcr.RepositoryException
Simplified implementation of 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.

Specified by:
rename in interface org.apache.jackrabbit.api.JackrabbitNode
Parameters:
newName - The new name of this node.
Throws:
javax.jcr.RepositoryException - If an error occurs.

setMixins

public void setMixins(String[] mixinNames)
               throws javax.jcr.RepositoryException
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. 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 interface org.apache.jackrabbit.api.JackrabbitNode
Parameters:
mixinNames -
Throws:
javax.jcr.RepositoryException

perform

@CheckForNull
protected final <U> U perform(@Nonnull
                                           SessionOperation<U> op)
                   throws javax.jcr.RepositoryException
Perform the passed SessionOperation.

Type Parameters:
U - return type of the operation
Parameters:
op - operation to perform
Returns:
the result of op.perform()
Throws:
javax.jcr.RepositoryException - as thrown by op.perform().

safePerform

@CheckForNull
protected final <U> U safePerform(@Nonnull
                                               SessionOperation<U> op)
Perform the passed SessionOperation assuming it does not throw an RepositoryException. If it does, wrap it into and throw it as a RuntimeException.

Type Parameters:
U - return type of the operation
Parameters:
op - operation to perform
Returns:
the result of op.perform()

getName

@Nonnull
public String getName()
               throws javax.jcr.RepositoryException
Specified by:
getName in interface javax.jcr.Item
Throws:
javax.jcr.RepositoryException
See Also:
Item.getName()

getPath

@Nonnull
public String getPath()
               throws javax.jcr.RepositoryException
Specified by:
getPath in interface javax.jcr.Item
Throws:
javax.jcr.RepositoryException
See Also:
Item.getPath()

getSession

@Nonnull
public javax.jcr.Session getSession()
Specified by:
getSession in interface javax.jcr.Item

getAncestor

public javax.jcr.Item getAncestor(int depth)
                           throws javax.jcr.RepositoryException
Specified by:
getAncestor in interface javax.jcr.Item
Throws:
javax.jcr.RepositoryException

getDepth

public int getDepth()
             throws javax.jcr.RepositoryException
Specified by:
getDepth in interface javax.jcr.Item
Throws:
javax.jcr.RepositoryException

isSame

public boolean isSame(javax.jcr.Item otherItem)
               throws javax.jcr.RepositoryException
Specified by:
isSame in interface javax.jcr.Item
Throws:
javax.jcr.RepositoryException
See Also:
Item.isSame(javax.jcr.Item)

save

public void save()
          throws javax.jcr.RepositoryException
This implementation delegates to 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 UnsupportedRepositoryOperationException

Specified by:
save in interface javax.jcr.Item
Throws:
javax.jcr.RepositoryException
See Also:
Item.save()

refresh

public void refresh(boolean keepChanges)
             throws javax.jcr.RepositoryException
Specified by:
refresh in interface javax.jcr.Item
Throws:
javax.jcr.RepositoryException
See Also:
Item.refresh(boolean)

toString

public String toString()
Overrides:
toString in class Object

createSingleState

protected org.apache.jackrabbit.oak.api.PropertyState createSingleState(String oakName,
                                                                        javax.jcr.Value value,
                                                                        org.apache.jackrabbit.oak.api.Type<?> type)
                                                                 throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

createMultiState

protected org.apache.jackrabbit.oak.api.PropertyState createMultiState(String oakName,
                                                                       List<javax.jcr.Value> values,
                                                                       org.apache.jackrabbit.oak.api.Type<?> type)
                                                                throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException


Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.