|
Oracle Beehive Java Content Repository Java API Reference Release 1 (1.4) E13801-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface OracleNode
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 Node s 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 |
---|
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
addNode(String relPath, String primaryNodeTypeName)
to be used.addNode
in interface javax.jcr.Node
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
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
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.addNode
in interface javax.jcr.Node
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.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
void orderBefore(java.lang.String srcChildRelPath, java.lang.String destChildRelPath) throws javax.jcr.UnsupportedRepositoryOperationException
UnsupportedRepositoryOperationException
is thrown. <p/>orderBefore
in interface javax.jcr.Node
javax.jcr.UnsupportedRepositoryOperationException
- since ordering is not supported.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
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.setProperty
in interface javax.jcr.Node
name
- The name of a property of this nodevalue
- The value to be assignedProperty
objectjavax.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.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
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.setProperty
in interface javax.jcr.Node
name
- the name of the property to be set.value
- a Value
object.type
- the type of the property.Property
object set, or null
if this method was used to remove a property (by setting its value to null
).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.javax.jcr.Property setProperty(java.lang.String name, javax.jcr.Value[] values) throws javax.jcr.RepositoryException
setProperty
in interface javax.jcr.Node
javax.jcr.RepositoryException
javax.jcr.Property setProperty(java.lang.String name, javax.jcr.Value[] values, int type) throws javax.jcr.RepositoryException
setProperty
in interface javax.jcr.Node
javax.jcr.RepositoryException
javax.jcr.Property setProperty(java.lang.String name, java.lang.String[] values) throws javax.jcr.RepositoryException
setProperty
in interface javax.jcr.Node
RepositoryException.
javax.jcr.RepositoryException
javax.jcr.Property setProperty(java.lang.String name, java.lang.String[] values, int type) throws javax.jcr.RepositoryException
setProperty
in interface javax.jcr.Node
RepositoryException.
javax.jcr.RepositoryException
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
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.setProperty
in interface javax.jcr.Node
name
- The name of a property of this nodevalue
- The value to assignedProperty
objectjavax.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.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
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.setProperty
in interface javax.jcr.Node
name
- the name of the property to be set.value
- a String
object.type
- the type of the property.Property
object set, or null
if this method was used to remove a property (by setting its value to null
).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.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
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.setProperty
in interface javax.jcr.Node
name
- The name of a property of this nodevalue
- The value to assignedProperty
objectjavax.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.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
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.setProperty
in interface javax.jcr.Node
name
- The name of a property of this nodevalue
- The value to assignedProperty
objectjavax.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.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
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.setProperty
in interface javax.jcr.Node
name
- The name of a property of this nodevalue
- The value to assignedProperty
objectjavax.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.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
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.setProperty
in interface javax.jcr.Node
name
- The name of a property of this nodevalue
- The value to assignedProperty
objectjavax.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.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
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.setProperty
in interface javax.jcr.Node
name
- The name of a property of this nodevalue
- The value to assignedProperty
objectjavax.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.javax.jcr.Property setProperty(java.lang.String name, javax.jcr.Node value) throws javax.jcr.RepositoryException
REFERENCE
)property to refer to the specified Node
is not supported.setProperty
in interface javax.jcr.Node
javax.jcr.RepositoryException
javax.jcr.Node getNode(java.lang.String relPath) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
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.getNode
in interface javax.jcr.Node
relPath
- The relative path of the node to retrieve.relPath
.javax.jcr.PathNotFoundException
- If no node exists at the specified path.javax.jcr.RepositoryException
- If another error occurs.javax.jcr.NodeIterator getNodes() throws javax.jcr.RepositoryException
NodeIterator
over all child Node
s 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.getNodes
in interface javax.jcr.Node
NodeIterator
over all child Node
s of this Node
.javax.jcr.RepositoryException
- If an error occurs.javax.jcr.NodeIterator getNodes(java.lang.String namePattern) throws javax.jcr.RepositoryException
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)
.getNodes
in interface javax.jcr.Node
namePattern
- a name patternNodeIterator
javax.jcr.RepositoryException
- If an unexpected error occurs.javax.jcr.Property getProperty(java.lang.String relPath) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
relPath
relative to this
node. The same reacquisition semantics apply as with getNode(String)
.getProperty
in interface javax.jcr.Node
relPath
- The relative path of the property to retrieve.relPath
.javax.jcr.PathNotFoundException
- If no property exists at the specified path.javax.jcr.RepositoryException
- If another error occurs.javax.jcr.PropertyIterator getProperties() throws javax.jcr.RepositoryException
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.getProperties
in interface javax.jcr.Node
PropertyIterator
.javax.jcr.RepositoryException
- If an error occurs.javax.jcr.PropertyIterator getProperties(java.lang.String namePattern) throws javax.jcr.RepositoryException
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)
.getProperties
in interface javax.jcr.Node
namePattern
- a name patternPropertyIterator
javax.jcr.RepositoryException
- If an unexpected error occurs.javax.jcr.Item getPrimaryItem() throws javax.jcr.ItemNotFoundException, javax.jcr.RepositoryException
ItemNotFoundException
. The same reacquisition semantics apply as with getNode(String)
.getPrimaryItem
in interface javax.jcr.Node
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.java.lang.String getUUID() throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
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.getUUID
in interface javax.jcr.Node
javax.jcr.UnsupportedRepositoryOperationException
- If this node nonreferenceable.javax.jcr.RepositoryException
- If another error occurs.int getIndex() throws javax.jcr.RepositoryException
/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).getIndex
in interface javax.jcr.Node
javax.jcr.RepositoryException
- if an error occurs.javax.jcr.PropertyIterator getReferences() throws javax.jcr.RepositoryException
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.getReferences
in interface javax.jcr.Node
PropertyIterator
.javax.jcr.RepositoryException
- if an error occursboolean hasNode(java.lang.String relPath) throws javax.jcr.RepositoryException
relPath
Returns true
if a node exists at relPath
and false
otherwise.hasNode
in interface javax.jcr.Node
relPath
- The path of a (possible) node.true
if a node exists at relPath
; false
otherwise.javax.jcr.RepositoryException
- If an unspecified error occurs.boolean hasProperty(java.lang.String relPath) throws javax.jcr.RepositoryException
relPath
Returns true
if a property exists at relPath
and false
otherwise.hasProperty
in interface javax.jcr.Node
relPath
- The path of a (possible) property.true
if a property exists at relPath
; false
otherwise.javax.jcr.RepositoryException
- If an unspecified error occurs.boolean hasNodes() throws javax.jcr.RepositoryException
true
if this node has one or more child nodes; false
otherwise.hasNodes
in interface javax.jcr.Node
true
if this node has one or more child nodes; false
otherwise.javax.jcr.RepositoryException
- If an unspecified error occurs.boolean hasProperties() throws javax.jcr.RepositoryException
true
if this node has one or more properties; false
otherwise.hasProperties
in interface javax.jcr.Node
true
if this node has one or more properties; false
otherwise.javax.jcr.RepositoryException
- If an unspecified error occurs.javax.jcr.nodetype.NodeType getPrimaryNodeType() throws javax.jcr.RepositoryException
getPrimaryNodeType
in interface javax.jcr.Node
NodeType
object.javax.jcr.RepositoryException
- if an error occursjavax.jcr.nodetype.NodeType[] getMixinNodeTypes() throws javax.jcr.RepositoryException
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.getMixinNodeTypes
in interface javax.jcr.Node
NodeType
objects.javax.jcr.RepositoryException
- if an error occursboolean isNodeType(java.lang.String nodeTypeName) throws javax.jcr.RepositoryException
true
if this node is of the specified node type or a subtype of the specified node type. Returns false
otherwise.isNodeType
in interface javax.jcr.Node
nodeTypeName
- the name of a node type.javax.jcr.RepositoryException
- If an error occurs.void addMixin(java.lang.String mixinName) throws javax.jcr.RepositoryException
addMixin
in interface javax.jcr.Node
javax.jcr.RepositoryException
- if another error occurs.void removeMixin(java.lang.String mixinName) throws javax.jcr.RepositoryException
removeMixin
in interface javax.jcr.Node
javax.jcr.RepositoryException
- if another error occurs.boolean canAddMixin(java.lang.String mixinName) throws javax.jcr.RepositoryException
false
since adding specified mixin node type is not supportedcanAddMixin
in interface javax.jcr.Node
javax.jcr.RepositoryException
- if another error occurs.javax.jcr.nodetype.NodeDefinition getDefinition() throws javax.jcr.RepositoryException
getDefinition
in interface javax.jcr.Node
NodeDefinition
object.javax.jcr.RepositoryException
- if an error occurs.NodeType.getChildNodeDefinitions()
javax.jcr.version.Version checkin() throws javax.jcr.version.VersionException, javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.InvalidItemStateException, javax.jcr.lock.LockException, javax.jcr.RepositoryException
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/>checkin
in interface javax.jcr.Node
Version
objectjavax.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.void checkout() throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.lock.LockException, javax.jcr.InvalidItemStateException, javax.jcr.RepositoryException
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.checkout
in interface javax.jcr.Node
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
void doneMerge(javax.jcr.version.Version version) throws javax.jcr.UnsupportedRepositoryOperationException
doneMerge
in interface javax.jcr.Node
UnsupportedRepositoryOperationException.
javax.jcr.UnsupportedRepositoryOperationException
void cancelMerge(javax.jcr.version.Version version) throws javax.jcr.UnsupportedRepositoryOperationException
cancelMerge
in interface javax.jcr.Node
UnsupportedRepositoryOperationException.
javax.jcr.UnsupportedRepositoryOperationException
void update(java.lang.String srcWorkspaceName) throws javax.jcr.RepositoryException
update
in interface javax.jcr.Node
RepositoryException.
javax.jcr.RepositoryException
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
merge
in interface javax.jcr.Node
javax.jcr.RepositoryException
- if another error occurs.javax.jcr.NoSuchWorkspaceException
javax.jcr.AccessDeniedException
javax.jcr.MergeException
javax.jcr.lock.LockException
javax.jcr.InvalidItemStateException
java.lang.String getCorrespondingNodePath(java.lang.String workspaceName)
getCorrespondingNodePath
in interface javax.jcr.Node
boolean isCheckedOut() throws javax.jcr.RepositoryException
isCheckedOut
in interface javax.jcr.Node
javax.jcr.RepositoryException
- If another error occurs.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
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/>restore
in interface javax.jcr.Node
versionName
- a Version
objectremoveExisting
- a boolean flag that governs UUID collision is ignored in this implementation.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.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
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/>restore
in interface javax.jcr.Node
version
- a Version
objectremoveExisting
- a boolean flag that governs UUID collision is ignored in this implementation.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.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
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.restore
in interface javax.jcr.Node
version
- a version objectrelPath
- the path to which the version is to be restoredremoveExisting
- a boolean flag that governs UUID collision is ignored in this implementation.javax.jcr.PathNotFoundException
- if the parent of relPath
does not exist.javax.jcr.ItemExistsException
- if removeExisting is false and a UUID collision occursjavax.jcr.nodetype.ConstraintViolationException
- If the would-be parent of the location relPath
is actually a property, or if a node type restriction would be violatedjavax.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 occursvoid 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
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/>restoreByLabel
in interface javax.jcr.Node
versionLabel
- a StringremoveExisting
- a boolean flag that governs UUID collision is ignored in this implementation.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.javax.jcr.version.VersionHistory getVersionHistory() throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
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.getVersionHistory
in interface javax.jcr.Node
VersionHistory
objectjavax.jcr.UnsupportedRepositoryOperationException
- if this node is not versionable.javax.jcr.RepositoryException
- If another error occurs.javax.jcr.version.Version getBaseVersion() throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
UnsupportedRepositoryOperationException
is thrown.getBaseVersion
in interface javax.jcr.Node
Version
object.javax.jcr.UnsupportedRepositoryOperationException
- if this node is not versionable.javax.jcr.RepositoryException
- If another error occurs.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
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.lock
in interface javax.jcr.Node
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.Lock
object containing a lock token.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
javax.jcr.lock.Lock getLock() throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.lock.LockException, javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
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.getLock
in interface javax.jcr.Node
Lock
object, without a contained lock token.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
void unlock() throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.lock.LockException, javax.jcr.AccessDeniedException, javax.jcr.InvalidItemStateException, javax.jcr.RepositoryException
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.unlock
in interface javax.jcr.Node
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 tokenjavax.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
boolean holdsLock() throws javax.jcr.RepositoryException
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.holdsLock
in interface javax.jcr.Node
boolean
.javax.jcr.RepositoryException
- if an error occurs.boolean isLocked() throws javax.jcr.RepositoryException
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.isLocked
in interface javax.jcr.Node
boolean
.javax.jcr.RepositoryException
- if an error occurs.
|
Oracle Beehive Java Content Repository Java API Reference Release 1 (1.4) E13801-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |