Skip navigation links

Oracle Beehive Java Content Repository Java API Reference
Release 1 (1.5)

E14840-01


oracle.ocs.jcr
Interface OracleNode

All Superinterfaces:
javax.jcr.Item, javax.jcr.Node

public interface OracleNode
extends javax.jcr.Node

The OracleNode interface represents a node in the hierarchy that makes up the repository. After obtaining the Node, the user can add a child node to it, set property, or get property on it. Node Session.save() or Node.save() needs to be called to make any changes persistent. The following piece of code retrieves a node, adds a child node to it, and adds a property to that child node.

    // Retrieve a node 
    Node myNode = (Node) mySession.getItem("/oracle/PersonalWorkspace/Documents/folder"); 
    // Add a child file node 
    Node ntfile = myNode.addNode("file1", "nt:file"); 
    // Get jcr:content node directly. No need to add it.
    Node jcrcontentNode = nfile.getNode("jcr:content");
    // Add a property jcr:data
    jcrcontentNode.setProperty("jcr:data",new ByteArrayInputStream("test cnt".getBytes()));
   // Persist the changes 
    mySession.save(); 
    


To delete an item, the method Item.remove() is used. For example, continuing from the above code segment, the following code.

 
   // Remove the node /oracle/PersonalWorkspace/Documents/folder (and its subtree) 
   myNode.remove(); 
   // Persist the changes  
   mySession.save();  
   

would result in the node at /oracle/PersonalWorkspace/Documents/folder (and its child node) being deleted


Method Summary
 void addMixin(java.lang.String mixinName)
          Adding mixin node type is not supported.
 javax.jcr.Node addNode(java.lang.String relPath)
          Not Supported.
 javax.jcr.Node addNode(java.lang.String relPath, java.lang.String primaryNodeTypeName)
          Creates a new node at relPath of the specified node type.
 boolean canAddMixin(java.lang.String mixinName)
          Returns false since adding specified mixin node type is not supported
 void cancelMerge(javax.jcr.version.Version version)
          This operation is not supported.
 javax.jcr.version.Version checkin()
          Creates a new version with a system generated version name and returns that version (which will be the new base version of this node).
 void checkout()
          Sets this versionable node to checked-out status by setting its jcr:isCheckedOut property to true and adds to the jcr:predecessors (multi-value) property a reference to the current base version (the same value as held in jcr:baseVersion).
 void doneMerge(javax.jcr.version.Version version)
          This operation is not supported.
 javax.jcr.version.Version getBaseVersion()
          Returns the current base version of this versionable node.
 java.lang.String getCorrespondingNodePath(java.lang.String workspaceName)
          Returns null since we do not support multiple workspaces.
 javax.jcr.nodetype.NodeDefinition getDefinition()
          Returns the node definition that applies to this node.
 int getIndex()
          This method returns the index of this node within the ordered set of its same-name sibling nodes.
 javax.jcr.lock.Lock getLock()
          Returns the Lock object that applies to this node.
 javax.jcr.nodetype.NodeType[] getMixinNodeTypes()
          Returns an array of NodeType objects representing the mixin node types assigned to this node.
 javax.jcr.Node getNode(java.lang.String relPath)
          Returns the node at relPath relative to this node.
 javax.jcr.NodeIterator getNodes()
          Returns a NodeIterator over all child Nodes of this Node.
 javax.jcr.NodeIterator getNodes(java.lang.String namePattern)
          Gets all child nodes of this node that match namePattern.
 javax.jcr.Item getPrimaryItem()
          Returns the primary child item of this node.
 javax.jcr.nodetype.NodeType getPrimaryNodeType()
          Returns the primary node type of this node.
 javax.jcr.PropertyIterator getProperties()
          Returns all properties of this node.
 javax.jcr.PropertyIterator getProperties(java.lang.String namePattern)
          Gets all properties of this node that match namePattern.
 javax.jcr.Property getProperty(java.lang.String relPath)
          Returns the property at relPath relative to this node.
 javax.jcr.PropertyIterator getReferences()
          Returns all REFERENCE properties that refer to this node.
 java.lang.String getUUID()
          Returns the UUID of this node as recorded in this node's jcr:uuid property.
 javax.jcr.version.VersionHistory getVersionHistory()
          Returns the VersionHistory object of this node.
 boolean hasNode(java.lang.String relPath)
          Indicates whether a node exists at relPath Returns true if a node exists at relPath and false otherwise.
 boolean hasNodes()
          Indicates whether this node has child nodes.
 boolean hasProperties()
          Indicates whether this node has properties.
 boolean hasProperty(java.lang.String relPath)
          Indicates whether a property exists at relPath Returns true if a property exists at relPath and false otherwise.
 boolean holdsLock()
          Returns true if this node holds a lock; otherwise returns false.
 boolean isCheckedOut()
          Returns true if this node is either <li/>versionable and currently checked-out, <li/>non-versionable and it has no versionable ancestor.
 boolean isLocked()
          Returns true if this node is locked either as a result of a lock held by this node by the same or different user or by a deep lock on a node above this node by different user; otherwise returns false.
 boolean isNodeType(java.lang.String nodeTypeName)
          Indicates whether this node is of the specified node type.
 javax.jcr.lock.Lock lock(boolean isDeep, boolean isSessionScoped)
          Places a lock on this node.
 javax.jcr.NodeIterator merge(java.lang.String srcWorkspace, boolean bestEffort)
          This operation is not supported.
 void orderBefore(java.lang.String srcChildRelPath, java.lang.String destChildRelPath)
          Child node ordering is not supported.
 void removeMixin(java.lang.String mixinName)
          Removing mixin node type is not supported.
 void restore(java.lang.String versionName, boolean removeExisting)
          Restores this node to the state defined by the version with the specified versionName.
 void restore(javax.jcr.version.Version version, boolean removeExisting)
          Restores this node to the state defined by the specified version.
 void restore(javax.jcr.version.Version version, java.lang.String relPath, boolean removeExisting)
          Restores the specified version to relPath, relative to this node.
 void restoreByLabel(java.lang.String versionLabel, boolean removeExisting)
          Restores the version of this node with the specified version label.
 javax.jcr.Property setProperty(java.lang.String name, boolean value)
          Sets the specified property to the specified value.
 javax.jcr.Property setProperty(java.lang.String name, java.util.Calendar value)
          Sets the specified property to the specified value.
 javax.jcr.Property setProperty(java.lang.String name, double value)
          Sets the specified property to the specified value.
 javax.jcr.Property setProperty(java.lang.String name, java.io.InputStream value)
          Sets the specified property to the specified value.
 javax.jcr.Property setProperty(java.lang.String name, long value)
          Sets the specified property to the specified value.
 javax.jcr.Property setProperty(java.lang.String name, javax.jcr.Node value)
          The operation of setting the specified (REFERENCE)property to refer to the specified Node is not supported.
 javax.jcr.Property setProperty(java.lang.String name, java.lang.String value)
          Sets the specified property to the specified value.
 javax.jcr.Property setProperty(java.lang.String name, java.lang.String[] values)
          Throws RepositoryException since this implementation does not support user-defined multi-valued properties.
 javax.jcr.Property setProperty(java.lang.String name, java.lang.String[] values, int type)
          Throws RepositoryException since there is no multi-value property.
 javax.jcr.Property setProperty(java.lang.String name, java.lang.String value, int type)
          Sets the specified (single-value) property to the specified value.
 javax.jcr.Property setProperty(java.lang.String name, javax.jcr.Value value)
          Sets the specified (single-value) property of this node to the specified value.
 javax.jcr.Property setProperty(java.lang.String name, javax.jcr.Value[] values)
          Throws RepositoryException since this implementation does not support user-defined multi-valued properties.
 javax.jcr.Property setProperty(java.lang.String name, javax.jcr.Value[] values, int type)
          Throws RepositoryException since this implementation does not support user-defined multi-valued properties.
 javax.jcr.Property setProperty(java.lang.String name, javax.jcr.Value value, int type)
          Sets the specified (single-value) property to the specified value.
 void unlock()
          Removes the lock on this node.
 void update(java.lang.String srcWorkspaceName)
          Multiple workspaces is not supported.

 

