org.priha.core
Class NodeImpl

java.lang.Object
  extended by org.priha.core.ItemImpl
      extended by org.priha.core.NodeImpl
All Implemented Interfaces:
java.lang.Comparable<javax.jcr.Node>, javax.jcr.Item, javax.jcr.Node
Direct Known Subclasses:
VersionHistoryImpl, VersionImpl

public class NodeImpl
extends ItemImpl
implements javax.jcr.Node, java.lang.Comparable<javax.jcr.Node>

Implements a Node. This is one of the most heavy classes in Priha, with a lot of stuff happening. The NodeImpl class does some basic caching for some state objects, so keeping references can be faster in some cases.


Field Summary
protected  java.lang.String m_cachedUUID
           
 
Fields inherited from class org.priha.core.ItemImpl
m_isNew, m_path, m_session
 
Constructor Summary
protected NodeImpl(SessionImpl session, Path path, QNodeType primaryType, QNodeDefinition nDef, boolean populateDefaults)
           
protected NodeImpl(SessionImpl session, java.lang.String path, QNodeType primaryType, QNodeDefinition nDef, boolean populateDefaults)
           
 
Method Summary
 void addMixin(java.lang.String mixinName)
           
 NodeImpl addNode(java.lang.String relPath)
           
 NodeImpl addNode(java.lang.String relPath, java.lang.String primaryNodeTypeName)
           
 boolean canAddMixin(java.lang.String mixinName)
           
 void cancelMerge(javax.jcr.version.Version version)
           
 VersionImpl checkin()
           
 void checkout()
           
 int compareTo(javax.jcr.Node nd)
           
 void doneMerge(javax.jcr.version.Version version)
           
 boolean equals(java.lang.Object obj)
          We consider nodes to be equal if they have the exact same path, and all the properties are equal too.
 QPropertyDefinition findPropertyDefinition(QName propertyName, boolean multiple)
          Locates a PropertyDefinition for the given property name from the array of the mixintypes and the primary type for this Node.
 VersionImpl getBaseVersion()
           
