org.apache.jackrabbit.core
Class NodeImpl

java.lang.Object
  extended byorg.apache.jackrabbit.core.ItemImpl
      extended byorg.apache.jackrabbit.core.NodeImpl
All Implemented Interfaces:
Item, ItemStateListener, Node
Direct Known Subclasses:
AbstractVersion, AbstractVersionHistory

public class NodeImpl
extends ItemImpl
implements Node

NodeImpl implements the Node interface.


Field Summary
protected static short CREATED
           
protected  NodeDefinition definition
          the definition of this node
protected  QName primaryTypeName
          same as ((NodeState) state).getNodeTypeName(); cached to avoid type casts
 
Fields inherited from class org.apache.jackrabbit.core.ItemImpl
id, itemMgr, listeners, rep, session, state, stateMgr, status, STATUS_DESTROYED, STATUS_INVALIDATED, STATUS_MODIFIED, STATUS_NORMAL
 
Constructor Summary
protected NodeImpl(ItemManager itemMgr, SessionImpl session, NodeId id, NodeState state, NodeDefinition definition, ItemLifeCycleListener[] listeners)
          Protected constructor.
 
Method Summary
 void accept(ItemVisitor visitor)
          
 void addMixin(QName mixinName)
          Same as Node.addMixin(String) except that it takes a QName instead of a String.
 void addMixin(String mixinName)
          
 NodeImpl addNode(QName nodeName, QName nodeTypeName, UUID uuid)
          Same as Node.addNode(String, String) except that this method takes QName arguments instead of Strings and has an additional uuid argument.
 Node addNode(String relPath)
          
 Node addNode(String relPath, String nodeTypeName)
          
 boolean canAddMixin(String mixinName)
          
 void cancelMerge(Version version)
           
 Version checkin()
          
protected  void checkLock()
          Check whether this node is locked by somebody else.
 void checkout()
          
protected  void checkSetProperty()
          Checks various pre-conditions that are common to all setProperty() methods.