Methods inherited from interface javax.jcr.Item
accept, getAncestor, getDepth, getName, getParent, getPath, getSession, isModified, isNew, isNode, isSame, refresh, remove, save

 

Method Detail

addNode

javax.jcr.Node addNode(java.lang.String relPath)
                       throws javax.jcr.nodetype.NoSuchNodeTypeException,
                              javax.jcr.lock.LockException,
                              javax.jcr.version.VersionException,
                              javax.jcr.nodetype.ConstraintViolationException,
                              javax.jcr.PathNotFoundException,
                              javax.jcr.RepositoryException
Not Supported. Instead, addNode(String relPath, String primaryNodeTypeName) to be used.
Specified by:
addNode in interface javax.jcr.Node
Throws:
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.nodetype.NoSuchNodeTypeException
javax.jcr.lock.LockException
javax.jcr.version.VersionException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException

addNode

javax.jcr.Node addNode(java.lang.String relPath,
                       java.lang.String primaryNodeTypeName)
                       throws javax.jcr.nodetype.NoSuchNodeTypeException,
                              javax.jcr.lock.LockException,
                              javax.jcr.version.VersionException,
                              javax.jcr.nodetype.ConstraintViolationException,
                              javax.jcr.PathNotFoundException,
                              javax.jcr.RepositoryException
Creates a new node at relPath of the specified node type. This is same as addNode(String relPath) except that the primary node type of the new node is explicitly specified. Note only nodes of type nt:folder and nt:file can only be added. Also, we can add nodes of type nt:folder to nodes of type beehive:workspace and nodes of type nt:folder and nt:file can be added to nodes of type nt:folder. <p/> An ItemExistsException will be thrown on save, if an item at the specified path already exists and same-name siblings are not allowed. <p/> A PathNotFoundException will be thrown immediately if the specified path implies intermediary nodes that do not exist. <p/> A NoSuchNodeTypeException will be thrown either immediately if the specified node type is not recognized. <p/> A ConstraintViolationException will be thrown immediately if adding the node would violate a node type or if an attempt is made to add a node as the child of a property. Implementations may differ on when this validation is performed. <p/> A LockException will be thrown either immediately (by this method), if a lock prevents the addition of the node.
Specified by:
addNode in interface javax.jcr.Node
Parameters:
relPath - the path of the new node to be created.
primaryNodeTypeName - The name of the primary node type of the new node. The nodetype names are defined in OracleNodeType as String constants.
Returns:
the node that was added.
Throws:
javax.jcr.nodetype.NoSuchNodeTypeException - if the specified node type is not recognized and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.nodetype.ConstraintViolationException - if a node type constraint is violated and is thrown immediately instead of waiting until save.
javax.jcr.lock.LockException - if a lock prevents the addition of the node. This implementation performs this validation immediately instead of waiting until save.
javax.jcr.RepositoryException - if another error occurs.
javax.jcr.version.VersionException
javax.jcr.PathNotFoundException

orderBefore

void orderBefore(java.lang.String srcChildRelPath,
                 java.lang.String destChildRelPath)
                 throws javax.jcr.UnsupportedRepositoryOperationException
Child node ordering is not supported. UnsupportedRepositoryOperationException is thrown. <p/>
Specified by:
orderBefore in interface javax.jcr.Node
Throws:
javax.jcr.UnsupportedRepositoryOperationException - since ordering is not supported.

setProperty

javax.jcr.Property 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
Sets the specified (single-value) property of this node to the specified value. If the property does not yet exist, it is created. The property type of the property will be that specified by the node type of this node. <p/> If the property type of the supplied Value object is different from that required, then a best-effort conversion is attempted. If the conversion fails, a ValueFormatException is thrown. If another error occurs, a RepositoryException is thrown. <p/> If the node type of this node does not indicate a specific property type, then the property type of the supplied Value object is used and if the property already exists it assumes both the new value and new property type. <p/> If the property is multi-valued, a ValueFormatException is thrown. <p/> Passing a null as the second parameter removes the property. It is equivalent to calling remove on the Property object itself. For example, N.setProperty("P", (Value)null) would remove property called "P" of the node in N. <p/> To save the addition or removal of a property, a save call must be performed that includes the parent of the property in its scope, that is, a save on either the session, this node, or an ancestor of this node. To save a change to an existing property, a save call that includes that property in its scope is required. This means that in addition to the above-mentioned save options, a save on the changed property itself will also work. <p/> A ConstraintViolationException will be thrown either immediately if the change would violate a node type. <p/> A VersionException will be thrown immediately if this node is versionable and checked-in. <p/> A LockException will be thrown either immediately if a lock prevents the setting of the property.
Specified by:
setProperty in interface javax.jcr.Node
Parameters:
name - The name of a property of this node
value - The value to be assigned
Returns:
The updated Property object
Throws:
javax.jcr.ValueFormatException - if value cannot be converted to the type of the specified property or if the property already exists and is multi-valued.
javax.jcr.version.VersionException - if this node is versionable and checked-in this implementation performs this validation immediately instead of waiting until save.
javax.jcr.lock.LockException - if a lock prevents the setting of the property and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.nodetype.ConstraintViolationException - if the change would violate a node-type or other constraint and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.RepositoryException - if another error occurs.

setProperty

javax.jcr.Property 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
Sets the specified (single-value) property to the specified value. If the property does not yet exist, it is created. <p/> The type of the new property is determined by the type parameter specified. <p/> If the property type of the supplied Value object is different from that required, then a best-effort conversion is attempted. If the conversion fails, a ValueFormatException is thrown. <p/> If the property is not single-valued then a ValueFormatException is also thrown. <p/> If the property already exists it assumes both the new value and the new property type. <p/> Passing a null as the second parameter removes the property. It is equivalent to calling remove on the Property object itself. For example, N.setProperty("P", (Value)null, type) would remove property called "P" of the node in N. <p/> To persist the addition or removal of a property, save must be called on the Session, this Node, or an ancestor of this Node. <p/> To save the addition or removal of a property, a save call must be performed that includes the parent of the property in its scope, that is, a save on either the session, this node, or an ancestor of this node. To save a change to an existing property, a save call that includes that property in its scope is required. This means that in addition to the above-mentioned save options, a save on the changed property itself will also work. <p/> A ConstraintViolationException will be thrown either immediately or on save if the change would violate a node type constraint. <p/> A VersionException will be thrown immediately if this node is versionable and checked-in * <p/> A LockException will be thrown immediately if a lock prevents the setting of the property.
Specified by:
setProperty in interface javax.jcr.Node
Parameters:
name - the name of the property to be set.
value - a Value object.
type - the type of the property.
Returns:
the Property object set, or null if this method was used to remove a property (by setting its value to null).
Throws:
javax.jcr.ValueFormatException - if value cannot be converted to the specified type or if the property already exists and is multi-valued.
javax.jcr.version.VersionException - if this node is versionable and checked-in and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.lock.LockException - if a lock prevents the setting of the property and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.nodetype.ConstraintViolationException - if the change would violate a node-type constraint and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.RepositoryException - if another error occurs.