protected  java.util.List<Path> getChildOrder()
           
 PropertyImpl getChildProperty(java.lang.String name)
           
 java.lang.String getCorrespondingNodePath(java.lang.String workspaceName)
           
 javax.jcr.nodetype.NodeDefinition getDefinition()
           
 int getIndex()
           
 QLock.Impl getLock()
           
 javax.jcr.nodetype.NodeType[] getMixinNodeTypes()
           
 NodeImpl getNode(Path absPath)
           
 NodeImpl getNode(QName name)
           
 NodeImpl getNode(java.lang.String relPath)
           
 javax.jcr.NodeIterator getNodes()
          Returns a lazy iterator over the children of this Node.
 javax.jcr.NodeIterator getNodes(java.lang.String namePattern)
           
 ItemImpl getPrimaryItem()
           
 QNodeType.Impl getPrimaryNodeType()
           
 QNodeType getPrimaryQNodeType()
           
 LazyPropertyIteratorImpl getProperties()
           
 javax.jcr.PropertyIterator getProperties(java.lang.String namePattern)
           
 PropertyImpl getProperty(QName propName)
           
 PropertyImpl getProperty(java.lang.String relPath)
           
 QNodeDefinition getQDefinition()
           
 javax.jcr.PropertyIterator getReferences()
           
 java.lang.String getUUID()
          Returns the UUID for this node.
 VersionHistoryImpl getVersionHistory()
           
 boolean hasNode(QName name)
          Returns true, if this Node has a child with the given QName.
 boolean hasNode(java.lang.String relPath)
           
 boolean hasNodes()
           
 boolean hasProperties()
           
 boolean hasProperty(QName propName)
           
 boolean hasProperty(java.lang.String relPath)
           
 boolean hasTag(java.lang.String name)
          Returns true, if this Node has the named tag (i.e.
 boolean holdsLock()
           
protected  void internalSave()
           
 boolean isCheckedOut()
           
 boolean isLocked()
           
protected  boolean isLockedWithoutToken()
          Returns true, if this Node is locked (that is, it or it's parents are locked) but the Session which owns this Session does not hold a token to modify it.
 boolean isNode()
          
 boolean isNodeType(java.lang.String nodeTypeName)
           
 javax.jcr.lock.Lock lock(boolean isDeep, boolean isSessionScoped)
           
 javax.jcr.NodeIterator merge(java.lang.String srcWorkspace, boolean bestEffort)
           
 void orderBefore(java.lang.String srcChildRelPath, java.lang.String destChildRelPath)
           
protected  void preSave()
          Performs mandatory housekeeping right before saving.
 void remove()
          
 void removeMixin(java.lang.String mixinName)
           
protected  void removeProperty(PropertyImpl prop)
          Removes a given property from the node.
 void restore(java.lang.String versionName, boolean removeExisting)
           
 void restore(javax.jcr.version.Version version, boolean removeExisting)
           
 void restore(javax.jcr.version.Version version, java.lang.String relPath, boolean removeExisting)
           
 void restoreByLabel(java.lang.String versionLabel, boolean removeExisting)
           
 void sanitize()
          Assumes nothing, goes through the properties, makes sure all things are correct.
 void save()
          
protected  void setChildOrder(java.util.List<Path> list)
           
 PropertyImpl setProperty(java.lang.String name, boolean value)
           
 PropertyImpl setProperty(java.lang.String name, java.util.Calendar value)
           
 PropertyImpl setProperty(java.lang.String name, double value)
           
 PropertyImpl setProperty(java.lang.String name, java.io.InputStream value)
           
 PropertyImpl setProperty(java.lang.String name, long value)
           
 PropertyImpl setProperty(java.lang.String name, javax.jcr.Node value)
           
 PropertyImpl setProperty(java.lang.String name, java.lang.String value)
           
 javax.jcr.Property setProperty(java.lang.String name, java.lang.String[] values)
           
 javax.jcr.Property setProperty(java.lang.String name, java.lang.String[] values, int type)
           
 PropertyImpl setProperty(java.lang.String name, java.lang.String value, int type)
           
 PropertyImpl setProperty(java.lang.String name, javax.jcr.Value value)
           
 PropertyImpl setProperty(java.lang.String name, javax.jcr.Value[] values)
           
 javax.jcr.Property setProperty(java.lang.String name, javax.jcr.Value[] values, int type)
           
 PropertyImpl setProperty(java.lang.String name, javax.jcr.Value value, int type)
           
 void tag(java.lang.String name)
          Tag a Node with the given transient property.
 void tag(java.lang.String name, java.lang.String value)
          Tags a Node with a given transient property with a String value.
 void unlock()
           
 void update(java.lang.String srcWorkspaceName)
           
 
Methods inherited from class org.priha.core.ItemImpl
accept, enterState, getAncestor, getCreationTime, getDepth, getInternalPath, getName, getParent, getPath, getPathReference, getQName, getSession, getState, hashCode, isModified, isNew, isSame, postSave, refresh, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.jcr.Item
accept, getAncestor, getDepth, getName, getParent, getPath, getSession, isModified, isNew, isSame, refresh
 

Field Detail

m_cachedUUID

protected java.lang.String m_cachedUUID
Constructor Detail

NodeImpl

protected NodeImpl(SessionImpl session,
                   Path path,
                   QNodeType primaryType,
                   QNodeDefinition nDef,
                   boolean populateDefaults)
            throws javax.jcr.ValueFormatException,
                   javax.jcr.version.VersionException,
                   javax.jcr.lock.LockException,
                   javax.jcr.nodetype.ConstraintViolationException,
                   javax.jcr.RepositoryException
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

NodeImpl

protected NodeImpl(SessionImpl session,
                   java.lang.String path,
                   QNodeType primaryType,
                   QNodeDefinition nDef,
                   boolean populateDefaults)
            throws javax.jcr.ValueFormatException,
                   javax.jcr.version.VersionException,
                   javax.jcr.lock.LockException,
                   javax.jcr.nodetype.ConstraintViolationException,
                   javax.jcr.RepositoryException
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException
Method Detail

addNode

public NodeImpl addNode(java.lang.String relPath)
                 throws javax.jcr.ItemExistsException,
                        javax.jcr.PathNotFoundException,
                        javax.jcr.nodetype.NoSuchNodeTypeException,
                        javax.jcr.lock.LockException,
                        javax.jcr.version.VersionException,
                        javax.jcr.nodetype.ConstraintViolationException,
                        javax.jcr.RepositoryException
Specified by:
addNode in interface javax.jcr.Node
Throws:
javax.jcr.ItemExistsException
javax.jcr.PathNotFoundException
javax.jcr.nodetype.NoSuchNodeTypeException
javax.jcr.lock.LockException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

addNode

public NodeImpl addNode(java.lang.String relPath,
                        java.lang.String primaryNodeTypeName)
                 throws javax.jcr.ItemExistsException,
                        javax.jcr.PathNotFoundException,
                        javax.jcr.version.VersionException,
                        javax.jcr.nodetype.ConstraintViolationException,
                        javax.jcr.lock.LockException,
                        javax.jcr.RepositoryException
Specified by:
addNode in interface javax.jcr.Node
Throws:
javax.jcr.ItemExistsException
javax.jcr.PathNotFoundException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.lock.LockException
javax.jcr.RepositoryException

getCorrespondingNodePath

public java.lang.String getCorrespondingNodePath(java.lang.String workspaceName)
                                          throws javax.jcr.ItemNotFoundException,
                                                 javax.jcr.NoSuchWorkspaceException,
                                                 javax.jcr.AccessDeniedException,
                                                 javax.jcr.RepositoryException
Specified by:
getCorrespondingNodePath in interface javax.jcr.Node
Throws:
javax.jcr.ItemNotFoundException
javax.jcr.NoSuchWorkspaceException
javax.jcr.AccessDeniedException
javax.jcr.RepositoryException

getDefinition

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

getQDefinition

public QNodeDefinition getQDefinition()

getIndex

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

getChildOrder

protected java.util.List<Path> getChildOrder()

setChildOrder

protected void setChildOrder(java.util.List<Path> list)

getNode

public NodeImpl getNode(Path absPath)
                 throws javax.jcr.PathNotFoundException,
                        javax.jcr.RepositoryException
Throws:
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException

getNode

public NodeImpl getNode(java.lang.String relPath)
                 throws javax.jcr.PathNotFoundException,
                        javax.jcr.RepositoryException
Specified by:
getNode in interface javax.jcr.Node
Throws:
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException

getNode

public NodeImpl getNode(QName name)
                 throws javax.jcr.PathNotFoundException,
                        javax.jcr.RepositoryException
Throws:
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException

getNodes

public javax.jcr.NodeIterator getNodes()
                                throws javax.jcr.RepositoryException
Returns a lazy iterator over the children of this Node.

Specified by:
getNodes in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getNodes

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

getPrimaryItem

public ItemImpl getPrimaryItem()
                        throws javax.jcr.ItemNotFoundException,
                               javax.jcr.RepositoryException
Specified by:
getPrimaryItem in interface javax.jcr.Node
Throws:
javax.jcr.ItemNotFoundException
javax.jcr.RepositoryException

getPrimaryQNodeType

public QNodeType getPrimaryQNodeType()

getPrimaryNodeType

public QNodeType.Impl getPrimaryNodeType()
                                  throws javax.jcr.RepositoryException
Specified by:
getPrimaryNodeType in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getProperties

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

getProperties

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

getChildProperty

public PropertyImpl getChildProperty(java.lang.String name)
                              throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getProperty

public PropertyImpl getProperty(QName propName)
                         throws javax.jcr.PathNotFoundException,
                                javax.jcr.RepositoryException
Throws:
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException

getProperty

public PropertyImpl getProperty(java.lang.String relPath)
                         throws javax.jcr.PathNotFoundException,
                                javax.jcr.RepositoryException
Specified by:
getProperty in interface javax.jcr.Node
Throws:
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException

getReferences

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

getUUID

public java.lang.String getUUID()
                         throws javax.jcr.UnsupportedRepositoryOperationException,
                                javax.jcr.RepositoryException
Returns the UUID for this node. Utilizes an internal cache for the UUID, so is fast after the first call.

Specified by:
getUUID in interface javax.jcr.Node
Throws:
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException

getVersionHistory

public VersionHistoryImpl getVersionHistory()
                                     throws javax.jcr.UnsupportedRepositoryOperationException,
                                            javax.jcr.RepositoryException
Specified by:
getVersionHistory in interface javax.jcr.Node
Throws:
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException

hasNode

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

hasNode

public boolean hasNode(QName name)
                throws javax.jcr.RepositoryException
Returns true, if this Node has a child with the given QName.

Parameters:
name - A QName.
Returns:
True, if there is a child by this name.
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

hasProperty

public boolean hasProperty(QName propName)
                    throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

hasProperty

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

isNodeType

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

orderBefore

public void orderBefore(java.lang.String srcChildRelPath,
                        java.lang.String destChildRelPath)
                 throws javax.jcr.UnsupportedRepositoryOperationException,
                        javax.jcr.version.VersionException,
                        javax.jcr.nodetype.ConstraintViolationException,
                        javax.jcr.ItemNotFoundException,
                        javax.jcr.lock.LockException,
                        javax.jcr.RepositoryException
Specified by:
orderBefore in interface javax.jcr.Node
Throws:
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.ItemNotFoundException
javax.jcr.lock.LockException
javax.jcr.RepositoryException

removeProperty

protected void removeProperty(PropertyImpl prop)
                       throws javax.jcr.RepositoryException
Removes a given property from the node.

Parameters:
prop -
Throws:
javax.jcr.RepositoryException

setProperty

public PropertyImpl setProperty(java.lang.String name,
                                javax.jcr.Value value)
                         throws javax.jcr.ValueFormatException,
                                javax.jcr.version.VersionException,
                                javax.jcr.lock.LockException,
                                javax.jcr.nodetype.ConstraintViolationException,
                                javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setProperty

public PropertyImpl setProperty(java.lang.String name,
                                javax.jcr.Value value,
                                int type)
                         throws javax.jcr.ValueFormatException,
                                javax.jcr.version.VersionException,
                                javax.jcr.lock.LockException,
                                javax.jcr.nodetype.ConstraintViolationException,
                                javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setProperty

public PropertyImpl setProperty(java.lang.String name,
                                javax.jcr.Value[] values)
                         throws javax.jcr.ValueFormatException,
                                javax.jcr.version.VersionException,
                                javax.jcr.lock.LockException,
                                javax.jcr.nodetype.ConstraintViolationException,
                                javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setProperty

public javax.jcr.Property setProperty(java.lang.String name,
                                      javax.jcr.Value[] values,
                                      int type)
                               throws javax.jcr.ValueFormatException,
                                      javax.jcr.version.VersionException,
                                      javax.jcr.lock.LockException,
                                      javax.jcr.nodetype.ConstraintViolationException,
                                      javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setProperty

public javax.jcr.Property setProperty(java.lang.String name,
                                      java.lang.String[] values)
                               throws javax.jcr.ValueFormatException,
                                      javax.jcr.version.VersionException,
                                      javax.jcr.lock.LockException,
                                      javax.jcr.nodetype.ConstraintViolationException,
                                      javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setProperty

public javax.jcr.Property setProperty(java.lang.String name,
                                      java.lang.String[] values,
                                      int type)
                               throws javax.jcr.ValueFormatException,
                                      javax.jcr.version.VersionException,
                                      javax.jcr.lock.LockException,
                                      javax.jcr.nodetype.ConstraintViolationException,
                                      javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

tag

public void tag(java.lang.String name)
         throws javax.jcr.ValueFormatException,
                javax.jcr.version.VersionException,
                javax.jcr.lock.LockException,
                javax.jcr.nodetype.ConstraintViolationException,
                javax.jcr.RepositoryException
Tag a Node with the given transient property. Priha uses this internally to store metadata (or a property) which is never saved. Transient properties are never saved.

Parameters:
name -
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException
See Also:
PropertyImpl.isTransient()

tag

public void tag(java.lang.String name,
                java.lang.String value)
         throws javax.jcr.ValueFormatException,
                javax.jcr.version.VersionException,
                javax.jcr.lock.LockException,
                javax.jcr.nodetype.ConstraintViolationException,
                javax.jcr.RepositoryException
Tags a Node with a given transient property with a String value. In practice, this sets a String property and marks it transient (i.e. never saved).

Parameters:
name - Name of the property to set
value - Value for the property
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException
See Also:
PropertyImpl.isTransient()

hasTag

public boolean hasTag(java.lang.String name)
               throws javax.jcr.RepositoryException
Returns true, if this Node has the named tag (i.e. it has a transient Property by this name).

Parameters:
name - Tag to check for
Returns:
True, if the tag exists. False otherwise.
Throws:
javax.jcr.RepositoryException - If the Repository is b0rken.
See Also:
PropertyImpl.isTransient()

setProperty

public PropertyImpl setProperty(java.lang.String name,
                                java.lang.String value)
                         throws javax.jcr.ValueFormatException,
                                javax.jcr.version.VersionException,
                                javax.jcr.lock.LockException,
                                javax.jcr.nodetype.ConstraintViolationException,
                                javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setProperty

public PropertyImpl setProperty(java.lang.String name,
                                java.lang.String value,
                                int type)
                         throws javax.jcr.ValueFormatException,
                                javax.jcr.version.VersionException,
                                javax.jcr.lock.LockException,
                                javax.jcr.nodetype.ConstraintViolationException,
                                javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setProperty

public PropertyImpl setProperty(java.lang.String name,
                                java.io.InputStream value)
                         throws javax.jcr.ValueFormatException,
                                javax.jcr.version.VersionException,
                                javax.jcr.lock.LockException,
                                javax.jcr.nodetype.ConstraintViolationException,
                                javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setProperty

public PropertyImpl setProperty(java.lang.String name,
                                boolean value)
                         throws javax.jcr.ValueFormatException,
                                javax.jcr.version.VersionException,
                                javax.jcr.lock.LockException,
                                javax.jcr.nodetype.ConstraintViolationException,
                                javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setProperty

public PropertyImpl setProperty(java.lang.String name,
                                double value)
                         throws javax.jcr.ValueFormatException,
                                javax.jcr.version.VersionException,
                                javax.jcr.lock.LockException,
                                javax.jcr.nodetype.ConstraintViolationException,
                                javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setProperty

public PropertyImpl setProperty(java.lang.String name,
                                long value)
                         throws javax.jcr.ValueFormatException,
                                javax.jcr.version.VersionException,
                                javax.jcr.lock.LockException,
                                javax.jcr.nodetype.ConstraintViolationException,
                                javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setProperty

public PropertyImpl setProperty(java.lang.String name,
                                java.util.Calendar value)
                         throws javax.jcr.ValueFormatException,
                                javax.jcr.version.VersionException,
                                javax.jcr.lock.LockException,
                                javax.jcr.nodetype.ConstraintViolationException,
                                javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setProperty

public PropertyImpl setProperty(java.lang.String name,
                                javax.jcr.Node value)
                         throws javax.jcr.ValueFormatException,
                                javax.jcr.version.VersionException,
                                javax.jcr.lock.LockException,
                                javax.jcr.nodetype.ConstraintViolationException,
                                javax.jcr.RepositoryException
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

update

public void update(java.lang.String srcWorkspaceName)
            throws javax.jcr.NoSuchWorkspaceException,
                   javax.jcr.AccessDeniedException,
                   javax.jcr.lock.LockException,
                   javax.jcr.InvalidItemStateException,
                   javax.jcr.RepositoryException
Specified by:
update in interface javax.jcr.Node
Throws:
javax.jcr.NoSuchWorkspaceException
javax.jcr.AccessDeniedException
javax.jcr.lock.LockException
javax.jcr.InvalidItemStateException
javax.jcr.RepositoryException

isNode

public boolean isNode()
Description copied from class: ItemImpl

Specified by:
isNode in interface javax.jcr.Item
Overrides:
isNode in class ItemImpl

internalSave

protected void internalSave()
                     throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

save

public void save()
          throws javax.jcr.AccessDeniedException,
                 javax.jcr.ItemExistsException,
                 javax.jcr.nodetype.ConstraintViolationException,
                 javax.jcr.InvalidItemStateException,
                 javax.jcr.ReferentialIntegrityException,
                 javax.jcr.version.VersionException,
                 javax.jcr.lock.LockException,
                 javax.jcr.nodetype.NoSuchNodeTypeException,
                 javax.jcr.RepositoryException
Description copied from class: ItemImpl

Specified by:
save in interface javax.jcr.Item
Specified by:
save in class ItemImpl
Throws:
javax.jcr.AccessDeniedException
javax.jcr.ItemExistsException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.InvalidItemStateException
javax.jcr.ReferentialIntegrityException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.NoSuchNodeTypeException
javax.jcr.RepositoryException

compareTo

public int compareTo(javax.jcr.Node nd)
Specified by:
compareTo in interface java.lang.Comparable<javax.jcr.Node>

remove

public void remove()
            throws javax.jcr.version.VersionException,
                   javax.jcr.lock.LockException,
                   javax.jcr.nodetype.ConstraintViolationException,
                   javax.jcr.RepositoryException
Description copied from class: ItemImpl

Specified by:
remove in interface javax.jcr.Item
Specified by:
remove in class ItemImpl
Throws:
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

findPropertyDefinition

public QPropertyDefinition findPropertyDefinition(QName propertyName,
                                                  boolean multiple)
                                           throws javax.jcr.RepositoryException
Locates a PropertyDefinition for the given property name from the array of the mixintypes and the primary type for this Node.

Parameters:
propertyName - The QName of the property to look for
multiple - Is this a multiproperty or a single property?
Returns:
A valid PropertyDefinition, or null, if it cannot be located.
Throws:
javax.jcr.RepositoryException - If mixin node types cannot be determined.

sanitize

public void sanitize()
              throws javax.jcr.RepositoryException
Assumes nothing, goes through the properties, makes sure all things are correct.

Throws:
javax.jcr.RepositoryException

equals

public boolean equals(java.lang.Object obj)
We consider nodes to be equal if they have the exact same path, and all the properties are equal too.

Overrides:
equals in class java.lang.Object

preSave

protected void preSave()
                throws javax.jcr.RepositoryException
Description copied from class: ItemImpl
Performs mandatory housekeeping right before saving.

Overrides:
preSave in class ItemImpl
Throws:
javax.jcr.RepositoryException - If something goes wrong

addMixin

public void addMixin(java.lang.String mixinName)
              throws javax.jcr.nodetype.NoSuchNodeTypeException,
                     javax.jcr.version.VersionException,
                     javax.jcr.nodetype.ConstraintViolationException,
                     javax.jcr.lock.LockException,
                     javax.jcr.RepositoryException
Specified by:
addMixin in interface javax.jcr.Node
Throws:
javax.jcr.nodetype.NoSuchNodeTypeException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.lock.LockException
javax.jcr.RepositoryException

canAddMixin

public boolean canAddMixin(java.lang.String mixinName)
                    throws javax.jcr.nodetype.NoSuchNodeTypeException,
                           javax.jcr.RepositoryException
Specified by:
canAddMixin in interface javax.jcr.Node
Throws:
javax.jcr.nodetype.NoSuchNodeTypeException
javax.jcr.RepositoryException

getMixinNodeTypes

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

removeMixin

public void removeMixin(java.lang.String mixinName)
                 throws javax.jcr.nodetype.NoSuchNodeTypeException,
                        javax.jcr.version.VersionException,
                        javax.jcr.nodetype.ConstraintViolationException,
                        javax.jcr.lock.LockException,
                        javax.jcr.RepositoryException
Specified by:
removeMixin in interface javax.jcr.Node
Throws:
javax.jcr.nodetype.NoSuchNodeTypeException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.lock.LockException
javax.jcr.RepositoryException

lock

public javax.jcr.lock.Lock lock(boolean isDeep,
                                boolean isSessionScoped)
                         throws javax.jcr.UnsupportedRepositoryOperationException,
                                javax.jcr.lock.LockException,
                                javax.jcr.AccessDeniedException,
                                javax.jcr.InvalidItemStateException,
                                javax.jcr.RepositoryException
Specified by:
lock in interface javax.jcr.Node
Throws:
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.lock.LockException
javax.jcr.AccessDeniedException
javax.jcr.InvalidItemStateException
javax.jcr.RepositoryException

unlock

public void unlock()
            throws javax.jcr.UnsupportedRepositoryOperationException,
                   javax.jcr.lock.LockException,
                   javax.jcr.AccessDeniedException,
                   javax.jcr.InvalidItemStateException,
                   javax.jcr.RepositoryException
Specified by:
unlock in interface javax.jcr.Node
Throws:
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.lock.LockException
javax.jcr.AccessDeniedException
javax.jcr.InvalidItemStateException
javax.jcr.RepositoryException

getLock

public QLock.Impl getLock()
                   throws javax.jcr.UnsupportedRepositoryOperationException,
                          javax.jcr.lock.LockException,
                          javax.jcr.AccessDeniedException,
                          javax.jcr.RepositoryException
Specified by:
getLock in interface javax.jcr.Node
Throws:
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.lock.LockException
javax.jcr.AccessDeniedException
javax.jcr.RepositoryException

holdsLock

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

isLocked

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

isLockedWithoutToken

protected boolean isLockedWithoutToken()
Returns true, if this Node is locked (that is, it or it's parents are locked) but the Session which owns this Session does not hold a token to modify it.

Returns:
True, if you cannot modify this Node due to missing token.

isCheckedOut

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

cancelMerge

public void cancelMerge(javax.jcr.version.Version version)
                 throws javax.jcr.version.VersionException,
                        javax.jcr.InvalidItemStateException,
                        javax.jcr.UnsupportedRepositoryOperationException,
                        javax.jcr.RepositoryException
Specified by:
cancelMerge in interface javax.jcr.Node
Throws:
javax.jcr.version.VersionException
javax.jcr.InvalidItemStateException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException

checkin

public VersionImpl checkin()
                    throws javax.jcr.version.VersionException,
                           javax.jcr.UnsupportedRepositoryOperationException,
                           javax.jcr.InvalidItemStateException,
                           javax.jcr.lock.LockException,
                           javax.jcr.RepositoryException
Specified by:
checkin in interface javax.jcr.Node
Throws:
javax.jcr.version.VersionException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.InvalidItemStateException
javax.jcr.lock.LockException
javax.jcr.RepositoryException

checkout

public void checkout()
              throws javax.jcr.UnsupportedRepositoryOperationException,
                     javax.jcr.lock.LockException,
                     javax.jcr.RepositoryException
Specified by:
checkout in interface javax.jcr.Node
Throws:
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.lock.LockException
javax.jcr.RepositoryException

doneMerge

public void doneMerge(javax.jcr.version.Version version)
               throws javax.jcr.version.VersionException,
                      javax.jcr.InvalidItemStateException,
                      javax.jcr.UnsupportedRepositoryOperationException,
                      javax.jcr.RepositoryException
Specified by:
doneMerge in interface javax.jcr.Node
Throws:
javax.jcr.version.VersionException
javax.jcr.InvalidItemStateException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException

getBaseVersion

public VersionImpl getBaseVersion()
                           throws javax.jcr.UnsupportedRepositoryOperationException,
                                  javax.jcr.RepositoryException
Specified by:
getBaseVersion in interface javax.jcr.Node
Throws:
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException

restore

public void restore(java.lang.String versionName,
                    boolean removeExisting)
             throws javax.jcr.version.VersionException,
                    javax.jcr.ItemExistsException,
                    javax.jcr.UnsupportedRepositoryOperationException,
                    javax.jcr.lock.LockException,
                    javax.jcr.InvalidItemStateException,
                    javax.jcr.RepositoryException
Specified by:
restore in interface javax.jcr.Node
Throws:
javax.jcr.version.VersionException
javax.jcr.ItemExistsException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.lock.LockException
javax.jcr.InvalidItemStateException
javax.jcr.RepositoryException

restore

public void restore(javax.jcr.version.Version version,
                    boolean removeExisting)
             throws javax.jcr.version.VersionException,
                    javax.jcr.ItemExistsException,
                    javax.jcr.UnsupportedRepositoryOperationException,
                    javax.jcr.lock.LockException,
                    javax.jcr.RepositoryException
Specified by:
restore in interface javax.jcr.Node
Throws:
javax.jcr.version.VersionException
javax.jcr.ItemExistsException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.lock.LockException
javax.jcr.RepositoryException

restore

public void restore(javax.jcr.version.Version version,
                    java.lang.String relPath,
                    boolean removeExisting)
             throws javax.jcr.PathNotFoundException,
                    javax.jcr.ItemExistsException,
                    javax.jcr.version.VersionException,
                    javax.jcr.nodetype.ConstraintViolationException,
                    javax.jcr.UnsupportedRepositoryOperationException,
                    javax.jcr.lock.LockException,
                    javax.jcr.InvalidItemStateException,
                    javax.jcr.RepositoryException
Specified by:
restore in interface javax.jcr.Node
Throws:
javax.jcr.PathNotFoundException
javax.jcr.ItemExistsException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.lock.LockException
javax.jcr.InvalidItemStateException
javax.jcr.RepositoryException

restoreByLabel

public void restoreByLabel(java.lang.String versionLabel,
                           boolean removeExisting)
                    throws javax.jcr.version.VersionException,
                           javax.jcr.ItemExistsException,
                           javax.jcr.UnsupportedRepositoryOperationException,
                           javax.jcr.lock.LockException,
                           javax.jcr.InvalidItemStateException,
                           javax.jcr.RepositoryException
Specified by:
restoreByLabel in interface javax.jcr.Node
Throws:
javax.jcr.version.VersionException
javax.jcr.ItemExistsException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.lock.LockException
javax.jcr.InvalidItemStateException
javax.jcr.RepositoryException

merge

public javax.jcr.NodeIterator merge(java.lang.String srcWorkspace,
                                    boolean bestEffort)
                             throws javax.jcr.NoSuchWorkspaceException,
                                    javax.jcr.AccessDeniedException,
                                    javax.jcr.MergeException,
                                    javax.jcr.lock.LockException,
                                    javax.jcr.InvalidItemStateException,
                                    javax.jcr.RepositoryException
Specified by:
merge in interface javax.jcr.Node
Throws:
javax.jcr.NoSuchWorkspaceException
javax.jcr.AccessDeniedException
javax.jcr.MergeException
javax.jcr.lock.LockException
javax.jcr.InvalidItemStateException
javax.jcr.RepositoryException