protected  InternalValue[] computeSystemGeneratedPropertyValues(QName name, PropertyDefinitionImpl def)
          Computes the values of well-known system (i.e.
protected  NodeImpl createChildNode(QName name, NodeDefinitionImpl def, NodeTypeImpl nodeType, NodeId id)
           
protected  PropertyImpl createChildProperty(QName name, int type, PropertyDefinitionImpl def)
           
 void doneMerge(Version version)
          
protected  NodeDefinitionImpl getApplicableChildNodeDefinition(QName nodeName, QName nodeTypeName)
          Returns the applicable child node definition for a child node with the specified name and node type.
protected  PropertyDefinitionImpl getApplicablePropertyDefinition(QName propertyName, int type, boolean multiValued, boolean exactTypeMatch)
          Returns the applicable property definition for a property with the specified name and type.
 Version getBaseVersion()
          
 String getCorrespondingNodePath(String workspaceName)
          
 NodeDefinition getDefinition()
          
 EffectiveNodeType getEffectiveNodeType()
          Returns the effective (i.e.
 int getIndex()
          
 Lock getLock()
          
 NodeType[] getMixinNodeTypes()
          
 Set getMixinTypeNames()
          Returns the QNames of this node's mixin types.
 String getName()
          
 NodeImpl getNode(QName name)
          Returns the child node of this node with the specified name.
 NodeImpl getNode(QName name, int index)
          Returns the child node of this node with the specified name.
 Node getNode(String relPath)
          
 NodeId getNodeId()
          Returns the identifier of this Node.
 NodeIterator getNodes()
          
 NodeIterator getNodes(String namePattern)
          
protected  PropertyImpl getOrCreateProperty(QName name, int type, boolean multiValued, boolean exactTypeMatch, BitSet status)
           
protected  PropertyImpl getOrCreateProperty(String name, int type, boolean multiValued, boolean exactTypeMatch, BitSet status)
           
protected  ItemState getOrCreateTransientItemState()
           
 Node getParent()
          
 Item getPrimaryItem()
          
 NodeType getPrimaryNodeType()
          
 PropertyIterator getProperties()
          
 PropertyIterator getProperties(String namePattern)
          
 PropertyImpl getProperty(QName name)
          Returns the property of this node with the specified name.
 Property getProperty(String relPath)
          
 QName getQName()
          Same as Item.getName() except that this method returns a QName instead of a String.
 PropertyIterator getReferences()
          
 String getUUID()
          
 VersionHistory getVersionHistory()
          
 boolean hasNode(QName name)
          Indicates whether a child node with the specified name exists.
 boolean hasNode(QName name, int index)
          Indicates whether a child node with the specified name exists.
 boolean hasNode(String relPath)
          
 boolean hasNodes()
          
protected  boolean hasPendingChanges()
          Determines if there are pending unsaved changes either on this node or on any node or property in the subtree below it.
 boolean hasProperties()
          
 boolean hasProperty(QName name)
          Indicates whether a property with the specified name exists.
 boolean hasProperty(String relPath)
          
 boolean holdsLock()
          
protected  NodeImpl internalAddChildNode(QName nodeName, NodeTypeImpl nodeType)
           
protected  NodeImpl internalAddChildNode(QName nodeName, NodeTypeImpl nodeType, NodeId id)
           
protected  NodeImpl internalAddNode(String relPath, NodeTypeImpl nodeType)
           
protected  NodeImpl internalAddNode(String relPath, NodeTypeImpl nodeType, NodeId id)
           
protected  void internalCopyPropertyFrom(PropertyImpl prop)
          Copies a property to this node
 UUID internalGetUUID()
          Returns the (internal) uuid of this node.
protected  boolean internalIsCheckedOut()
          Determines the checked-out status of this node.
protected  Version[] internalRestore(AbstractVersion version, VersionSelector vsel, boolean removeExisting)
          Internal method to restore a version.
protected  Property internalSetProperty(QName name, InternalValue value)
          Sets the internal value of a property without checking any constraints.
protected  Property internalSetProperty(QName name, InternalValue[] values)
          Sets the internal value of a property without checking any constraints.
protected  Property internalSetProperty(QName name, InternalValue[] values, int type)
          Sets the internal value of a property without checking any constraints.
 boolean isCheckedOut()
          
 boolean isLocked()
          
 boolean isNode()
          
 boolean isNodeType(QName ntName)
          Same as Node.isNodeType(String) except that it takes a QName instead of a String.
 boolean isNodeType(String nodeTypeName)
          
 Lock lock(boolean isDeep, boolean isSessionScoped)
          
protected  void makePersistent()
           
 NodeIterator merge(String srcWorkspace, boolean bestEffort)
          
protected  void onRedefine(NodeDefId defId)
           
protected  void onRemove()
           
 void orderBefore(String srcName, String destName)
          
protected  void removeChildNode(QName nodeName, int index)
           
protected  void removeChildProperty(QName propName)
           
protected  void removeChildProperty(String propName)
           
 void removeMixin(QName mixinName)
          Same as Node.removeMixin(String) except that it takes a QName instead of a String.
 void removeMixin(String mixinName)
          
protected  void renameChildNode(QName oldName, int index, NodeId id, QName newName)
           
protected  NodeId resolveRelativeNodePath(String relPath)
          Returns the id of the node at relPath or null if no node exists at relPath.
protected  PropertyId resolveRelativePropertyPath(String relPath)
          Returns the id of the property at relPath or null if no property exists at relPath.
 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)
          
protected  void restoreTransient(NodeState transientState)
           
 PropertyImpl setProperty(QName name, Value value)
          Same as Node.setProperty(String, Value) except that this method takes a QName name argument instead of a String.
 PropertyImpl setProperty(QName name, Value[] values)
          Same as Node.setProperty(String, Value[]) except that this method takes a QName name argument instead of a String.
 PropertyImpl setProperty(QName name, Value[] values, int type)
          Same as Node.setProperty(String, Value[], int) except that this method takes a QName name argument instead of a String.
 Property setProperty(String name, boolean value)
          
 Property setProperty(String name, Calendar value)
          
 Property setProperty(String name, double value)
          
 Property setProperty(String name, InputStream value)
          
 Property setProperty(String name, long value)
          
 Property setProperty(String name, Node value)
          
 Property setProperty(String name, String value)
          
 Property setProperty(String name, String[] values)
          
 Property setProperty(String name, String[] values, int type)
          
 Property setProperty(String name, String value, int type)
          
 Property setProperty(String name, Value value)
          
 Property setProperty(String name, Value[] values)
          
 Property setProperty(String name, Value[] values, int type)
          
 Property setProperty(String name, Value value, int type)
          
 void unlock()
          
 void update(String srcWorkspaceName)
          
 
Methods inherited from class org.apache.jackrabbit.core.ItemImpl
getAncestor, getDepth, getId, getPath, getPrimaryPath, getSession, internalRemove, isModified, isNew, isSame, isTransactionalNew, isTransient, notifyDestroyed, notifyInvalidated, refresh, remove, safeGetJCRPath, sanityCheck, save, setRemoved, stateCreated, stateDestroyed, stateDiscarded, stateModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jcr.Item
getAncestor, getDepth, getPath, getSession, isModified, isNew, isSame, refresh, remove, save
 

Field Detail

primaryTypeName

protected final QName primaryTypeName
same as ((NodeState) state).getNodeTypeName(); cached to avoid type casts


definition

protected NodeDefinition definition
the definition of this node


CREATED

protected static final short CREATED
See Also:
Constant Field Values
Constructor Detail

NodeImpl

protected NodeImpl(ItemManager itemMgr,
                   SessionImpl session,
                   NodeId id,
                   NodeState state,
                   NodeDefinition definition,
                   ItemLifeCycleListener[] listeners)
Protected constructor.

Parameters:
itemMgr - the ItemManager that created this Node instance
session - the Session through which this Node is acquired
id - id of this Node
state - state associated with this Node
definition - definition of this Node
listeners - listeners on life cylce changes of this NodeImpl
Method Detail

resolveRelativePropertyPath

protected PropertyId resolveRelativePropertyPath(String relPath)
                                          throws RepositoryException
Returns the id of the property at relPath or null if no property exists at relPath.

Note that access rights are not checked.

Parameters:
relPath - relative path of a (possible) property
Returns:
the id of the property at relPath or null if no property exists at relPath
Throws:
RepositoryException - if relPath is not a valid relative path

resolveRelativeNodePath

protected NodeId resolveRelativeNodePath(String relPath)
                                  throws RepositoryException
Returns the id of the node at relPath or null if no node exists at relPath.

Note that access rights are not checked.

Parameters:
relPath - relative path of a (possible) node
Returns:
the id of the node at relPath or null if no node exists at relPath
Throws:
RepositoryException - if relPath is not a valid relative path

hasPendingChanges

protected boolean hasPendingChanges()
                             throws RepositoryException
Determines if there are pending unsaved changes either on this node or on any node or property in the subtree below it.

Returns:
true if there are pending unsaved changes, false otherwise.
Throws:
RepositoryException - if an error occured

getOrCreateTransientItemState

protected ItemState getOrCreateTransientItemState()
                                           throws RepositoryException
Specified by:
getOrCreateTransientItemState in class ItemImpl
Throws:
RepositoryException

computeSystemGeneratedPropertyValues

protected InternalValue[] computeSystemGeneratedPropertyValues(QName name,
                                                               PropertyDefinitionImpl def)
                                                        throws RepositoryException
Computes the values of well-known system (i.e. protected) properties. todo: duplicate code in BatchedItemOperations: consolidate and delegate to NodeTypeInstanceHandler

Parameters:
name -
def -
Returns:
Throws:
RepositoryException

getOrCreateProperty

protected PropertyImpl getOrCreateProperty(String name,
                                           int type,
                                           boolean multiValued,
                                           boolean exactTypeMatch,
                                           BitSet status)
                                    throws ConstraintViolationException,
                                           RepositoryException
Parameters:
name -
type -
multiValued -
exactTypeMatch -
status -
Returns:
Throws:
ConstraintViolationException - if no applicable property definition could be found
RepositoryException - if another error occurs

getOrCreateProperty

protected PropertyImpl getOrCreateProperty(QName name,
                                           int type,
                                           boolean multiValued,
                                           boolean exactTypeMatch,
                                           BitSet status)
                                    throws ConstraintViolationException,
                                           RepositoryException
Parameters:
name -
type -
multiValued -
exactTypeMatch -
status -
Returns:
Throws:
ConstraintViolationException - if no applicable property definition could be found
RepositoryException - if another error occurs

createChildProperty

protected PropertyImpl createChildProperty(QName name,
                                           int type,
                                           PropertyDefinitionImpl def)
                                    throws RepositoryException
Throws:
RepositoryException

createChildNode

protected NodeImpl createChildNode(QName name,
                                   NodeDefinitionImpl def,
                                   NodeTypeImpl nodeType,
                                   NodeId id)
                            throws RepositoryException
Throws:
RepositoryException

renameChildNode

protected void renameChildNode(QName oldName,
                               int index,
                               NodeId id,
                               QName newName)
                        throws RepositoryException
Throws:
RepositoryException

removeChildProperty

protected void removeChildProperty(String propName)
                            throws RepositoryException
Throws:
RepositoryException

removeChildProperty

protected void removeChildProperty(QName propName)
                            throws RepositoryException
Throws:
RepositoryException

removeChildNode

protected void removeChildNode(QName nodeName,
                               int index)
                        throws RepositoryException
Throws:
RepositoryException

onRedefine

protected void onRedefine(NodeDefId defId)
                   throws RepositoryException
Throws:
RepositoryException

onRemove

protected void onRemove()
                 throws RepositoryException
Throws:
RepositoryException

internalAddNode

protected NodeImpl internalAddNode(String relPath,
                                   NodeTypeImpl nodeType)
                            throws ItemExistsException,
                                   PathNotFoundException,
                                   VersionException,
                                   ConstraintViolationException,
                                   LockException,
                                   RepositoryException
Throws:
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
RepositoryException

internalAddNode

protected NodeImpl internalAddNode(String relPath,
                                   NodeTypeImpl nodeType,
                                   NodeId id)
                            throws ItemExistsException,
                                   PathNotFoundException,
                                   VersionException,
                                   ConstraintViolationException,
                                   LockException,
                                   RepositoryException
Throws:
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
RepositoryException

internalAddChildNode

protected NodeImpl internalAddChildNode(QName nodeName,
                                        NodeTypeImpl nodeType)
                                 throws ItemExistsException,
                                        ConstraintViolationException,
                                        RepositoryException
Throws:
ItemExistsException
ConstraintViolationException
RepositoryException

internalAddChildNode

protected NodeImpl internalAddChildNode(QName nodeName,
                                        NodeTypeImpl nodeType,
                                        NodeId id)
                                 throws ItemExistsException,
                                        ConstraintViolationException,
                                        RepositoryException
Throws:
ItemExistsException
ConstraintViolationException
RepositoryException

getMixinTypeNames

public Set getMixinTypeNames()
Returns the QNames of this node's mixin types.

Returns:
a set of the QNames of this node's mixin types.

getEffectiveNodeType

public EffectiveNodeType getEffectiveNodeType()
                                       throws RepositoryException
Returns the effective (i.e. merged and resolved) node type representation of this node's primary and mixin node types.

Returns:
the effective node type
Throws:
RepositoryException - if an error occurs

getApplicableChildNodeDefinition

protected NodeDefinitionImpl getApplicableChildNodeDefinition(QName nodeName,
                                                              QName nodeTypeName)
                                                       throws ConstraintViolationException,
                                                              RepositoryException
Returns the applicable child node definition for a child node with the specified name and node type.

Parameters:
nodeName -
nodeTypeName -
Returns:
Throws:
ConstraintViolationException - if no applicable child node definition could be found
RepositoryException - if another error occurs

getApplicablePropertyDefinition

protected PropertyDefinitionImpl getApplicablePropertyDefinition(QName propertyName,
                                                                 int type,
                                                                 boolean multiValued,
                                                                 boolean exactTypeMatch)
                                                          throws ConstraintViolationException,
                                                                 RepositoryException
Returns the applicable property definition for a property with the specified name and type.

Parameters:
propertyName -
type -
multiValued -
exactTypeMatch -
Returns:
Throws:
ConstraintViolationException - if no applicable property definition could be found
RepositoryException - if another error occurs

makePersistent

protected void makePersistent()
                       throws InvalidItemStateException
Specified by:
makePersistent in class ItemImpl
Throws:
InvalidItemStateException

restoreTransient

protected void restoreTransient(NodeState transientState)
                         throws RepositoryException
Throws:
RepositoryException

addMixin

public void addMixin(QName mixinName)
              throws NoSuchNodeTypeException,
                     VersionException,
                     ConstraintViolationException,
                     LockException,
                     RepositoryException
Same as Node.addMixin(String) except that it takes a QName instead of a String.

Throws:
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException
See Also:
Node.addMixin(String)

removeMixin

public void removeMixin(QName mixinName)
                 throws NoSuchNodeTypeException,
                        VersionException,
                        ConstraintViolationException,
                        LockException,
                        RepositoryException
Same as Node.removeMixin(String) except that it takes a QName instead of a String.

Throws:
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException
See Also:
Node.removeMixin(String)

isNodeType

public boolean isNodeType(QName ntName)
                   throws RepositoryException
Same as Node.isNodeType(String) except that it takes a QName instead of a String.

Parameters:
ntName - name of node type
Returns:
true if this node is of the specified node type; otherwise false
Throws:
RepositoryException

internalGetUUID

public UUID internalGetUUID()
Returns the (internal) uuid of this node.

Returns:
the uuid of this node

checkSetProperty

protected void checkSetProperty()
                         throws VersionException,
                                LockException,
                                RepositoryException
Checks various pre-conditions that are common to all setProperty() methods. The checks performed are: Note that certain checks are performed by the respective Property.setValue() methods.

Throws:
VersionException - if this node is not checked-out
LockException - if this node is locked by somebody else
RepositoryException - if another error occurs
See Also:
Node.setProperty(java.lang.String, javax.jcr.Value)

internalSetProperty

protected Property internalSetProperty(QName name,
                                       InternalValue value)
                                throws ValueFormatException,
                                       RepositoryException
Sets the internal value of a property without checking any constraints.

Note that no type conversion is being performed, i.e. it's the caller's responsibility to make sure that the type of the given value is compatible with the specified property's definition.

Parameters:
name -
value -
Returns:
Throws:
ValueFormatException
RepositoryException

internalSetProperty

protected Property internalSetProperty(QName name,
                                       InternalValue[] values)
                                throws ValueFormatException,
                                       RepositoryException
Sets the internal value of a property without checking any constraints.

Note that no type conversion is being performed, i.e. it's the caller's responsibility to make sure that the type of the given values is compatible with the specified property's definition.

Parameters:
name -
values -
Returns:
Throws:
ValueFormatException
RepositoryException

internalSetProperty

protected Property internalSetProperty(QName name,
                                       InternalValue[] values,
                                       int type)
                                throws ValueFormatException,
                                       RepositoryException
Sets the internal value of a property without checking any constraints.

Note that no type conversion is being performed, i.e. it's the caller's responsibility to make sure that the type of the given values is compatible with the specified property's definition.

Parameters:
name -
values -
type -
Returns:
Throws:
ValueFormatException
RepositoryException

getNode

public NodeImpl getNode(QName name)
                 throws ItemNotFoundException,
                        RepositoryException
Returns the child node of this node with the specified name.

Parameters:
name - The qualified name of the child node to retrieve.
Returns:
The child node with the specified name.
Throws:
ItemNotFoundException - If no child node exists with the specified name.
RepositoryException - If another error occurs.

getNode

public NodeImpl getNode(QName name,
                        int index)
                 throws ItemNotFoundException,
                        RepositoryException
Returns the child node of this node with the specified name.

Parameters:
name - The qualified name of the child node to retrieve.
index - The index of the child node to retrieve (in the case of same-name siblings).
Returns:
The child node with the specified name.
Throws:
ItemNotFoundException - If no child node exists with the specified name.
RepositoryException - If another error occurs.

hasNode

public boolean hasNode(QName name)
                throws RepositoryException
Indicates whether a child node with the specified name exists. Returns true if the child node exists and false otherwise.

Parameters:
name - The qualified name of the child node.
Returns:
true if the child node exists; false otherwise.
Throws:
RepositoryException - If an unspecified error occurs.

hasNode

public boolean hasNode(QName name,
                       int index)
                throws RepositoryException
Indicates whether a child node with the specified name exists. Returns true if the child node exists and false otherwise.

Parameters:
name - The qualified name of the child node.
index - The index of the child node (in the case of same-name siblings).
Returns:
true if the child node exists; false otherwise.
Throws:
RepositoryException - If an unspecified error occurs.

getProperty

public PropertyImpl getProperty(QName name)
                         throws ItemNotFoundException,
                                RepositoryException
Returns the property of this node with the specified name.

Parameters:
name - The qualified name of the property to retrieve.
Returns:
The property with the specified name.
Throws:
ItemNotFoundException - If no property exists with the specified name.
RepositoryException - If another error occurs.

hasProperty

public boolean hasProperty(QName name)
                    throws RepositoryException
Indicates whether a property with the specified name exists. Returns true if the property exists and false otherwise.

Parameters:
name - The qualified name of the property.
Returns:
true if the property exists; false otherwise.
Throws:
RepositoryException - If an unspecified error occurs.

addNode

public NodeImpl addNode(QName nodeName,
                        QName nodeTypeName,
                        UUID uuid)
                 throws ItemExistsException,
                        NoSuchNodeTypeException,
                        VersionException,
                        ConstraintViolationException,
                        LockException,
                        RepositoryException
Same as Node.addNode(String, String) except that this method takes QName arguments instead of Strings and has an additional uuid argument.

Important Notice: This method is for internal use only! Passing already assigned uuid's might lead to unexpected results and data corruption in the worst case.

Parameters:
nodeName - name of the new node
nodeTypeName - name of the new node's node type or null if it should be determined automatically
uuid - uuid of the new node or null if a new uuid should be assigned
Returns:
the newly added node
Throws:
ItemExistsException
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException

setProperty

public PropertyImpl setProperty(QName name,
                                Value[] values)
                         throws ValueFormatException,
                                VersionException,
                                LockException,
                                ConstraintViolationException,
                                RepositoryException
Same as Node.setProperty(String, Value[]) except that this method takes a QName name argument instead of a String.

Parameters:
name -
values -
Returns:
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public PropertyImpl setProperty(QName name,
                                Value[] values,
                                int type)
                         throws ValueFormatException,
                                VersionException,
                                LockException,
                                ConstraintViolationException,
                                RepositoryException
Same as Node.setProperty(String, Value[], int) except that this method takes a QName name argument instead of a String.

Parameters:
name -
values -
type -
Returns:
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public PropertyImpl setProperty(QName name,
                                Value value)
                         throws ValueFormatException,
                                VersionException,
                                LockException,
                                ConstraintViolationException,
                                RepositoryException
Same as Node.setProperty(String, Value) except that this method takes a QName name argument instead of a String.

Parameters:
name -
value -
Returns:
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

getQName

public QName getQName()
               throws RepositoryException
Description copied from class: ItemImpl
Same as Item.getName() except that this method returns a QName instead of a String.

Specified by:
getQName in class ItemImpl
Returns:
the name of this item as QName
Throws:
RepositoryException - if an error occurs.
See Also:
ItemImpl.getQName()

getNodeId

public NodeId getNodeId()
Returns the identifier of this Node.

Returns:
the id of this Node

isNode

public boolean isNode()

Specified by:
isNode in interface Item
Specified by:
isNode in class ItemImpl

getName

public String getName()
               throws RepositoryException

Specified by:
getName in interface Item
Specified by:
getName in class ItemImpl
Throws:
RepositoryException

accept

public void accept(ItemVisitor visitor)
            throws RepositoryException

Specified by:
accept in interface Item
Specified by:
accept in class ItemImpl
Throws:
RepositoryException

getParent

public Node getParent()
               throws ItemNotFoundException,
                      AccessDeniedException,
                      RepositoryException

Specified by:
getParent in interface Item
Specified by:
getParent in class ItemImpl
Throws:
ItemNotFoundException
AccessDeniedException
RepositoryException

addNode

public Node addNode(String relPath)
             throws ItemExistsException,
                    PathNotFoundException,
                    VersionException,
                    ConstraintViolationException,
                    LockException,
                    RepositoryException

Specified by:
addNode in interface Node
Throws:
ItemExistsException
PathNotFoundException
VersionException
ConstraintViolationException
LockException
RepositoryException

addNode

public Node addNode(String relPath,
                    String nodeTypeName)
             throws ItemExistsException,
                    PathNotFoundException,
                    NoSuchNodeTypeException,
                    VersionException,
                    ConstraintViolationException,
                    LockException,
                    RepositoryException

Specified by:
addNode in interface Node
Throws:
ItemExistsException
PathNotFoundException
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException

orderBefore

public void orderBefore(String srcName,
                        String destName)
                 throws UnsupportedRepositoryOperationException,
                        VersionException,
                        ConstraintViolationException,
                        ItemNotFoundException,
                        LockException,
                        RepositoryException

Specified by:
orderBefore in interface Node
Throws:
UnsupportedRepositoryOperationException
VersionException
ConstraintViolationException
ItemNotFoundException
LockException
RepositoryException

setProperty

public Property setProperty(String name,
                            Value[] values)
                     throws ValueFormatException,
                            VersionException,
                            LockException,
                            ConstraintViolationException,
                            RepositoryException

Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public Property setProperty(String name,
                            Value[] values,
                            int type)
                     throws ValueFormatException,
                            VersionException,
                            LockException,
                            ConstraintViolationException,
                            RepositoryException

Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public Property setProperty(String name,
                            String[] values)
                     throws ValueFormatException,
                            VersionException,
                            LockException,
                            ConstraintViolationException,
                            RepositoryException

Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public Property setProperty(String name,
                            String[] values,
                            int type)
                     throws ValueFormatException,
                            VersionException,
                            LockException,
                            ConstraintViolationException,
                            RepositoryException

Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public Property setProperty(String name,
                            String value)
                     throws ValueFormatException,
                            VersionException,
                            LockException,
                            ConstraintViolationException,
                            RepositoryException

Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public Property setProperty(String name,
                            String value,
                            int type)
                     throws ValueFormatException,
                            VersionException,
                            LockException,
                            ConstraintViolationException,
                            RepositoryException

Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public Property setProperty(String name,
                            Value value,
                            int type)
                     throws ValueFormatException,
                            VersionException,
                            LockException,
                            ConstraintViolationException,
                            RepositoryException

Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public Property setProperty(String name,
                            Value value)
                     throws ValueFormatException,
                            VersionException,
                            LockException,
                            ConstraintViolationException,
                            RepositoryException

Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public Property setProperty(String name,
                            InputStream value)
                     throws ValueFormatException,
                            VersionException,
                            LockException,
                            ConstraintViolationException,
                            RepositoryException

Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public Property setProperty(String name,
                            boolean value)
                     throws ValueFormatException,
                            VersionException,
                            LockException,
                            ConstraintViolationException,
                            RepositoryException

Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public Property setProperty(String name,
                            double value)
                     throws ValueFormatException,
                            VersionException,
                            LockException,
                            ConstraintViolationException,
                            RepositoryException

Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public Property setProperty(String name,
                            long value)
                     throws ValueFormatException,
                            VersionException,
                            LockException,
                            ConstraintViolationException,
                            RepositoryException

Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public Property setProperty(String name,
                            Calendar value)
                     throws ValueFormatException,
                            VersionException,
                            LockException,
                            ConstraintViolationException,
                            RepositoryException

Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setProperty

public Property setProperty(String name,
                            Node value)
                     throws ValueFormatException,
                            VersionException,
                            LockException,
                            ConstraintViolationException,
                            RepositoryException

Specified by:
setProperty in interface Node
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

getNode

public Node getNode(String relPath)
             throws PathNotFoundException,
                    RepositoryException

Specified by:
getNode in interface Node
Throws:
PathNotFoundException
RepositoryException

getNodes

public NodeIterator getNodes()
                      throws RepositoryException

Specified by:
getNodes in interface Node
Throws:
RepositoryException

getProperties

public PropertyIterator getProperties()
                               throws RepositoryException

Specified by:
getProperties in interface Node
Throws:
RepositoryException

getProperty

public Property getProperty(String relPath)
                     throws PathNotFoundException,
                            RepositoryException

Specified by:
getProperty in interface Node
Throws:
PathNotFoundException
RepositoryException

hasNode

public boolean hasNode(String relPath)
                throws RepositoryException

Specified by:
hasNode in interface Node
Throws:
RepositoryException

hasNodes

public boolean hasNodes()
                 throws RepositoryException

Specified by:
hasNodes in interface Node
Throws:
RepositoryException

hasProperties

public boolean hasProperties()
                      throws RepositoryException

Specified by:
hasProperties in interface Node
Throws:
RepositoryException

isNodeType

public boolean isNodeType(String nodeTypeName)
                   throws RepositoryException

Specified by:
isNodeType in interface Node
Throws:
RepositoryException

getPrimaryNodeType

public NodeType getPrimaryNodeType()
                            throws RepositoryException

Specified by:
getPrimaryNodeType in interface Node
Throws:
RepositoryException

getMixinNodeTypes

public NodeType[] getMixinNodeTypes()
                             throws RepositoryException

Specified by:
getMixinNodeTypes in interface Node
Throws:
RepositoryException

addMixin

public void addMixin(String mixinName)
              throws NoSuchNodeTypeException,
                     VersionException,
                     ConstraintViolationException,
                     LockException,
                     RepositoryException

Specified by:
addMixin in interface Node
Throws:
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException

removeMixin

public void removeMixin(String mixinName)
                 throws NoSuchNodeTypeException,
                        VersionException,
                        ConstraintViolationException,
                        LockException,
                        RepositoryException

Specified by:
removeMixin in interface Node
Throws:
NoSuchNodeTypeException
VersionException
ConstraintViolationException
LockException
RepositoryException

canAddMixin

public boolean canAddMixin(String mixinName)
                    throws NoSuchNodeTypeException,
                           RepositoryException

Specified by:
canAddMixin in interface Node
Throws:
NoSuchNodeTypeException
RepositoryException

hasProperty

public boolean hasProperty(String relPath)
                    throws RepositoryException

Specified by:
hasProperty in interface Node
Throws:
RepositoryException

getReferences

public PropertyIterator getReferences()
                               throws RepositoryException

Specified by:
getReferences in interface Node
Throws:
RepositoryException

getDefinition

public NodeDefinition getDefinition()
                             throws RepositoryException

Specified by:
getDefinition in interface Node
Throws:
RepositoryException

getNodes

public NodeIterator getNodes(String namePattern)
                      throws RepositoryException

Specified by:
getNodes in interface Node
Throws:
RepositoryException

getProperties

public PropertyIterator getProperties(String namePattern)
                               throws RepositoryException

Specified by:
getProperties in interface Node
Throws:
RepositoryException

getPrimaryItem

public Item getPrimaryItem()
                    throws ItemNotFoundException,
                           RepositoryException

Specified by:
getPrimaryItem in interface Node
Throws:
ItemNotFoundException
RepositoryException

getUUID

public String getUUID()
               throws UnsupportedRepositoryOperationException,
                      RepositoryException

Specified by:
getUUID in interface Node
Throws:
UnsupportedRepositoryOperationException
RepositoryException

getCorrespondingNodePath

public String getCorrespondingNodePath(String workspaceName)
                                throws ItemNotFoundException,
                                       NoSuchWorkspaceException,
                                       AccessDeniedException,
                                       RepositoryException

Specified by:
getCorrespondingNodePath in interface Node
Throws:
ItemNotFoundException
NoSuchWorkspaceException
AccessDeniedException
RepositoryException

getIndex

public int getIndex()
             throws RepositoryException

Specified by:
getIndex in interface Node
Throws:
RepositoryException

checkin

public Version checkin()
                throws VersionException,
                       UnsupportedRepositoryOperationException,
                       InvalidItemStateException,
                       LockException,
                       RepositoryException

Specified by:
checkin in interface Node
Throws:
VersionException
UnsupportedRepositoryOperationException
InvalidItemStateException
LockException
RepositoryException

checkout

public void checkout()
              throws UnsupportedRepositoryOperationException,
                     LockException,
                     RepositoryException

Specified by:
checkout in interface Node
Throws:
UnsupportedRepositoryOperationException
LockException
RepositoryException

update

public void update(String srcWorkspaceName)
            throws NoSuchWorkspaceException,
                   AccessDeniedException,
                   LockException,
                   InvalidItemStateException,
                   RepositoryException

Specified by:
update in interface Node
Throws:
NoSuchWorkspaceException
AccessDeniedException
LockException
InvalidItemStateException
RepositoryException

merge

public NodeIterator merge(String srcWorkspace,
                          boolean bestEffort)
                   throws NoSuchWorkspaceException,
                          AccessDeniedException,
                          VersionException,
                          LockException,
                          InvalidItemStateException,
                          RepositoryException

Specified by:
merge in interface Node
Throws:
NoSuchWorkspaceException
AccessDeniedException
VersionException
LockException
InvalidItemStateException
RepositoryException

cancelMerge

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

doneMerge

public void doneMerge(Version version)
               throws VersionException,
                      InvalidItemStateException,
                      UnsupportedRepositoryOperationException,
                      RepositoryException

Specified by:
doneMerge in interface Node
Throws:
VersionException
InvalidItemStateException
UnsupportedRepositoryOperationException
RepositoryException

isCheckedOut

public boolean isCheckedOut()
                     throws RepositoryException

Specified by:
isCheckedOut in interface Node
Throws:
RepositoryException

restore

public void restore(String versionName,
                    boolean removeExisting)
             throws VersionException,
                    ItemExistsException,
                    UnsupportedRepositoryOperationException,
                    LockException,
                    InvalidItemStateException,
                    RepositoryException

Specified by:
restore in interface Node
Throws:
VersionException
ItemExistsException
UnsupportedRepositoryOperationException
LockException
InvalidItemStateException
RepositoryException

restore

public void restore(Version version,
                    boolean removeExisting)
             throws VersionException,
                    ItemExistsException,
                    UnsupportedRepositoryOperationException,
                    LockException,
                    RepositoryException

Specified by:
restore in interface Node
Throws:
VersionException
ItemExistsException
UnsupportedRepositoryOperationException
LockException
RepositoryException

restore

public void restore(Version version,
                    String relPath,
                    boolean removeExisting)
             throws PathNotFoundException,
                    ItemExistsException,
                    VersionException,
                    ConstraintViolationException,
                    UnsupportedRepositoryOperationException,
                    LockException,
                    InvalidItemStateException,
                    RepositoryException

Specified by:
restore in interface Node
Throws:
PathNotFoundException
ItemExistsException
VersionException
ConstraintViolationException
UnsupportedRepositoryOperationException
LockException
InvalidItemStateException
RepositoryException

restoreByLabel

public void restoreByLabel(String versionLabel,
                           boolean removeExisting)
                    throws VersionException,
                           ItemExistsException,
                           UnsupportedRepositoryOperationException,
                           LockException,
                           InvalidItemStateException,
                           RepositoryException

Specified by:
restoreByLabel in interface Node
Throws:
VersionException
ItemExistsException
UnsupportedRepositoryOperationException
LockException
InvalidItemStateException
RepositoryException

getVersionHistory

public VersionHistory getVersionHistory()
                                 throws UnsupportedRepositoryOperationException,
                                        RepositoryException

Specified by:
getVersionHistory in interface Node
Throws:
UnsupportedRepositoryOperationException
RepositoryException

getBaseVersion

public Version getBaseVersion()
                       throws UnsupportedRepositoryOperationException,
                              RepositoryException

Specified by:
getBaseVersion in interface Node
Throws:
UnsupportedRepositoryOperationException
RepositoryException

internalIsCheckedOut

protected boolean internalIsCheckedOut()
                                throws RepositoryException
Determines the checked-out status of this node.

A node is considered checked-out if it is versionable and checked-out, or is non-versionable but its nearest versionable ancestor is checked-out, or is non-versionable and there are no versionable ancestors.

Returns:
a boolean
Throws:
RepositoryException
See Also:
Node.isCheckedOut()

internalRestore

protected Version[] internalRestore(AbstractVersion version,
                                    VersionSelector vsel,
                                    boolean removeExisting)
                             throws RepositoryException
Internal method to restore a version.

Parameters:
version -
vsel - the version selector that will select the correct version for OPV=Version childnodes.
removeExisting -
Throws:
RepositoryException

internalCopyPropertyFrom

protected void internalCopyPropertyFrom(PropertyImpl prop)
                                 throws RepositoryException
Copies a property to this node

Parameters:
prop -
Throws:
RepositoryException

lock

public Lock lock(boolean isDeep,
                 boolean isSessionScoped)
          throws UnsupportedRepositoryOperationException,
                 LockException,
                 AccessDeniedException,
                 InvalidItemStateException,
                 RepositoryException

Specified by:
lock in interface Node
Throws:
UnsupportedRepositoryOperationException
LockException
AccessDeniedException
InvalidItemStateException
RepositoryException

getLock

public Lock getLock()
             throws UnsupportedRepositoryOperationException,
                    LockException,
                    AccessDeniedException,
                    RepositoryException

Specified by:
getLock in interface Node
Throws:
UnsupportedRepositoryOperationException
LockException
AccessDeniedException
RepositoryException

unlock

public void unlock()
            throws UnsupportedRepositoryOperationException,
                   LockException,
                   AccessDeniedException,
                   InvalidItemStateException,
                   RepositoryException

Specified by:
unlock in interface Node
Throws:
UnsupportedRepositoryOperationException
LockException
AccessDeniedException
InvalidItemStateException
RepositoryException

holdsLock

public boolean holdsLock()
                  throws RepositoryException

Specified by:
holdsLock in interface Node
Throws:
RepositoryException

isLocked

public boolean isLocked()
                 throws RepositoryException

Specified by:
isLocked in interface Node
Throws:
RepositoryException

checkLock

protected void checkLock()
                  throws LockException,
                         RepositoryException
Check whether this node is locked by somebody else.

Throws:
LockException - if this node is locked by somebody else
RepositoryException - if some other error occurs


Copyright © 2004-2006 The Apache Software Foundation. All Rights Reserved.