setProperty

javax.jcr.Property setProperty(java.lang.String name,
                               javax.jcr.Value[] values)
                               throws javax.jcr.RepositoryException
Throws RepositoryException since this implementation does not support user-defined multi-valued properties.
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

javax.jcr.Property setProperty(java.lang.String name,
                               javax.jcr.Value[] values,
                               int type)
                               throws javax.jcr.RepositoryException
Throws RepositoryException since this implementation does not support user-defined multi-valued properties.
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

setProperty

javax.jcr.Property setProperty(java.lang.String name,
                               java.lang.String[] values)
                               throws javax.jcr.RepositoryException
Throws RepositoryException since this implementation does not support user-defined multi-valued properties.
Specified by:
setProperty in interface javax.jcr.Node
Throws:
RepositoryException.
javax.jcr.RepositoryException

setProperty

javax.jcr.Property setProperty(java.lang.String name,
                               java.lang.String[] values,
                               int type)
                               throws javax.jcr.RepositoryException
Throws RepositoryException since there is no multi-value property.
Specified by:
setProperty in interface javax.jcr.Node
Throws:
RepositoryException.
javax.jcr.RepositoryException

setProperty

javax.jcr.Property 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
Sets the specified property to the specified value. If the property does not yet exist, it is created. The property type of the property being set is determined by the node type of this node (the one on which this method is being called). If this is something other than PropertyType.STRING, a best-effort conversion is attempted. If the conversion fails, a ValueFormatException is thrown. If the property is multi-valued, a ValueFormatException is also thrown. If another error occurs, a RepositoryException is thrown. <p/> If the node type of this node does not specify a particular property type for the property being set then PropertyType.STRING is used and, if the property already exists, it assumes both the new value and type PropertyType.STRING. <p/> Passing a null as the second parameter removes the property. It is equivalent to calling remove on the Property object itself. For example, N.setProperty("P", (String)null) would remove property called "P" of the node in N. <p/> To save the addition or removal of a property, a save call must be performed that includes the parent of the property in its scope, that is, a save on either the session, this node, or an ancestor of this node. To save a change to an existing property, a save call that includes that property in its scope is required. This means that in addition to the above-mentioned save options, a save on the changed property itself will also work. <p/> A ConstraintViolationException will be thrown immediately if the change would violate a node type constraint. <p/> A VersionException will be thrown immediately if this node is versionable and checked-in. <p/> A LockException will be thrown immediately if a lock prevents the setting of the property.
Specified by:
setProperty in interface javax.jcr.Node
Parameters:
name - The name of a property of this node
value - The value to assigned
Returns:
The updated Property object
Throws:
javax.jcr.ValueFormatException - if value cannot be converted to the type of the specified property.
javax.jcr.version.VersionException - if this node is versionable and checked-in and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.lock.LockException - if a lock prevents the setting of the property and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.nodetype.ConstraintViolationException - if the change would violate a node-type constraint and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.RepositoryException - If another error occurs.

setProperty

javax.jcr.Property 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
Sets the specified (single-value) property to the specified value. If the property does not yet exist, it is created. <p/> The type of the property is determined by the type parameter specified. <p/> If the property type specified is not PropertyType.STRING, then a best-effort conversion is attempted. If the conversion fails, a ValueFormatException is thrown. <p/> If the property is not single-valued then a ValueFormatException is also thrown. <p/> If the property already exists it assumes both the new value and the new property type. <p/> Passing a null as the second parameter removes the property. It is equivalent to calling remove on the Property object itself. For example, N.setProperty("P", (Value)null, type) would remove property called "P" of the node in N. <p/> To save the addition or removal of a property, a save call must be performed that includes the parent of the property in its scope, that is, a save on either the session, this node, or an ancestor of this node. To save a change to an existing property, a save call that includes that property in its scope is required. This means that in addition to the above-mentioned save options, a save on the changed property itself will also work. <p/> A ConstraintViolationException will be thrown immediately if the change would violate a node type constraint. <p/> A VersionException will be thrown immediately if this node is versionable and checked-in. <p/> A LockException will be thrown immediately if a lock prevents the setting of the property.
Specified by:
setProperty in interface javax.jcr.Node
Parameters:
name - the name of the property to be set.
value - a String object.
type - the type of the property.
Returns:
the Property object set, or null if this method was used to remove a property (by setting its value to null).
Throws:
javax.jcr.ValueFormatException - if value cannot be converted to the type of the specified property.
javax.jcr.version.VersionException - if this node is versionable and checked-in and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.lock.LockException - if a lock prevents the setting of the property and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.nodetype.ConstraintViolationException - if the change would violate a node-type constraint and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.RepositoryException - if another error occurs.

setProperty

javax.jcr.Property 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
Sets the specified property to the specified value. If the property does not yet exist, it is created. The property type of the property being set is determined by the node type of this node (the one on which this method is being called). If this is something other than PropertyType.BINARY, a best-effort conversion is attempted. If the conversion fails, a ValueFormatException is thrown. If the property is multi-valued, a ValueFormatException is also thrown. If another error occurs, a RepositoryException is thrown. <p/> If the node type of this node does not specify a particular property type for the property being set then PropertyType.BINARY is used and, if the property already exists, it assumes both the new value and type PropertyType.BINARY. <p/> Passing a null as the second parameter removes the property. It is equivalent to calling remove on the Property object itself. For example, N.setProperty("P", (InputStream)null) would remove property called "P" of the node in N. <p/> To save the addition or removal of a property, a save call must be performed that includes the parent of the property in its scope, that is, a save on either the session, this node, or an ancestor of this node. To save a change to an existing property, a save call that includes that property in its scope is required. This means that in addition to the above-mentioned save options, a save on the changed property itself will also work. <p/> A ConstraintViolationException will be thrown immediately if the change would violate a node type constraint. <p/> A VersionException will be thrown immediately if this node is versionable and checked-in. <p/> A LockException will be thrown immediately if a lock prevents the setting of the property.
Specified by:
setProperty in interface javax.jcr.Node
Parameters:
name - The name of a property of this node
value - The value to assigned
Returns:
The updated Property object
Throws:
javax.jcr.ValueFormatException - if value cannot be converted to the type of the specified property.
javax.jcr.version.VersionException - if this node is versionable and checked-in and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.lock.LockException - if a lock prevents the setting of the property and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.nodetype.ConstraintViolationException - if the change would violate a node-type constraint and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.RepositoryException - If another error occurs.

setProperty

javax.jcr.Property 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
Sets the specified property to the specified value. If the property does not yet exist, it is created. The property type of the property being set is determined by the node type of this node (the one on which this method is being called). If this is something other than PropertyType.BOOLEAN, a best-effort conversion is attempted. If the conversion fails, a ValueFormatException is thrown. If the property is multi-valued, a ValueFormatException is also thrown. If another error occurs, a RepositoryException is thrown. <p/> If the node type of this node does not specify a particular property type for the property being set then PropertyType.BOOLEAN is used and, if the property already exists, it assumes both the new value and type PropertyType.BOOLEAN. <p/> To save the addition or removal of a property, a save call must be performed that includes the parent of the property in its scope, that is, a save on either the session, this node, or an ancestor of this node. To save a change to an existing property, a save call that includes that property in its scope is required. This means that in addition to the above-mentioned save options, a save on the changed property itself will also work. <p/> A ConstraintViolationException will be thrown immediately if the change would violate a node type constraint. <p/> A VersionException will be thrown immediately if this node is versionable and checked-in. <p/> A LockException will be thrown immediately if a lock prevents the setting of the property.
Specified by:
setProperty in interface javax.jcr.Node
Parameters:
name - The name of a property of this node
value - The value to assigned
Returns:
The updated Property object
Throws:
javax.jcr.ValueFormatException - if value cannot be converted to the type of the specified property.
javax.jcr.version.VersionException - if this node is versionable and checked-in and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.lock.LockException - if a lock prevents the setting of the property and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.nodetype.ConstraintViolationException - if the change would violate a node-type constraint and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.RepositoryException - If another error occurs.

setProperty

javax.jcr.Property 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
Sets the specified property to the specified value. If the property does not yet exist, it is created. The property type of the property being set is determined by the node type of this node (the one on which this method is being called). If this is something other than PropertyType.DOUBLE, a best-effort conversion is attempted. If the conversion fails, a ValueFormatException is thrown. If the property is multi-valued, a ValueFormatException is also thrown. If another error occurs, a RepositoryException is thrown. <p/> If the node type of this node does not specify a particular property type for the property being set then PropertyType.DOUBLE is used and, if the property already exists, it assumes both the new value and type PropertyType.DOUBLE. <p/> To save the addition or removal of a property, a save call must be performed that includes the parent of the property in its scope, that is, a save on either the session, this node, or an ancestor of this node. To save a change to an existing property, a save call that includes that property in its scope is required. This means that in addition to the above-mentioned save options, a save on the changed property itself will also work. <p/> A ConstraintViolationException will be thrown immediately if the change would violate a node type constraint. <p/> A VersionException will be thrown immediately if this node is versionable and checked-in. <p/> A LockException will be thrown immediately if a lock prevents the setting of the property.
Specified by:
setProperty in interface javax.jcr.Node
Parameters:
name - The name of a property of this node
value - The value to assigned
Returns:
The updated Property object
Throws:
javax.jcr.ValueFormatException - if value cannot be converted to the type of the specified property.
javax.jcr.version.VersionException - if this node is versionable and checked-in and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.lock.LockException - if a lock prevents the setting of the property and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.nodetype.ConstraintViolationException - if the change would violate a node-type constraint and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.RepositoryException - If another error occurs.

setProperty

javax.jcr.Property 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
Sets the specified property to the specified value. If the property does not yet exist, it is created. The property type of the property being set is determined by the node type of this node (the one on which this method is being called). If this is something other than PropertyType.LONG, a best-effort conversion is attempted. If the conversion fails, a ValueFormatException is thrown. If the property is multi-valued, a ValueFormatException is also thrown. If another error occurs, a RepositoryException is thrown. <p/> If the node type of this node does not specify a particular property type for the property being set then PropertyType.LONG is used and, if the property already exists, it assumes both the new value and type PropertyType.LONG. <p/> To save the addition or removal of a property, a save call must be performed that includes the parent of the property in its scope, that is, a save on either the session, this node, or an ancestor of this node. To save a change to an existing property, a save call that includes that property in its scope is required. This means that in addition to the above-mentioned save options, a save on the changed property itself will also work. <p/> A ConstraintViolationException will be thrown immediately if the change would violate a node type constraint. <p/> A VersionException will be thrown immediately if this node is versionable and checked-in. <p/> A LockException will be thrown immediately if a lock prevents the setting of the property.
Specified by:
setProperty in interface javax.jcr.Node
Parameters:
name - The name of a property of this node
value - The value to assigned
Returns:
The updated Property object
Throws:
javax.jcr.ValueFormatException - if value cannot be converted to the type of the specified property.
javax.jcr.version.VersionException - if this node is versionable and checked-in and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.lock.LockException - if a lock prevents the setting of the property and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.nodetype.ConstraintViolationException - if the change would violate a node-type constraint and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.RepositoryException - If another error occurs.

setProperty

javax.jcr.Property 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
Sets the specified property to the specified value. If the property does not yet exist, it is created. The property type of the property being set is determined by the node type of this node (the one on which this method is being called). If this is something other than PropertyType.DATE, a best-effort conversion is attempted. If the conversion fails, a ValueFormatException is thrown. If the property is multi-valued, a ValueFormatException is also thrown. If another error occurs, a RepositoryException is thrown. <p/> If the node type of this node does not specify a particular property type for the property being set then PropertyType.DATE is used and, if the property already exists, it assumes both the new value and type PropertyType.DATE. <p/> Passing a null as the second parameter removes the property. It is equivalent to calling remove on the Property object itself. For example, N.setProperty("P", (Calendar)null) would remove property called "P" of the node in N. <p/> To save the addition or removal of a property, a save call must be performed that includes the parent of the property in its scope, that is, a save on either the session, this node, or an ancestor of this node. To save a change to an existing property, a save call that includes that property in its scope is required. This means that in addition to the above-mentioned save options, a save on the changed property itself will also work. <p/> A ConstraintViolationException will be thrown immediately if the change would violate a node type constraint. <p/> A VersionException will be thrown immediately if this node is versionable and checked-in. <p/> A LockException will be thrown immediately if a lock prevents the setting of the property.
Specified by:
setProperty in interface javax.jcr.Node
Parameters:
name - The name of a property of this node
value - The value to assigned
Returns:
The updated Property object
Throws:
javax.jcr.ValueFormatException - if value cannot be converted to the type of the specified property.
javax.jcr.version.VersionException - if this node is versionable and checked-in and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.lock.LockException - if a lock prevents the setting of the property and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.nodetype.ConstraintViolationException - if the change would violate a node-type constraint and this implementation performs this validation immediately instead of waiting until save.
javax.jcr.RepositoryException - If another error occurs.

setProperty

javax.jcr.Property setProperty(java.lang.String name,
                               javax.jcr.Node value)
                               throws javax.jcr.RepositoryException
The operation of setting the specified (REFERENCE)property to refer to the specified Node is not supported.
Specified by:
setProperty in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException

getNode

javax.jcr.Node getNode(java.lang.String relPath)
                       throws javax.jcr.PathNotFoundException,
                              javax.jcr.RepositoryException
Returns the node at relPath relative to this node. <p/> Within the scope of a single Session object, if a Node object has been acquired, any subsequent call of getNode reacquiring the same node must return a Node object reflecting the same state as the earlier Node object.
Specified by:
getNode in interface javax.jcr.Node
Parameters:
relPath - The relative path of the node to retrieve.
Returns:
The node at relPath.
Throws:
javax.jcr.PathNotFoundException - If no node exists at the specified path.
javax.jcr.RepositoryException - If another error occurs.

getNodes

javax.jcr.NodeIterator getNodes()
                                throws javax.jcr.RepositoryException
Returns a NodeIterator over all child Nodes of this Node. Does not include properties of this Node. The same reacquisition semantics apply as with getNode(String). If this node has no child nodes, then an empty iterator is returned.
Specified by:
getNodes in interface javax.jcr.Node
Returns:
A NodeIterator over all child Nodes of this Node.
Throws:
javax.jcr.RepositoryException - If an error occurs.

getNodes

javax.jcr.NodeIterator getNodes(java.lang.String namePattern)
                                throws javax.jcr.RepositoryException
Gets all child nodes of this node that match namePattern. The pattern may be a full name or a partial name with one or more wildcard characters ("*"), or a disjunction (using the "|" character to represent logical OR) of these. For example, <p/> N.getNodes("jcr:* | myapp:report | my doc") <p/> would return a NodeIterator holding all child nodes of N that are either called 'myapp:report', begin with the prefix 'jcr:' or are called 'my doc'. <p/> Note that leading and trailing whitespace around a disjunct is ignored, but whitespace within a disjunct forms part of the pattern to be matched. <p/> The EBNF for namePattern is: <p/> namePattern ::= disjunct {'|' disjunct}
disjunct ::= name [':' name]
name ::= '*' | ['*'] fragment {'*' fragment} ['*']
fragment ::= char {char}
char ::= nonspace | ' '
nonspace ::= (* Any Unicode character except: '/', ':', '[', ']', '*', ''', '"', '|' or any whitespace character *)
<p/> The pattern is matched against the names (not the paths) of the immediate child nodes of this node. <p/> If this node has no matching child nodes, then an empty iterator is returned. <p/> The same reacquisition semantics apply as with getNode(String).
Specified by:
getNodes in interface javax.jcr.Node
Parameters:
namePattern - a name pattern
Returns:
a NodeIterator
Throws:
javax.jcr.RepositoryException - If an unexpected error occurs.

getProperty

javax.jcr.Property getProperty(java.lang.String relPath)
                               throws javax.jcr.PathNotFoundException,
                                      javax.jcr.RepositoryException
Returns the property at relPath relative to this node. The same reacquisition semantics apply as with getNode(String).
Specified by:
getProperty in interface javax.jcr.Node
Parameters:
relPath - The relative path of the property to retrieve.
Returns:
The property at relPath.
Throws:
javax.jcr.PathNotFoundException - If no property exists at the specified path.
javax.jcr.RepositoryException - If another error occurs.

getProperties

javax.jcr.PropertyIterator getProperties()
                                         throws javax.jcr.RepositoryException
Returns all properties of this node. Returns a PropertyIterator over all properties of this node. Does not include child nodes of this node. The same reacquisition semantics apply as with getNode(String). If this node has no properties, then an empty iterator is returned.
Specified by:
getProperties in interface javax.jcr.Node
Returns:
A PropertyIterator.
Throws:
javax.jcr.RepositoryException - If an error occurs.

getProperties

javax.jcr.PropertyIterator getProperties(java.lang.String namePattern)
                                         throws javax.jcr.RepositoryException
Gets all properties of this node that match namePattern. The pattern may be a full name or a partial name with one or more wildcard characters ("*"), or a disjunction (using the "|" character to represent logical OR) of these. For example, <p/> N.getProperties("jcr:* | myapp:name | my doc") <p/> would return a PropertyIterator holding all properties of N that are either called 'myapp:name', begin with the prefix 'jcr:' or are called 'my doc'. <p/> Note that leading and trailing whitespace around a disjunct is ignored, but whitespace within a disjunct forms part of the pattern to be matched. <p/> The EBNF for namePattern is: <p/> namePattern ::= disjunct {'|' disjunct}
disjunct ::= name [':' name]
name ::= '*' | ['*'] fragment {'*' fragment} ['*']
fragment ::= char {char}
char ::= nonspace | ' '
nonspace ::= (* Any Unicode character except: '/', ':', '[', ']', '*', ''', '"', '|' or any whitespace character *)
<p/> The pattern is matched against the names (not the paths) of the immediate child properties of this node. <p/> If this node has no matching properties, then an empty iterator is returned. <p/> The same reacquisition semantics apply as with getNode(String).
Specified by:
getProperties in interface javax.jcr.Node
Parameters:
namePattern - a name pattern
Returns:
a PropertyIterator
Throws:
javax.jcr.RepositoryException - If an unexpected error occurs.

getPrimaryItem

javax.jcr.Item getPrimaryItem()
                              throws javax.jcr.ItemNotFoundException,
                                     javax.jcr.RepositoryException
Returns the primary child item of this node. The primary node type of this node may specify one child item (child node or property) of this node as the primary child item. This method returns that item. If this node does not have a primary item, either because none is declared in the node type or because a declared primary item is not present on this node instance, then this method throws an ItemNotFoundException. The same reacquisition semantics apply as with getNode(String).
Specified by:
getPrimaryItem in interface javax.jcr.Node
Returns:
the primary child item.
Throws:
javax.jcr.ItemNotFoundException - if this node does not have a primary child item, either because none is declared in the node type or because a declared primary item is not present on this node instance.
javax.jcr.RepositoryException - if another error occurs.

getUUID

java.lang.String getUUID()
                         throws javax.jcr.UnsupportedRepositoryOperationException,
                                javax.jcr.RepositoryException
Returns the UUID of this node as recorded in this node's jcr:uuid property. This method only works on nodes of mixin node type mix:referenceable. On nonreferenceable nodes, this method throws an UnsupportedRepositoryOperationException. To avoid throwing an exception to determine whether a node has a UUID, a call to isNodeType( java.lang.String) where the String parameter is oracle.ocs.jcr.nodetype.OracleNodeType_BEEHIVE_MIXREFERENCEABLE can be made.
Specified by:
getUUID in interface javax.jcr.Node
Returns:
the UUID of this node
Throws:
javax.jcr.UnsupportedRepositoryOperationException - If this node nonreferenceable.
javax.jcr.RepositoryException - If another error occurs.

getIndex

int getIndex()
             throws javax.jcr.RepositoryException
This method returns the index of this node within the ordered set of its same-name sibling nodes. This index is the one used to address same-name siblings using the square-bracket notation, e.g., /a[3]/b[4]. Note that the index always starts at 1 (not 0), for compatibility with XPath. As a result, for nodes that do not have same-name-siblings, this method will always return 1 (as in this implementation).
Specified by:
getIndex in interface javax.jcr.Node
Returns:
The index of this node within the ordered set of its same-name sibling nodes.
Throws:
javax.jcr.RepositoryException - if an error occurs.

getReferences

javax.jcr.PropertyIterator getReferences()
                                         throws javax.jcr.RepositoryException
Returns all REFERENCE properties that refer to this node. <p/> Some level 2 implementations may only return properties that have been saved (in a transactional setting this includes both those properties that have been saved but not yet committed, as well as properties that have been committed). Other level 2 implementations may additionally return properties that have been added within the current Session but are not yet saved. <p/> In implementations that support versioning, this method does not return REFERENCE properties that are part of the frozen state of a version in version storage. <p/> If this node has no references, an empty iterator is returned.
Specified by:
getReferences in interface javax.jcr.Node
Returns:
A PropertyIterator.
Throws:
javax.jcr.RepositoryException - if an error occurs

hasNode

boolean hasNode(java.lang.String relPath)
                throws javax.jcr.RepositoryException
Indicates whether a node exists at relPath Returns true if a node exists at relPath and false otherwise.
Specified by:
hasNode in interface javax.jcr.Node
Parameters:
relPath - The path of a (possible) node.
Returns:
true if a node exists at relPath; false otherwise.
Throws:
javax.jcr.RepositoryException - If an unspecified error occurs.

hasProperty

boolean hasProperty(java.lang.String relPath)
                    throws javax.jcr.RepositoryException
Indicates whether a property exists at relPath Returns true if a property exists at relPath and false otherwise.
Specified by:
hasProperty in interface javax.jcr.Node
Parameters:
relPath - The path of a (possible) property.
Returns:
true if a property exists at relPath; false otherwise.
Throws:
javax.jcr.RepositoryException - If an unspecified error occurs.

hasNodes

boolean hasNodes()
                 throws javax.jcr.RepositoryException
Indicates whether this node has child nodes. Returns true if this node has one or more child nodes; false otherwise.
Specified by:
hasNodes in interface javax.jcr.Node
Returns:
true if this node has one or more child nodes; false otherwise.
Throws:
javax.jcr.RepositoryException - If an unspecified error occurs.

hasProperties

boolean hasProperties()
                      throws javax.jcr.RepositoryException
Indicates whether this node has properties. Returns true if this node has one or more properties; false otherwise.
Specified by:
hasProperties in interface javax.jcr.Node
Returns:
true if this node has one or more properties; false otherwise.
Throws:
javax.jcr.RepositoryException - If an unspecified error occurs.

getPrimaryNodeType

javax.jcr.nodetype.NodeType getPrimaryNodeType()
                                               throws javax.jcr.RepositoryException
Returns the primary node type of this node.
Specified by:
getPrimaryNodeType in interface javax.jcr.Node
Returns:
a NodeType object.
Throws:
javax.jcr.RepositoryException - if an error occurs

getMixinNodeTypes

javax.jcr.nodetype.NodeType[] getMixinNodeTypes()
                                                throws javax.jcr.RepositoryException
Returns an array of NodeType objects representing the mixin node types assigned to this node. This includes only those mixin types explicitly assigned to this node, and therefore listed in the property jcr:mixinTypes. It does not include mixin types inherited through the addition of supertypes to the primary type hierarchy. Assigning mixin nodetypes is not supported in this implementation. Therefore, null is returned.
Specified by:
getMixinNodeTypes in interface javax.jcr.Node
Returns:
an array of NodeType objects.
Throws:
javax.jcr.RepositoryException - if an error occurs

isNodeType

boolean isNodeType(java.lang.String nodeTypeName)
                   throws javax.jcr.RepositoryException
Indicates whether this node is of the specified node type. Returns true if this node is of the specified node type or a subtype of the specified node type. Returns false otherwise.
Specified by:
isNodeType in interface javax.jcr.Node
Parameters:
nodeTypeName - the name of a node type.
Returns:
true if this node is of the specified node type or a subtype of the specified node type; returns false otherwise.
Throws:
javax.jcr.RepositoryException - If an error occurs.

addMixin

void addMixin(java.lang.String mixinName)
              throws javax.jcr.RepositoryException
Adding mixin node type is not supported.
Specified by:
addMixin in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException - if another error occurs.

removeMixin

void removeMixin(java.lang.String mixinName)
                 throws javax.jcr.RepositoryException
Removing mixin node type is not supported.
Specified by:
removeMixin in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException - if another error occurs.

canAddMixin

boolean canAddMixin(java.lang.String mixinName)
                    throws javax.jcr.RepositoryException
Returns false since adding specified mixin node type is not supported
Specified by:
canAddMixin in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException - if another error occurs.

getDefinition

javax.jcr.nodetype.NodeDefinition getDefinition()
                                                throws javax.jcr.RepositoryException
Returns the node definition that applies to this node.
Specified by:
getDefinition in interface javax.jcr.Node
Returns:
a NodeDefinition object.
Throws:
javax.jcr.RepositoryException - if an error occurs.
See Also:
NodeType.getChildNodeDefinitions()

checkin

javax.jcr.version.Version checkin()
                                  throws javax.jcr.version.VersionException,
                                         javax.jcr.UnsupportedRepositoryOperationException,
                                         javax.jcr.InvalidItemStateException,
                                         javax.jcr.lock.LockException,
                                         javax.jcr.RepositoryException
Creates a new version with a system generated version name and returns that version (which will be the new base version of this node). Sets the jcr:checkedOut property to false thus putting the node into the checked-in state. This means that this node becomes read-only. <p/> Read-only status means that an item cannot be altered by the client using standard API methods (addNode, setProperty, etc.). The only exceptions to this rule are the restore(java.lang.String, boolean) (all signatures) and OracleWorkspace.restore(javax.jcr.version.Version[], boolean) operations; these do not respect read-only status due to check-in. Note that remove of a read-only node is possible, as long as its parent is not read-only (since removal is an alteration of the parent node). <p/> If this node is already checked-in, this method has no effect but returns the current base version of this node. <p/> If this node is not versionable, an UnsupportedRepositoryOperationException is thrown. <p/> If there are unsaved changes pending on this node, an InvalidItemStateException is thrown. <p/> Throws a LockException if a lock prevents the checkin. <p/> If checkin succeeds, the change to the jcr:checkedOut property is automatically saved (there is no need to do an additional save). <p/>
Specified by:
checkin in interface javax.jcr.Node
Returns:
a Version object
Throws:
javax.jcr.version.VersionException - if jcr:predecessors does not contain at least one value or if a child item of this node has an OnParentVersion status of ABORT.
javax.jcr.UnsupportedRepositoryOperationException - If this node is not versionable.
javax.jcr.InvalidItemStateException - If unsaved changes exist on this node.
javax.jcr.lock.LockException - if a lock prevents the checkin.
javax.jcr.RepositoryException - If another error occurs.

checkout

void checkout()
              throws javax.jcr.UnsupportedRepositoryOperationException,
                     javax.jcr.lock.LockException,
                     javax.jcr.InvalidItemStateException,
                     javax.jcr.RepositoryException
Sets this versionable node to checked-out status by setting its jcr:isCheckedOut property to true and adds to the jcr:predecessors (multi-value) property a reference to the current base version (the same value as held in jcr:baseVersion). This method puts the node into the checked-out state, making it no longer read-only. <p/> If successful, these changes are persisted immediately, there is no need to call save. <p/> If this node is already checked-out, this method has no effect. If there are unsaved changes pending on this node, an InvalidItemStateException is thrown. If this node is not versionable, an UnsupportedRepositoryOperationException is thrown. <p/> Throws a LockException if a lock prevents the checkout.
Specified by:
checkout in interface javax.jcr.Node
Throws:
javax.jcr.UnsupportedRepositoryOperationException - If this node is not versionable.
javax.jcr.lock.LockException - if a lock prevents the checkout.
javax.jcr.RepositoryException - If another error occurs.
javax.jcr.InvalidItemStateException

doneMerge

void doneMerge(javax.jcr.version.Version version)
               throws javax.jcr.UnsupportedRepositoryOperationException
This operation is not supported.
Specified by:
doneMerge in interface javax.jcr.Node
Throws:
UnsupportedRepositoryOperationException.
javax.jcr.UnsupportedRepositoryOperationException

cancelMerge

void cancelMerge(javax.jcr.version.Version version)
                 throws javax.jcr.UnsupportedRepositoryOperationException
This operation is not supported.
Specified by:
cancelMerge in interface javax.jcr.Node
Throws:
UnsupportedRepositoryOperationException.
javax.jcr.UnsupportedRepositoryOperationException

update

void update(java.lang.String srcWorkspaceName)
            throws javax.jcr.RepositoryException
Multiple workspaces is not supported. Hence this operation is not supported.
Specified by:
update in interface javax.jcr.Node
Throws:
RepositoryException.
javax.jcr.RepositoryException

merge

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
This operation is not supported.
Specified by:
merge in interface javax.jcr.Node
Throws:
javax.jcr.RepositoryException - if another error occurs.
javax.jcr.NoSuchWorkspaceException
javax.jcr.AccessDeniedException
javax.jcr.MergeException
javax.jcr.lock.LockException
javax.jcr.InvalidItemStateException

getCorrespondingNodePath

java.lang.String getCorrespondingNodePath(java.lang.String workspaceName)
Returns null since we do not support multiple workspaces.
Specified by:
getCorrespondingNodePath in interface javax.jcr.Node

isCheckedOut

boolean isCheckedOut()
                     throws javax.jcr.RepositoryException
Returns true if this node is either
<li/>versionable and currently checked-out, <li/>non-versionable and it has no versionable ancestor.
Returns false if this node is either
<li/>versionable and currently checked-in
Specified by:
isCheckedOut in interface javax.jcr.Node
Returns:
a boolean
Throws:
javax.jcr.RepositoryException - If another error occurs.

restore

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
Restores this node to the state defined by the version with the specified versionName. <p/> If this node is not versionable, an UnsupportedRepositoryOperationException is thrown. <p/> If successful, the change is persisted immediately and there is no need to call save. <p/> A VersionException is thrown if no version with the specified versionName exists in this node's version history or if an attempt is made to restore the root version (jcr:rootVersion). <p/> An InvalidItemStateException is thrown if this Session (not necessarily this Node) has pending unsaved changes. <p/> A LockException is thrown if a lock prevents the addition of the mixin. <p/> This method will work regardless of whether this node is checked-in or not. <p/>
Specified by:
restore in interface javax.jcr.Node
Parameters:
versionName - a Version object
removeExisting - a boolean flag that governs UUID collision is ignored in this implementation.
Throws:
javax.jcr.UnsupportedRepositoryOperationException - if this node is not versionable.
javax.jcr.version.VersionException - if the specified version is not part of this node's version history or if an attempt is made to restore the root version (jcr:rootVersion).
javax.jcr.ItemExistsException - if removeExisting is false and a UUID collision occurs.
javax.jcr.lock.LockException - if a lock prevents the restore.
javax.jcr.InvalidItemStateException - if this Session (not necessarily this Node) has pending unsaved changes.
javax.jcr.RepositoryException - If another error occurs.

restore

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
Restores this node to the state defined by the specified version. <p/> If this node is not versionable, an UnsupportedRepositoryOperationException is thrown. <p/> If successful, the change is persisted immediately and there is no need to call save. <p/> A VersionException is thrown if the specified version is not part of this node's version history or if an attempt is made to restore the root version (jcr:rootVersion). <p/> An InvalidItemStateException is thrown if this Session (not necessarily this Node) has pending unsaved changes. <p/> A LockException is thrown if a lock prevents the restore. <p/> This method will work regardless of whether this node is checked-in or not. <p/>
Specified by:
restore in interface javax.jcr.Node
Parameters:
version - a Version object
removeExisting - a boolean flag that governs UUID collision is ignored in this implementation.
Throws:
javax.jcr.UnsupportedRepositoryOperationException - if this node is not versionable.
javax.jcr.version.VersionException - if the specified version is not part of this node's version history or if an attempt is made to restore the root version (jcr:rootVersion).
javax.jcr.ItemExistsException - if removeExisting is false and a UUID collision occurs.
javax.jcr.InvalidItemStateException - if this Session (not necessarily this Node) has pending unsaved changes.
javax.jcr.lock.LockException - if a lock prevents the restore.
javax.jcr.RepositoryException - if another error occurs.

restore

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
Restores the specified version to relPath, relative to this node. <p/> A node need not exist at relPath, though the parent of relPath must exist, otherwise a PathNotFoundException is thrown. <p/> If a node does exist at relPath then it must correspond to the version being restored (the version must be a version of that node) and must not be a root version (jcr:rootVersion), otherwise a VersionException is thrown. <p/> If no node exists at relPath then a VersionException is thrown if the parent node of relPath is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in. <p/> If there is a node at relPath then the checked-in status of that node itself and the checked-in status of its parent are irrelevant. The restore will work even if one or both are checked-in. <p/> <p/> If the would-be parent of the location relPath is actually a property, or if a node type restriction would be violated, then a ConstraintViolationException is thrown. <p/> If the restore succeeds, the changes made to this node are persisted immediately, there is no need to call save. <p/> An InvalidItemStateException is thrown if this Session (not necessarily this Node) has pending unsaved changes. <p/> An UnsupportedRepositoryOperationException is thrown if this node is not versionable. <p/> A LockException is thrown if a lock prevents the restore.
Specified by:
restore in interface javax.jcr.Node
Parameters:
version - a version object
relPath - the path to which the version is to be restored
removeExisting - a boolean flag that governs UUID collision is ignored in this implementation.
Throws:
javax.jcr.PathNotFoundException - if the parent of relPath does not exist.
javax.jcr.ItemExistsException - if removeExisting is false and a UUID collision occurs
javax.jcr.nodetype.ConstraintViolationException - If the would-be parent of the location relPath is actually a property, or if a node type restriction would be violated
javax.jcr.version.VersionException - if the parent node of relPath is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in or if a node exists at relPath that is not the node corresponding to the specified version or if an attempt is made to restore the root version (jcr:rootVersion).
javax.jcr.UnsupportedRepositoryOperationException - if this node is not versionable.
javax.jcr.lock.LockException - if a lock prevents the restore.
javax.jcr.InvalidItemStateException - if this Session (not necessarily this Node) has pending unsaved changes.
javax.jcr.RepositoryException - if another error occurs

restoreByLabel

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
Restores the version of this node with the specified version label. If this node is not versionable, an UnsupportedRepositoryOperationException is thrown. If successful, the change is persisted immediately and there is no need to call save. <p/> A VersionException is thrown if the specified versionLabel does not exist in this node's version history. <p/> An InvalidItemStateException is thrown if this Session (not necessarily this Node) has pending unsaved changes. <p/> A LockException is thrown if a lock prevents the restore. <p/> This method will work regardless of whether this node is checked-in or not. <p/>
Specified by:
restoreByLabel in interface javax.jcr.Node
Parameters:
versionLabel - a String
removeExisting - a boolean flag that governs UUID collision is ignored in this implementation.
Throws:
javax.jcr.UnsupportedRepositoryOperationException - if this node is not verisonable.
javax.jcr.version.VersionException - if the specified versionLabel does not exist in this node's version history.
javax.jcr.ItemExistsException - if removeExisting is false and a UUID collision occurs.
javax.jcr.lock.LockException - if a lock prevents the restore.
javax.jcr.InvalidItemStateException - if this Session (not necessarily this Node) has pending unsaved changes.
javax.jcr.RepositoryException - If another error occurs.

getVersionHistory

javax.jcr.version.VersionHistory getVersionHistory()
                                                   throws javax.jcr.UnsupportedRepositoryOperationException,
                                                          javax.jcr.RepositoryException
Returns the VersionHistory object of this node. This object provides access to the nt:versionHistory node holding this node's versions. <p/> If this node is not versionable, an UnsupportedRepositoryOperationException is thrown.
Specified by:
getVersionHistory in interface javax.jcr.Node
Returns:
a VersionHistory object
Throws:
javax.jcr.UnsupportedRepositoryOperationException - if this node is not versionable.
javax.jcr.RepositoryException - If another error occurs.

getBaseVersion

javax.jcr.version.Version getBaseVersion()
                                         throws javax.jcr.UnsupportedRepositoryOperationException,
                                                javax.jcr.RepositoryException
Returns the current base version of this versionable node. <p/> If this node is not versionable, an UnsupportedRepositoryOperationException is thrown.
Specified by:
getBaseVersion in interface javax.jcr.Node
Returns:
a Version object.
Throws:
javax.jcr.UnsupportedRepositoryOperationException - if this node is not versionable.
javax.jcr.RepositoryException - If another error occurs.

lock

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
Places a lock on this node. If successful, this node is said to hold the lock. <p/> The locks are csi locks (hierarchical in nature) irrespective of the value of isDeep. <p/> If isSessionScoped is true then this lock will expire upon the expiration of the current session (either through an automatic or explicit Session.logout); if false, this lock does not expire until explicitly unlocked. <p/> Returns a Lock object reflecting the state of the new lock and including a lock token. See, in contrast, getLock(), which returns the Lock without the lock token. <p/> The lock token is also automatically added to the set of lock tokens held by the current Session. <p/> If successful, then the property jcr:lockOwner is created and set to the value of Session.getUserID for the current session and the property jcr:lockIsDeep is set to the value passed in as isDeep. These changes are persisted automatically; there is no need to call save. <p/> Note that it is possible to lock a node even if it is checked-in (the lock-related properties will be changed despite the checked-in status). <p/> If this node is not of mixin node type mix:lockable then an LockException is thrown. <p/> If this node is already locked by another user (either because it holds a lock or a lock above it applies to it), a LockException is thrown. <p/> If the current session does not have sufficient privileges to place the lock, an AccessDeniedException is thrown. <p/> An InvalidItemStateException is thrown if this node has pending unsaved changes. <p/> A RepositoryException is thrown if another error occurs.
Specified by:
lock in interface javax.jcr.Node
Parameters:
isDeep - if true this lock will apply to this node and all its descendants; if false, it applies only to this node.
isSessionScoped - if true, this lock expires with the current session; if false it expires when explicitly or automatically unlocked for some other reason.
Returns:
A Lock object containing a lock token.
Throws:
javax.jcr.lock.LockException - if this node is not mix:lockable or this node is already locked by some other user.
javax.jcr.AccessDeniedException - if this session does not have permission to lock this node.
javax.jcr.InvalidItemStateException - if this node has pending unsaved changes.
javax.jcr.RepositoryException - if another error occurs.
javax.jcr.UnsupportedRepositoryOperationException

getLock

javax.jcr.lock.Lock getLock()
                            throws javax.jcr.UnsupportedRepositoryOperationException,
                                   javax.jcr.lock.LockException,
                                   javax.jcr.AccessDeniedException,
                                   javax.jcr.RepositoryException
Returns the Lock object that applies to this node. This may be either a lock on this node itself or a deep lock on a node above this node. <p/> If this Session (the one through which this Node was acquired) holds the lock token for this lock, then the returned Lock object contains that lock token (accessible through Lock.getLockToken). If this Session does not hold the applicable lock token, then the returned Lock object will not contain the lock token (its Lock.getLockToken method will return null). <p/> If this node is not locked (no lock applies to this node), a LockException is thrown. <p/> If the current session does not have sufficient privileges to get the lock, an AccessDeniedException is thrown. <p/> A RepositoryException is thrown if another error occurs.
Specified by:
getLock in interface javax.jcr.Node
Returns:
The applicable Lock object, without a contained lock token.
Throws:
javax.jcr.lock.LockException - if no lock applies to this node.
javax.jcr.AccessDeniedException - if the current session does not have permission to get the lock.
javax.jcr.RepositoryException - if another error occurs.
javax.jcr.UnsupportedRepositoryOperationException

unlock

void unlock()
            throws javax.jcr.UnsupportedRepositoryOperationException,
                   javax.jcr.lock.LockException,
                   javax.jcr.AccessDeniedException,
                   javax.jcr.InvalidItemStateException,
                   javax.jcr.RepositoryException
Removes the lock on this node. Also removes the properties jcr:lockOwner and jcr:lockIsDeep from this node. These changes are persisted automatically; there is no need to call save. <p/> If this node does not currently hold a lock or holds a lock for which this Session does not have the correct lock token, then a LockException is thrown. Note however that the system may give permission to some users to unlock locks for which they do not have the lock token. Typically such "lock-superuser" capability is intended to facilitate administrational clean-up of orphaned open-scoped locks. <p/> Note that it is possible to unlock a node even if it is checked-in (the lock-related properties will be changed despite the checked-in status). <p/> If the current session does not have sufficient privileges to remove the lock, an AccessDeniedException is thrown. <p/> An InvalidItemStateException is thrown if this node has pending unsaved changes. <p/> A RepositoryException is thrown if another error occurs.
Specified by:
unlock in interface javax.jcr.Node
Throws:
javax.jcr.lock.LockException - if this node does not currently hold a lock or holds a lock for which this Session does not have the correct lock token
javax.jcr.AccessDeniedException - if the current session does not have permission to unlock this node.
javax.jcr.InvalidItemStateException - if this node has pending unsaved changes.
javax.jcr.RepositoryException - if another error occurs.
javax.jcr.UnsupportedRepositoryOperationException

holdsLock

boolean holdsLock()
                  throws javax.jcr.RepositoryException
Returns true if this node holds a lock; otherwise returns false. To hold a lock means that this node has actually had a lock placed on it specifically, as opposed to just having a lock apply to it due to a deep lock held by a node above.
Specified by:
holdsLock in interface javax.jcr.Node
Returns:
a boolean.
Throws:
javax.jcr.RepositoryException - if an error occurs.

isLocked

boolean isLocked()
                 throws javax.jcr.RepositoryException
Returns true if this node is locked either as a result of a lock held by this node by the same or different user or by a deep lock on a node above this node by different user; otherwise returns false. Note if same user has held a lock above this, it returns false.
Specified by:
isLocked in interface javax.jcr.Node
Returns:
a boolean.
Throws:
javax.jcr.RepositoryException - if an error occurs.

Skip navigation links

Oracle Beehive Java Content Repository Java API Reference
Release 1 (1.5)

E14840-01


Copyright © 2008, 2009, Oracle and/or its affiliates. All rights reserved.