Java Doc for Node.java in  » 6.0-JDK-Modules » jsr-283 » javax » jcr » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » jsr 283 » javax.jcr 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.jcr.Node

Node
public interface Node extends Item(Code)
The Node interface represents a node in the hierarchy that makes up the repository.




Method Summary
public  voidaddMixin(String mixinName)
     Adds the specified mixin node type to this node and adds mixinName to this node's jcr:mixinTypes property.
public  NodeaddNode(String relPath)
     Creates a new node at relPath.
public  NodeaddNode(String relPath, String primaryNodeTypeName)
     Creates a new node at relPath of the specified node type. The same as Node.addNode(String relPath) except that the primary node type of the new node is explictly specified.

An ItemExistsException will be thrown either immediately (by this method), or on save, if an item at the specified path already exists and same-name siblings are not allowed.

public  booleancanAddMixin(String mixinName)
     Returns true if the specified mixin node type, mixinName, can be added to this node.
public  voidcancelMerge(Version version)
     Support for this method is only required under full versioning.

Cancels the merge process with respect to this node and specified version.

See Node.doneMerge for a full explanation.

public  Versioncheckin()
     Creates a new version with a system generated version name and returns that version (which will be the new base version of this node).
public  voidcheckout()
     Sets this versionable node to checked-out status by setting its jcr:isCheckedOut property to true.
public  voidcheckpoint()
     Performs a checkin() followed by a checkout().

If this node is already checked-in, this method is equivalent to checkout().

If this node is not versionable, an UnsupportedRepositoryOperationException is thrown.

A VersionException is thrown if a child item of this node has an OnParentVersion of ABORT.

public  NodecreateConfiguration(Version baseline)
     Calling createConfiguration on a node N creates, in the configuration storage, a new nt:configuration node whose root is N.
public  voiddoneMerge(Version version)
     Support for this method is only required under full versioning.

Completes the merge process with respect to this node and the specified version.

When the Node.merge method is called on a node, every versionable node in that subtree is compared with its corresponding node in the indicated other workspace and a "merge test result" is determined indicating one of the following:

  1. This node will be updated to the state of its correspondee (if the base version of the correspondee is more recent in terms of version history)
  2. This node will be left alone (if this node's base version is more recent in terms of version history).
  3. This node will be marked as having failed the merge test (if this node's base version is on a different branch of the version history from the base version of its corresponding node in the other workspace, thus preventing an automatic determination of which is more recent).
(See Node.merge for more details)

In the last case the merge of the non-versionable subtree (the "content") of this node must be done by the application (for example, by providing a merge tool for the user).

Additionally, once the content of the nodes has been merged, their version graph branches must also be merged.

public  voidfollowLifecycleTransition(String transition)
     Causes the lifecycle state of this node to undergo the specified transition.

This method may change the value of the jcr:currentLifecycleState property, in most cases it is expected that the implementation will change the value to that of the passed transition parameter, though this is an implementation-specific issue.

public  String[]getAllowedLifecycleTransistions()
     Returns the list of valid state transitions for this node.
public  VersiongetBaseVersion()
     Returns the current base version of this versionable node.
public  StringgetCorrespondingNodePath(String workspaceName)
     Returns the absolute path of the node in the specified workspace that corresponds to this node.

If no corresponding node exists then an ItemNotFoundException is thrown.

If the specified workspace does not exist then a NoSuchWorkspaceException is thrown.

If the current Session does not have sufficent rights to perform this operation, an AccessDeniedException is thrown.
Parameters:
  workspaceName - the name of the workspace.

public  NodeDefinitiongetDefinition()
     Returns the node definition that applies to this node.
public  StringgetIdentifier()
     Returns the identifier of this node.
public  intgetIndex()
     This method returns the index of this node within the ordered set of its same-name sibling nodes.
public  LockgetLock()
     Returns the Lock object that applies to this node.
public  NodeType[]getMixinNodeTypes()
     Returns an array of NodeType objects representing the mixin node types in effect for this node.
public  NodegetNode(String relPath)
     Returns the node at relPath relative to this node.

If relPath contains a path element that refers to a node with same-name sibling nodes without explicitly including an index using the array-style notation ([x]), then the index [1] is assumed (indexing of same name siblings begins at 1, not 0, in order to preserve compatibility with XPath).

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.

public  NodeIteratorgetNodes()
     Returns all child nodes of this node accessible through the current Session.
public  NodeIteratorgetNodes(String namePattern)
     Gets all child nodes of this node accessible through the current Session 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.
public  ItemgetPrimaryItem()
     Returns the primary child item of this node.
public  NodeTypegetPrimaryNodeType()
     Returns the primary node type in effect for this node.
public  PropertyIteratorgetProperties()
     Returns all properties of this node accessible through the current Session. Does not include child nodes of this node.
public  PropertyIteratorgetProperties(String namePattern)
     Gets all properties of this node accessible through the current Session 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.
public  PropertygetProperty(String relPath)
     Returns the property at relPath relative to this node.
public  PropertyIteratorgetReferences()
     This method returns all REFERENCE properties that refer to this node and that are accessible through the current Session.
public  PropertyIteratorgetReferences(String name)
     This method returns all REFERENCE properties that refer to this node, have the specified name and that are accessible through the current Session.

If the name parameter is null then all referring REFERENCES are returned regardless of name.

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).

public  NodeIteratorgetSharedSet()
     Returns an iterator over all nodes that are in the shared set of this node.
public  StringgetUUID()
     Returns the UUID of this node as recorded in this node's jcr:uuid property.
public  VersionHistorygetVersionHistory()
     Returns the VersionHistory object of this node.
public  PropertyIteratorgetWeakReferences()
     This method returns all WEAKREFERENCE properties that refer to this node and that are accessible through the current Session.
public  PropertyIteratorgetWeakReferences(String name)
     This method returns all WEAKREFERENCE properties that refer to this node, have the specified name and that are accessible through the current Session.

If the name parameter is null then all referring WEAKREFERENCE are returned regardless of name.

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).

public  booleanhasNode(String relPath)
     Indicates whether a node exists at relPath Returns true if a node accessible through the current Session exists at relPath and false otherwise.
Parameters:
  relPath - The path of a (possible) node.
public  booleanhasNodes()
     Indicates whether this node has child nodes.
public  booleanhasProperties()
     Indicates whether this node has properties.
public  booleanhasProperty(String relPath)
     Indicates whether a property exists at relPath Returns true if a property accessible through the current Session exists at relPath and false otherwise.
Parameters:
  relPath - The path of a (possible) property.
public  booleanholdsLock()
     Returns true if this node holds a lock; otherwise returns false.
public  booleanisCheckedOut()
     Returns true if this node is either
  • versionable (full or simple) and currently checked-out,
  • non-versionable and its nearest versionable ancestor is checked-out or
  • non-versionable and it has no versionable ancestor.
public  booleanisLocked()
     Returns true if this node is locked either as a result of a lock held by this node or by a deep lock on a node above this node; otherwise returns false.
public  booleanisNodeType(String nodeTypeName)
     Returns true if this node is of the specified primary node type or mixin type, or a subtype thereof.
public  Locklock(boolean isDeep, boolean isSessionScoped)
     Places a lock on this node.
public  NodeIteratormerge(String srcWorkspace, boolean bestEffort)
     Support for this method is only required under full versioning.

This method can be thought of as a version-sensitive update.

It recursively tests each versionable node in the subtree of this node against its corresponding node in srcWorkspace with respect to the relation between their respective base versions and either updates the node in question or not, depending on the outcome of the test.

A MergeException is thrown if bestEffort is false and a versionable node is encountered whose corresponding node's base version is on a divergent branch from this node's base version.

If successful, the changes are persisted immediately, there is no need to call save.

This method returns a NodeIterator over all versionable nodes in the subtree that received a merge result of fail.

public  NodeIteratormerge(String srcWorkspace, boolean bestEffort, boolean isShallow)
     Support for this method is only required under full versioning.

This method can be thought of as a version-sensitive update.

If isShallow is true, it tests this versionable node against its corresponding node in srcWorkspace with respect to the relation between their respective base versions and either updates the node in question or not, depending on the outcome of the test.

If isShallow is false, it recursively tests each versionable node in the subtree as mentioned above.

If isShallow is true and this node is not versionable, then this method returns and no changes are made.

A MergeException is thrown if bestEffort is false and a versionable node is encountered whose corresponding node's base version is on a divergent branch from this node's base version.

If successful, the changes are persisted immediately, there is no need to call save.

This method returns a NodeIterator over all versionable nodes in the subtree that received a merge result of fail.

public  voidorderBefore(String srcChildRelPath, String destChildRelPath)
     If this node supports child node ordering, this method inserts the child node at srcChildRelPath before its sibling, the child node at destChildRelPath, in the child node list.

To place the node srcChildRelPath at the end of the list, a destChildRelPath of null is used.

Note that (apart from the case where destChildRelPath is null) both of these arguments must be relative paths of depth one, in other words they are the names of the child nodes, possibly suffixed with an index.

If srcChildRelPath and destChildRelPath are the same, then no change is made.

Changes to ordering of child nodes are persisted on save of the parent node.

public  voidremoveHold(String holdID)
     Removes the specified holdID and the corresponding boolean flag from the jcr:hold and jcr:isDeep properties of this node, respectively.
public  voidremoveMixin(String mixinName)
     Removes the specified mixin node type from this node and removes mixinName from this node's jcr:mixinTypes property.
public  voidremoveRetentionPolicy()
     Causes the current retention policy on this node to no longer apply.
public  voidremoveShare()
     A special kind of remove() that removes this node, but does not remove any other node in the shared set of this node.

All of the exceptions defined for remove() apply to this function.

public  voidremoveSharedSet()
     A special kind of remove() that removes this node and every other node in the shared set of this node.
public  voidrestore(String versionName, boolean removeExisting)
     Restores this node to the state defined by the version with the specified versionName.

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.

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).

An InvalidItemStateException is thrown if this Session (not necessarily this Node) has pending unsaved changes.

A LockException is thrown if a lock prevents the addition of the mixin.

This method will work regardless of whether this node is checked-in or not.

An identifier collision occurs when a node exists outside the subtree rooted at this node with the same identifier as a node that would be introduced by the restore operation into the subtree at this node.

public  voidrestore(Version version, boolean removeExisting)
     Restores this node to the state defined by the specified version.

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.

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).

An InvalidItemStateException is thrown if this Session (not necessarily this Node) has pending unsaved changes.

A LockException is thrown if a lock prevents the restore.

This method will work regardless of whether this node is checked-in or not.

An identifier collision occurs when a node exists outside the subtree rooted at this node with the same identifier as a node that would be introduced by the restore operation into the subtree at this node.

public  voidrestore(Version version, String relPath, boolean removeExisting)
     Restores the specified version to relPath, relative to this node.

A node need not exist at relPath, though the parent of relPath must exist, otherwise a PathNotFoundException is thrown.

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.

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.

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.

public  voidrestoreByLabel(String versionLabel, boolean removeExisting)
     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.

A VersionException is thrown if the specified versionLabel does not exist in this node's version history.

An InvalidItemStateException is thrown if this Session (not necessarily this Node) has pending unsaved changes.

A LockException is thrown if a lock prevents the restore.

This method will work regardless of whether this node is checked-in or not.

An identifier collision occurs when a node exists outside the subtree rooted at this node with the same identifier as a node that would be introduced by the restoreByLabel operation into the subtree at this node.

public  voidsetHold(String holdID, boolean isDeep)
     Places a hold on this node and its properties (if isDeep is false) or this node and its subtree (if isDeep is true).

The supplied holdID is added to the jcr:hold multi-value property and the corresponding jcr:isDeep value is set accordingly.

public  voidsetPrimaryType(String nodeTypeName)
     Changes the primary node type of this node to nodeTypeName. Also immediately changes this node's jcr:primaryType property appropriately.
public  PropertysetProperty(String name, Value value)
     Sets the specified (single-value) property of this node to the specified value.
public  PropertysetProperty(String name, Value value, int type)
     Sets the specified (single-value) property to the specified value. If the property does not yet exist, it is created.

The type of the new property is determined by the type parameter specified.

If the property type of the supplied Value object is different from that required, then a best-effort conversion is attempted.

public  PropertysetProperty(String name, Value[] values)
     Sets the specified (multi-value) property to the specified array of values. If the property does not yet exist, it is created.
public  PropertysetProperty(String name, Value[] values, int type)
     Sets the specified (multi-value) property to the specified array of values. If the property does not yet exist, it is created.
public  PropertysetProperty(String name, String[] values)
     Sets the specified property to the specified array of values. Same as Node.setProperty(String name,Value[] values) except that the values are specified as String objects instead of Value objects.
Parameters:
  name - the name of the property to be set.
Parameters:
  values - an array of Value objects.
public  PropertysetProperty(String name, String[] values, int type)
     Sets the specified property to the specified array of values and to the specified type. Same as Node.setProperty(String name,Value[] values,int type) except that the values are specified as String objects instead of Value objects.
Parameters:
  name - the name of the property to be set.
Parameters:
  values - an array of Value objects.
Parameters:
  type - the type of the property.
public  PropertysetProperty(String name, String value)
     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).
public  PropertysetProperty(String name, String value, int type)
     Sets the specified (single-value) property to the specified value. If the property does not yet exist, it is created.

The type of the property is determined by the type parameter specified.

If the property type specified is not PropertyType.STRING, then a best-effort conversion is attempted.

public  PropertysetProperty(String name, InputStream value)
     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).
public  PropertysetProperty(String name, Binary value)
     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).
public  PropertysetProperty(String name, boolean value)
     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).
public  PropertysetProperty(String name, double value)
     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).
public  PropertysetProperty(String name, BigDecimal value)
     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).
public  PropertysetProperty(String name, long value)
     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).
public  PropertysetProperty(String name, Calendar value)
     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).
public  PropertysetProperty(String name, Node value)
     Sets the specified (REFERENCE)property to refer to the specified Node. 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).
public  voidsetRetentionPolicy(Node policy)
     Sets the retention policy of this node to that defined in the specified policy node.
public  voidunlock()
     Removes the lock on this node.
public  voidupdate(String srcWorkspace)
     If this node does have a corresponding node in the workspace srcWorkspace, then this replaces this node and its subtree with a clone of the corresponding node and its subtree.



Method Detail
addMixin
public void addMixin(String mixinName) throws NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, RepositoryException(Code)
Adds the specified mixin node type to this node and adds mixinName to this node's jcr:mixinTypes property. Semantically, the new node type may take effect immediately and must take effect on save. Whichever behavior is adopted it must be the same as the behavior adopted for Node.setPrimaryType and the behavior that occurs when a node is first created.

A ConstraintViolationException is thrown either immediately or on save if a conflict with another assigned mixin or the primary node type or for an implementation-specific reason. Implementations may differ on when this validation is done.

In some implementations it may only be possible to add mixin types before a a node is first saved, and not after. I such cases any later calls to addMixin will throw a ConstraintViolationException either immediately or on save.

A NoSuchNodeTypeException is thrown either immediately or on save if the specified mixinName is not recognized. Implementations may differ on when this validation is done.

A VersionException is thrown either immediately or on save if this node is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in. Implementations may differ on when this validation is done.

A LockException is thrown either immediately or on save if a lock prevents the addition of the mixin. Implementations may differ on when this validation is done.
Parameters:
  mixinName - the name of the mixin node type to be added
throws:
  NoSuchNodeTypeException - If the specified mixinNameis not recognized and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  ConstraintViolationException - If the specified mixin node typeis prevented from being assigned.
throws:
  VersionException - if this node is versionable and checked-in or is non-versionable but itsnearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting until save..
throws:
  LockException - if a lock prevents the addition of the mixin and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  RepositoryException - if another error occurs.




addNode
public Node addNode(String relPath) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, RepositoryException(Code)
Creates a new node at relPath. The new node will only be persisted on save() if it meets the constraint criteria of the parent node's node type.

In order to save a newly added node, save must be called either on the Session, or on the new node's parent or higher-order ancestor (grandparent, etc.). An attempt to call save only on the newly added node will throw a RepositoryException.

In the context of this method the relPath provided must not have an index on its final element. If it does then a RepositoryException is thrown.

Strictly speaking, the parameter is actually a relative path to the parent node of the node to be added, appended with the name desired for the new node (if the a node is being added directly below this node then only the name need be specified). It does not specify a position within the child node ordering. If ordering is supported by the node type of the parent node then the new node is appended to the end of the child node list.

Since this signature does not allow explicit node type assignment, the new node's primary node type will be determined (either immediately or on save, depending on the implementation) by the child node definitions in the node types of its parent.

An ItemExistsException will be thrown either immediately (by this method), or on save, if an item at the specified path already exists and same-name siblings are not allowed. Implementations may differ on when this validation is performed.

A PathNotFoundException will be thrown either immediately, or on save, if the specified path implies intermediary nodes that do not exist. Implementations may differ on when this validation is performed.

A ConstraintViolationException will be thrown either immediately or on save if adding the node would violate a node type or implementation-specific constraint 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.

A VersionException will be thrown either immediately or on save, if the node to which the new child is being added is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in. Implementations may differ on when this validation is performed.

A LockException will be thrown either immediately (by this method), or on save, if a lock prevents the addition of the node. Implementations may differ on when this validation is performed.
Parameters:
  relPath - The path of the new node to be created. The node that was added.
throws:
  ItemExistsException - if an item at the specified path already exists,same-name siblings are not allowed and this implementation performs thisvalidation immediately instead of waiting until save.
throws:
  PathNotFoundException - if the specified path implies intermediaryNodes that do not exist or the last element ofrelPath has an index, and this implementation performs thisvalidation immediately instead of waiting until save.
throws:
  ConstraintViolationException - if a node type or implementation-specific constraintis violated or if an attempt is made to add a node as the child of a property and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  VersionException - if the node to which the new child is being added is versionable andchecked-in or is non-versionable but its nearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  LockException - if a lock prevents the addition of the node and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  RepositoryException - If the last element of relPath has an index or if another error occurs.




addNode
public Node addNode(String relPath, String primaryNodeTypeName) throws ItemExistsException, PathNotFoundException, NoSuchNodeTypeException, LockException, VersionException, ConstraintViolationException, RepositoryException(Code)
Creates a new node at relPath of the specified node type. The same as Node.addNode(String relPath) except that the primary node type of the new node is explictly specified.

An ItemExistsException will be thrown either immediately (by this method), or on save, if an item at the specified path already exists and same-name siblings are not allowed. Implementations may differ on when this validation is performed.

A PathNotFoundException will be thrown either immediately, or on save, if the specified path implies intermediary nodes that do not exist. Implementations may differ on when this validation is performed.

A NoSuchNodeTypeException will be thrown either immediately or on save, if the specified node type is not recognized. Implementations may differ on when this validation is performed.

A ConstraintViolationException will be thrown either immediately or on save if adding the node would violate a node type or implementation-specific constraint 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.

A VersionException will be thrown either immediately or on save, if the node to which the new child is being added is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in. Implementations may differ on when this validation is performed.

A LockException will be thrown either immediately (by this method), or on save, if a lock prevents the addition of the node. Implementations may differ on when this validation is performed.
Parameters:
  relPath - the path of the new node to be created.
Parameters:
  primaryNodeTypeName - The name of the primary node type of the new node. the node that was added.
throws:
  ItemExistsException - if an item at the specified path already exists,same-name siblings are not allowed and this implementation performs thisvalidation immediately instead of waiting until save.
throws:
  PathNotFoundException - if the specified path implies intermediaryNodes that do not exist or the last element ofrelPath has an index, and this implementation performs thisvalidation immediately instead of waiting until save.
throws:
  NoSuchNodeTypeException - if the specified node type is not recognized and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  ConstraintViolationException - if a node type or implementation-specific constraintis violated or if an attempt is made to add a node as the child of a property and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  VersionException - if the node to which the new child is being added is versionable andchecked-in or is non-versionable but its nearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  LockException - if a lock prevents the addition of the node and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  RepositoryException - if the last element of relPath has an index or ifanother error occurs.




canAddMixin
public boolean canAddMixin(String mixinName) throws NoSuchNodeTypeException, RepositoryException(Code)
Returns true if the specified mixin node type, mixinName, can be added to this node. Returns false otherwise. A result of false must be returned in each of the following cases:
  • The mixin's definition conflicts with an existing primary or mixin node type of this node.
  • This node is versionable and checked-in or is non-versionable and its nearest versionable ancestor is checked-in.
  • This node is protected (as defined in this node's NodeDefinition, found in the node type of this node's parent).
  • An access control restriction would prevent the addition of the mixin.
  • A lock would prevent the addition of the mixin.
  • An implementation-specific restriction would prevent the addition of the mixin.
A NoSuchNodeTypeException is thrown if the specified mixin node type name is not recognized.
Parameters:
  mixinName - The name of the mixin to be tested. true if the specified mixin node type,mixinName, can be added to this node; false otherwise.
throws:
  NoSuchNodeTypeException - if the specified mixin node type name is not recognized.
throws:
  RepositoryException - if another error occurs.



cancelMerge
public void cancelMerge(Version version) throws VersionException, InvalidItemStateException, UnsupportedRepositoryOperationException, RepositoryException(Code)
Support for this method is only required under full versioning.

Cancels the merge process with respect to this node and specified version.

See Node.doneMerge for a full explanation. Also see Node.merge for more details.

If successful, these changes are persisted immediately, there is no need to call save.

A VersionException is thrown if the version specified is not among those referenced in this node's jcr:mergeFailed property or if this node is currently checked-in.

An UnsupportedRepositoryOperationException is thrown if this nod is not versionable.

If there are unsaved changes pending on this node, an InvalidItemStateException is thrown.

A RepositoryException is thrown if another error occurs.
Parameters:
  version - a version referred to by this node's jcr:mergeFailed property.
throws:
  VersionException - if the version specified is not among those referenced in this node's jcr:mergeFailed or if this node is currently checked-in.
throws:
  InvalidItemStateException - if there are unsaved changes pending on this node.
throws:
  UnsupportedRepositoryOperationException - if this node is not versionable.
throws:
  RepositoryException - if another error occurs.




checkin
public Version checkin() throws VersionException, UnsupportedRepositoryOperationException, InvalidItemStateException, LockException, RepositoryException(Code)
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 and its connected non-versionable subtree become read-only. A node's connected non-versionable subtree is the set of non-versionable descendant nodes reachable from that node through child links without encountering any versionable nodes. In other words, the read-only status flows down from the checked-in node along every child link until either a versionable node is encountered or an item with no children is encountered. In a system that supports only simple versioning the connected non-versionable subtree will be equivalent to the whole subtree, since simple-versionable nodes cannot have simple-versionable descendents.

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 Node.restore (all signatures), Node.restoreByLabel , Workspace.restore , Node.merge and Node.update 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).

If this node is already checked-in, this method has no effect but returns the current base version of this node.

If this node is not versionable, an UnsupportedRepositoryOperationException is thrown.

A VersionException is thrown or if a child item of this node has an OnParentVersion status of ABORT. This includes the case where an unresolved merge failure exists on this node, as indicated by the presence of the jcr:mergeFailed property.

If there are unsaved changes pending on this node, an InvalidItemStateException is thrown.

Throws a LockException if a lock prevents the operation.

If checkin succeeds, the change to the jcr:isCheckedOut property is automatically persisted (there is no need to do an additional save).

a Version object
throws:
  VersionException - if jcr:predecessors does not contain at least one value or ifa child item of this node has an OnParentVersion status of ABORT.This includes the case where an unresolved merge failure exists on this node, as indicatedby the presence of a jcr:mergeFailed property.
throws:
  UnsupportedRepositoryOperationException - If this node is not versionable.
throws:
  InvalidItemStateException - If unsaved changes exist on this node.
throws:
  LockException - if a lock prevents the operation.
throws:
  RepositoryException - If another error occurs.




checkout
public void checkout() throws UnsupportedRepositoryOperationException, LockException, RepositoryException(Code)
Sets this versionable node to checked-out status by setting its jcr:isCheckedOut property to true. Under full versioning it also sets the jcr:predecessors property to be 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 and its connected non-versionable subtree no longer read-only (see Node.checkin() for an explanation of the term "connected non-versionable subtree". Under simple versioning this will simply be the whole subtree).

If successful, these changes are persisted immediately, there is no need to call save.

If this node is already checked-out, this method has no effect.

If this node is not versionable, an UnsupportedRepositoryOperationException is thrown.

Throws a LockException if a lock prevents the checkout.
throws:
  UnsupportedRepositoryOperationException - If this node is not versionable.
throws:
  LockException - if a lock prevents the checkout.
throws:
  RepositoryException - If another error occurs.




checkpoint
public void checkpoint() throws VersionException, UnsupportedRepositoryOperationException, InvalidItemStateException, LockException, RepositoryException(Code)
Performs a checkin() followed by a checkout().

If this node is already checked-in, this method is equivalent to checkout().

If this node is not versionable, an UnsupportedRepositoryOperationException is thrown.

A VersionException is thrown if a child item of this node has an OnParentVersion of ABORT. This includes the case where an unresolved merge failure exists on this node, as indicated by the presence of the jcr:mergeFailed property.

If there are unsaved changes pending on this node, an InvalidItemStateException is thrown.

A LockException is thrown if a lock prevents the operation.

A RepositoryException is thrown if another error occurs.
throws:
  VersionException - if a child item of this node has anOnParentVersion of ABORT. This includes the casewhere an unresolved merge failure exists on this node, as indicated bythe presence of the jcr:mergeFailed.
throws:
  UnsupportedRepositoryOperationException - if this node is not versionable.
throws:
  InvalidItemStateException - if there are unsaved changes pending on this node.
throws:
  LockException - if a lock prevents the operation.
throws:
  RepositoryException - if another error occurs.
since:
   JCR 2.0




createConfiguration
public Node createConfiguration(Version baseline) throws UnsupportedRepositoryOperationException, RepositoryException(Code)
Calling createConfiguration on a node N creates, in the configuration storage, a new nt:configuration node whose root is N. A reference to N is recorded in the jcr:root property of the new configuration, and a reference to the new configuration is recorded in the jcr:configuration property of N.

If the specified baseline is null, a new version history is created to store baselines of the new configuration, and the jcr:baseVersion of the new configuration references the root of the new version history. If the specified baseline is not null, the jcr:baseVersion of the new configuration references the specified baseline.

The changes are persisted immediately, a save is not required.

An UnsupportedRepositoryOperationException is thrown if N is not versionable.

A RepositoryException is thrown if another error occurs.
Parameters:
  baseline - a Version a new nt:configuration node
throws:
  UnsupportedRepositoryOperationException - if N is not versionable.
throws:
  RepositoryException - if another error occurs.
since:
   JCR 2.0




doneMerge
public void doneMerge(Version version) throws VersionException, InvalidItemStateException, UnsupportedRepositoryOperationException, RepositoryException(Code)
Support for this method is only required under full versioning.

Completes the merge process with respect to this node and the specified version.

When the Node.merge method is called on a node, every versionable node in that subtree is compared with its corresponding node in the indicated other workspace and a "merge test result" is determined indicating one of the following:

  1. This node will be updated to the state of its correspondee (if the base version of the correspondee is more recent in terms of version history)
  2. This node will be left alone (if this node's base version is more recent in terms of version history).
  3. This node will be marked as having failed the merge test (if this node's base version is on a different branch of the version history from the base version of its corresponding node in the other workspace, thus preventing an automatic determination of which is more recent).
(See Node.merge for more details)

In the last case the merge of the non-versionable subtree (the "content") of this node must be done by the application (for example, by providing a merge tool for the user).

Additionally, once the content of the nodes has been merged, their version graph branches must also be merged. The JCR versioning system provides for this by keeping a record, for each versionable node that fails the merge test, of the base verison of the corresponding node that caused the merge failure. This record is kept in the jcr:mergeFailed property of this node. After a merge, this property will contain one or more (if multiple merges have been performed) REFERENCEs that point to the "offending versions".

To complete the merge process, the client calls doneMerge(Version v) passing the version object referred to be the jcr:mergeFailed property that the client wishes to connect to this node in the version graph. This has the effect of moving the reference to the indicated version from the jcr:mergeFailed property of this node to the jcr:predecessors.

If the client chooses not to connect this node to a particular version referenced in the jcr:mergeFailed property, he calls Node.cancelMerge(Version version) . This has the effect of removing the reference to the specified version from jcr:mergeFailed without adding it to jcr:predecessors.

Once the last reference in jcr:mergeFailed has been either moved to jcr:predecessors (with doneMerge) or just removed from jcr:mergeFailed (with cancelMerge) the jcr:mergeFailed property is automatically removed, thus enabling this node to be checked-in, creating a new version (note that before the jcr:mergeFailed is removed, its OnParentVersion setting of ABORT prevents checkin). This new version will have a predecessor connection to each version for which doneMerge was called, thus joining those branches of the version graph.

If successful, these changes are persisted immediately, there is no need to call save.

A VersionException is thrown if the version specified is not among those referecned in this node's jcr:mergeFailed property.

If there are unsaved changes pending on this node, an InvalidItemStateException is thrown.

An UnsupportedRepositoryOperationException is thrown if this node is not versionable.

A RepositoryException is thrown if another error occurs.
Parameters:
  version - a version referred to by this node's jcr:mergeFailed property.
throws:
  VersionException - if the version specifed is not among those referenced in this node's jcr:mergeFailed or if this node is currently checked-in.
throws:
  InvalidItemStateException - if there are unsaved changes pending on this node.
throws:
  UnsupportedRepositoryOperationException - if this node is not versionable.
throws:
  RepositoryException - if another error occurs.




followLifecycleTransition
public void followLifecycleTransition(String transition) throws UnsupportedRepositoryOperationException, InvalidLifecycleTransitionException, RepositoryException(Code)
Causes the lifecycle state of this node to undergo the specified transition.

This method may change the value of the jcr:currentLifecycleState property, in most cases it is expected that the implementation will change the value to that of the passed transition parameter, though this is an implementation-specific issue. If the jcr:currentLifecycleState property is changed the change is persisted immediately, there is no need to call save.

Throws an UnsupportedRepositoryOperationException if this implementation does not support lifecycle actions or if this node does not have the mix:lifecycle mixin.

Throws InvalidLifecycleTransitionException if the lifecycle transition is not successful.
Parameters:
  transition - a state transition
throws:
  UnsupportedRepositoryOperationException - if this implementation doesnot support lifecycle actions or if this node does not have themix:lifecycle mixin.
throws:
  InvalidLifecycleTransitionException - if the lifecycle transition is not successful.
throws:
  RepositoryException - if another error occurs.
since:
   JCR 2.0




getAllowedLifecycleTransistions
public String[] getAllowedLifecycleTransistions() throws UnsupportedRepositoryOperationException, RepositoryException(Code)
Returns the list of valid state transitions for this node. a String array.
throws:
  UnsupportedRepositoryOperationException - if this implementation doesnot support lifecycle actions or if this node does not have themix:lifecycle mixin.
throws:
  RepositoryException - if another error occurs.
since:
   JCR 2.0



getBaseVersion
public Version getBaseVersion() throws UnsupportedRepositoryOperationException, RepositoryException(Code)
Returns the current base version of this versionable node.

If this node is not versionable, an UnsupportedRepositoryOperationException is thrown. a Version object.
throws:
  UnsupportedRepositoryOperationException - if this node is not versionable.
throws:
  RepositoryException - If another error occurs.




getCorrespondingNodePath
public String getCorrespondingNodePath(String workspaceName) throws ItemNotFoundException, NoSuchWorkspaceException, AccessDeniedException, RepositoryException(Code)
Returns the absolute path of the node in the specified workspace that corresponds to this node.

If no corresponding node exists then an ItemNotFoundException is thrown.

If the specified workspace does not exist then a NoSuchWorkspaceException is thrown.

If the current Session does not have sufficent rights to perform this operation, an AccessDeniedException is thrown.
Parameters:
  workspaceName - the name of the workspace. the absolute path to the corresponding node.
throws:
  ItemNotFoundException - if no corresponding node is found.
throws:
  NoSuchWorkspaceException - if the workspace is unknown.
throws:
  AccessDeniedException - if the current session has insufficent rights to perform this operation.
throws:
  RepositoryException - if another error occurs.




getDefinition
public NodeDefinition getDefinition() throws RepositoryException(Code)
Returns the node definition that applies to this node. In some cases there may appear to be more than one definition that could apply to this node. However, it is assumed that upon creation of this node, a single particular definition was used and it is that definition that this method returns. How this governing definition is selected upon node creation from among others which may have been applicable is an implementation issue and is not covered by this specification. The NodeDefinition returned when this method is called on the root node of a workspace is also up to the implementation. a NodeDefinition object.
throws:
  RepositoryException - if an error occurs.
See Also:   NodeType.getChildNodeDefinitions



getIdentifier
public String getIdentifier() throws RepositoryException(Code)
Returns the identifier of this node. Applies to both referenceable and non-referenceable nodes.

A RepositoryException is thrown if an error occurs. the identifier of this node
throws:
  RepositoryException - If an error occurs.
since:
   JCR 2.0




getIndex
public int getIndex() throws RepositoryException(Code)
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. The index of this node within the ordered set of its same-name sibling nodes.
throws:
  RepositoryException - if an error occurs.



getLock
public Lock getLock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException(Code)
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.

If the current session 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).

If this node is not locked (no lock applies to this node), a LockException is thrown.

If the current session does not have sufficient privileges to get the lock, an AccessDeniedException is thrown.

An UnsupportedRepositoryOperationException is thrown if this implementation does not support locking.

A RepositoryException is thrown if another error occurs. The applicable Lock object, without a contained lock token.
throws:
  UnsupportedRepositoryOperationException - if this implementation does not support locking.
throws:
  LockException - if no lock applies to this node.
throws:
  AccessDeniedException - if the curent session does not have pernmission to get the lock.
throws:
  RepositoryException - if another error occurs.




getMixinNodeTypes
public NodeType[] getMixinNodeTypes() throws RepositoryException(Code)
Returns an array of NodeType objects representing the mixin node types in effect for this node. This includes only those mixin types explicitly assigned to this node. It does not include mixin types inherited through the addition of supertypes to the primary type hierarchy or through the addition of supertypes to the type hierarchy of any of the declared mixin types. Note that this may differ from the node types implied by the node's jcr:mixinTypes property if that property has recently been created or changed and has not yet been saved. an array of NodeType objects.
throws:
  RepositoryException - if an error occurs



getNode
public Node getNode(String relPath) throws PathNotFoundException, RepositoryException(Code)
Returns the node at relPath relative to this node.

If relPath contains a path element that refers to a node with same-name sibling nodes without explicitly including an index using the array-style notation ([x]), then the index [1] is assumed (indexing of same name siblings begins at 1, not 0, in order to preserve compatibility with XPath).

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. Whether this object is actually the same Node instance, or simply one wrapping the same state, is up to the implementation.

If no node exists at relPath a PathNotFoundException is thrown. This exception is also thrown if the current Session does not have read access to the specified node.
Parameters:
  relPath - The relative path of the node to retrieve. The node at relPath.
throws:
  PathNotFoundException - If no node exists at the specified path or the current Session doesnot read access to the node at the specified path.
throws:
  RepositoryException - If another error occurs.




getNodes
public NodeIterator getNodes() throws RepositoryException(Code)
Returns all child nodes of this node accessible through the current Session. Does not include properties of this Node. The same reacquisition semantics apply as with Node.getNode(String) . If this node has no accessible child nodes, then an empty iterator is returned. A NodeIterator over all child Nodes ofthis Node.
throws:
  RepositoryException - If an error occurs.



getNodes
public NodeIterator getNodes(String namePattern) throws RepositoryException(Code)
Gets all child nodes of this node accessible through the current Session 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,

N.getNodes("jcr:* | myapp:report | my doc")

would return a NodeIterator holding all accessible child nodes of N that are either called 'myapp:report', begin with the prefix 'jcr:' or are called 'my doc'.

Note that leading and trailing whitespace around a disjunct is ignored, but whitespace within a disjunct forms part of the pattern to be matched.

The EBNF for namePattern is:

namePattern ::= disjunct {'|' disjunct}
disjunct ::= name [':' name]
name ::= '*' | ['*'] fragment {'*' fragment} ['*']
fragment ::= char {char}
char ::= nonspace | ' '
nonspace ::= Any XML Char (See http://www.w3.org/TR/REC-xml/) except: '/', ':', '[', ']', '*', ''', '"', '|' or any whitespace character

The pattern is matched against the names (not the paths) of the immediate child nodes of this node.

If this node has no accessible matching child nodes, then an empty iterator is returned.

The same reacquisition semantics apply as with Node.getNode(String) .
Parameters:
  namePattern - a name pattern a NodeIterator
throws:
  RepositoryException - If an unexpected error occurs.




getPrimaryItem
public Item getPrimaryItem() throws ItemNotFoundException, RepositoryException(Code)
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.

In cases where the primary child item specifies the name of a set same-name sibling child nodes, the node returned will be the one among the same-name siblings with index [1].

The same reacquisition semantics apply as with Node.getNode(String) .

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, or not accessible through the current Session, then this method throws an ItemNotFoundException. the primary child item.
throws:
  ItemNotFoundException - if this node does not have a primarychild item, either because none is declared in the node type orbecause a declared primary item is not present on this node instance,or not accessible through the current Session
throws:
  RepositoryException - if another error occurs.




getPrimaryNodeType
public NodeType getPrimaryNodeType() throws RepositoryException(Code)
Returns the primary node type in effect for this node. Note that this may differ from the node type implied by the node's jcr:primaryType property if that property has recently been created or changed and has not yet been saved. Which NodeType is returned when this method is called on the root node of a workspace is up to the implementation, though the returned type must, of course, be consistent with the child nodes and properties of the root node. a NodeType object.
throws:
  RepositoryException - if an error occurs



getProperties
public PropertyIterator getProperties() throws RepositoryException(Code)
Returns all properties of this node accessible through the current Session. Does not include child nodes of this node. The same reacquisition semantics apply as with Node.getNode(String) . If this node has no accessible properties, then an empty iterator is returned. A PropertyIterator.
throws:
  RepositoryException - If an error occurs.



getProperties
public PropertyIterator getProperties(String namePattern) throws RepositoryException(Code)
Gets all properties of this node accessible through the current Session 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,

N.getProperties("jcr:* | myapp:name | my doc")

would return a PropertyIterator holding all accessible properties of N that are either called 'myapp:name', begin with the prefix 'jcr:' or are called 'my doc'.

Note that leading and trailing whitespace around a disjunct is ignored, but whitespace within a disjunct forms part of the pattern to be matched.

The EBNF for namePattern is:

namePattern ::= disjunct {'|' disjunct}
disjunct ::= name [':' name]
name ::= '*' | ['*'] fragment {'*' fragment} ['*']
fragment ::= char {char}
char ::= nonspace | ' '
nonspace ::= Any XML Char (See http://www.w3.org/TR/REC-xml/) except: '/', ':', '[', ']', '*', ''', '"', '|' or any whitespace character

The pattern is matched against the names (not the paths) of the immediate child properties of this node.

If this node has no accessible matching properties, then an empty iterator is returned.

The same reacquisition semantics apply as with Node.getNode(String) .
Parameters:
  namePattern - a name pattern a PropertyIterator
throws:
  RepositoryException - If an unexpected error occurs.




getProperty
public Property getProperty(String relPath) throws PathNotFoundException, RepositoryException(Code)
Returns the property at relPath relative to this node. The same reacquisition semantics apply as with Node.getNode(String) . If no property exists at relPath a PathNotFoundException is thrown. This exception is also thrown if the current Session does not have read access to the specified property.
Parameters:
  relPath - The relative path of the property to retrieve. The property at relPath.
throws:
  PathNotFoundException - If no property exists at thespecified path.
throws:
  RepositoryException - If another error occurs.



getReferences
public PropertyIterator getReferences() throws RepositoryException(Code)
This method returns all REFERENCE properties that refer to this node and that are accessible through the current Session. Equivalent to Node.getReferences(null). A PropertyIterator.
throws:
  RepositoryException - if an error occurs
See Also:   Node.getReferences(String)



getReferences
public PropertyIterator getReferences(String name) throws RepositoryException(Code)
This method returns all REFERENCE properties that refer to this node, have the specified name and that are accessible through the current Session.

If the name parameter is null then all referring REFERENCES are returned regardless of name.

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.

In implementations that support versioning, this method does not return properties that are part of the frozen state of a version in version storage.

If this node has no referring properties with the specified name, an empty iterator is returned.
Parameters:
  name - name of referring REFERENCE properties to bereturned; if null then all referring REFERENCEsare returned A PropertyIterator.
throws:
  RepositoryException - if an error occurs
since:
   JCR 2.0




getSharedSet
public NodeIterator getSharedSet() throws RepositoryException(Code)
Returns an iterator over all nodes that are in the shared set of this node. If this node is not shared then the returned iterator contains only this node. a NodeIterator
throws:
  RepositoryException - if an error occurs.
since:
   JCR 2.0



getUUID
public String getUUID() throws UnsupportedRepositoryOperationException, RepositoryException(Code)
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 Node.isNodeType(String) isNodeType("mix:referenceable") can be made. Node.getIdentifier() the UUID of this node
throws:
  UnsupportedRepositoryOperationException - If this node nonreferenceable.
throws:
  RepositoryException - If another error occurs.




getVersionHistory
public VersionHistory getVersionHistory() throws UnsupportedRepositoryOperationException, RepositoryException(Code)
Returns the VersionHistory object of this node. This object provides access to the nt:versionHistory node holding this node's versions.

If this node is not versionable, an UnsupportedRepositoryOperationException is thrown. a VersionHistory object
throws:
  UnsupportedRepositoryOperationException - if this node is not versionable.
throws:
  RepositoryException - If another error occurs.




getWeakReferences
public PropertyIterator getWeakReferences() throws RepositoryException(Code)
This method returns all WEAKREFERENCE properties that refer to this node and that are accessible through the current Session. Equivalent to Node.getWeakReferences(null). A PropertyIterator.
throws:
  RepositoryException - if an error occurs
since:
   JCR 2.0
See Also:   Node.getWeakReferences(String)



getWeakReferences
public PropertyIterator getWeakReferences(String name) throws RepositoryException(Code)
This method returns all WEAKREFERENCE properties that refer to this node, have the specified name and that are accessible through the current Session.

If the name parameter is null then all referring WEAKREFERENCE are returned regardless of name.

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.

In implementations that support versioning, this method does not return properties that are part of the frozen state of a version in version storage.

If this node has no referring properties with the specified name, an empty iterator is returned.
Parameters:
  name - name of referring WEAKREFERENCE properties to bereturned; if null then all referring WEAKREFERENCEsare returned A PropertyIterator.
throws:
  RepositoryException - if an error occurs
since:
   JCR 2.0




hasNode
public boolean hasNode(String relPath) throws RepositoryException(Code)
Indicates whether a node exists at relPath Returns true if a node accessible through the current Session exists at relPath and false otherwise.
Parameters:
  relPath - The path of a (possible) node. true if a node exists at relPath;false otherwise.
throws:
  RepositoryException - If an unspecified error occurs.



hasNodes
public boolean hasNodes() throws RepositoryException(Code)
Indicates whether this node has child nodes. Returns true if this node has one or more child nodes accessible through the current Session; false otherwise. true if this node has one or more child nodes;false otherwise.
throws:
  RepositoryException - If an unspecified error occurs.



hasProperties
public boolean hasProperties() throws RepositoryException(Code)
Indicates whether this node has properties. Returns true if this node has one or more properties accessible through the current Session; false otherwise. true if this node has one or more properties;false otherwise.
throws:
  RepositoryException - If an unspecified error occurs.



hasProperty
public boolean hasProperty(String relPath) throws RepositoryException(Code)
Indicates whether a property exists at relPath Returns true if a property accessible through the current Session exists at relPath and false otherwise.
Parameters:
  relPath - The path of a (possible) property. true if a property exists at relPath;false otherwise.
throws:
  RepositoryException - If an unspecified error occurs.



holdsLock
public boolean holdsLock() throws RepositoryException(Code)
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. a boolean.
throws:
  RepositoryException - if an error occurs.



isCheckedOut
public boolean isCheckedOut() throws RepositoryException(Code)
Returns true if this node is either
  • versionable (full or simple) and currently checked-out,
  • non-versionable and its nearest versionable ancestor is checked-out or
  • non-versionable and it has no versionable ancestor.
Returns false if this node is either
  • versionable (full or simple) and currently checked-in or
  • non-versionable and its nearest versionable ancestor is checked-in.
a boolean
throws:
  RepositoryException - If another error occurs.



isLocked
public boolean isLocked() throws RepositoryException(Code)
Returns true if this node is locked either as a result of a lock held by this node or by a deep lock on a node above this node; otherwise returns false. a boolean.
throws:
  RepositoryException - if an error occurs.



isNodeType
public boolean isNodeType(String nodeTypeName) throws RepositoryException(Code)
Returns true if this node is of the specified primary node type or mixin type, or a subtype thereof. Returns false otherwise.

This method respects the effective node type of the node. Note that this may differ from the node type implied by the node's jcr:primaryType property or jcr:mixinTypes property if that property has recently been created or changed and has not yet been saved.
Parameters:
  nodeTypeName - the name of a node type. true If this node is of the specified primary node typeor mixin type, or a subtype thereof. Returns false otherwise.
throws:
  RepositoryException - If an error occurs.




lock
public Lock lock(boolean isDeep, boolean isSessionScoped) throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryException(Code)
Places a lock on this node. If successful, this node is said to hold the lock.

If isDeep is true then the lock applies to this node and all its descendant nodes; if false, the lock applies only to this, the holding node.

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 or automatically unlocked due to a implementation-specific limitation, such as a timeout.

Returns a Lock object reflecting the state of the new lock.

If the lock is open-scoped the returned lock will include a lock token.

The lock token is also automatically added to the set of lock tokens held by the current Session.

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.

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).

If this node is not of mixin node type mix:lockable then an LockException is thrown.

If this node is already locked (either because it holds a lock or a lock above it applies to it), a LockException is thrown.

If isDeep is true and a descendant node of this node already holds a lock, then a LockException is thrown.

If this node does not have a persistent state (has never been saved or otherwise persisted), a LockException is thrown.

If the current session does not have sufficient privileges to place the lock, an AccessDeniedException is thrown.

An UnsupportedRepositoryOperationException is thrown if this implementation does not support locking.

An InvalidItemStateException is thrown if this node has pending unsaved changes.

A RepositoryException is thrown if another error occurs.
Parameters:
  isDeep - if true this lock will apply to this node and all its descendants; iffalse, it applies only to this node.
Parameters:
  isSessionScoped - if true, this lock expires with the current session; if false itexpires when explicitly or automatically unlocked for some other reason. A Lock object containing a lock token.
throws:
  UnsupportedRepositoryOperationException - if this implementation does not support locking.
throws:
  LockException - if this node is not mix:lockable or this node is already locked orisDeep is true and a descendant node of this node already holds a lock.
throws:
  AccessDeniedException - if this session does not have permission to lock this node.
throws:
  InvalidItemStateException - if this node has pending unsaved changes.
throws:
  RepositoryException - if another error occurs.




merge
public NodeIterator merge(String srcWorkspace, boolean bestEffort) throws NoSuchWorkspaceException, AccessDeniedException, MergeException, LockException, InvalidItemStateException, RepositoryException(Code)
Support for this method is only required under full versioning.

This method can be thought of as a version-sensitive update.

It recursively tests each versionable node in the subtree of this node against its corresponding node in srcWorkspace with respect to the relation between their respective base versions and either updates the node in question or not, depending on the outcome of the test.

A MergeException is thrown if bestEffort is false and a versionable node is encountered whose corresponding node's base version is on a divergent branch from this node's base version.

If successful, the changes are persisted immediately, there is no need to call save.

This method returns a NodeIterator over all versionable nodes in the subtree that received a merge result of fail. If bestEffort is false, this iterator will be empty (since if merge returns successfully, instead of throwing an exception, it will be because no failures were encountered). If bestEffort is true, this iterator will contain all nodes that received a fail during the course of this merge operation.

If the specified srcWorkspace does not exist, a NoSuchWorkspaceException is thrown.

If the current session does not have sufficient permissions to perform the operation, then an AccessDeniedException is thrown.

An InvalidItemStateException is thrown if this session (not necessarily this Node) has pending unsaved changes.

A LockException is thrown if a lock prevents the merge.
Parameters:
  srcWorkspace - the name of the source workspace.
Parameters:
  bestEffort - a boolean iterator over all nodes that received a merge result of "fail" in the courseof this operation.
throws:
  MergeException - if bestEffort is false and a failed mergeresult is encountered.
throws:
  InvalidItemStateException - if this session (not necessarily thisnode) has pending unsaved changes.
throws:
  NoSuchWorkspaceException - if the specified srcWorkspace does not exist.
throws:
  AccessDeniedException - if the current session does not have sufficientrights to perform the operation.
throws:
  LockException - if a lock prevents the merge.
throws:
  RepositoryException - if another error occurs.




merge
public NodeIterator merge(String srcWorkspace, boolean bestEffort, boolean isShallow) throws NoSuchWorkspaceException, AccessDeniedException, MergeException, LockException, InvalidItemStateException, RepositoryException(Code)
Support for this method is only required under full versioning.

This method can be thought of as a version-sensitive update.

If isShallow is true, it tests this versionable node against its corresponding node in srcWorkspace with respect to the relation between their respective base versions and either updates the node in question or not, depending on the outcome of the test.

If isShallow is false, it recursively tests each versionable node in the subtree as mentioned above.

If isShallow is true and this node is not versionable, then this method returns and no changes are made.

A MergeException is thrown if bestEffort is false and a versionable node is encountered whose corresponding node's base version is on a divergent branch from this node's base version.

If successful, the changes are persisted immediately, there is no need to call save.

This method returns a NodeIterator over all versionable nodes in the subtree that received a merge result of fail. If bestEffort is false, this iterator will be empty (since if merge returns successfully, instead of throwing an exception, it will be because no failures were encountered). If bestEffort is true, this iterator will contain all nodes that received a fail during the course of this merge operation.

If the specified srcWorkspace does not exist, a NoSuchWorkspaceException is thrown.

If the current session does not have sufficient permissions to perform the operation, then an AccessDeniedException is thrown.

An InvalidItemStateException is thrown if this session (not necessarily this node) has pending unsaved changes.

A LockException is thrown if a lock prevents the merge.
Parameters:
  srcWorkspace - the name of the source workspace.
Parameters:
  bestEffort - a boolean
Parameters:
  isShallow - a boolean iterator over all nodes that received a merge result of "fail" in the courseof this operation.
throws:
  MergeException - if bestEffort is false and a failed mergeresult is encountered.
throws:
  InvalidItemStateException - if this session (not necessarily thisnode) has pending unsaved changes.
throws:
  NoSuchWorkspaceException - if srcWorkspace does not exist.
throws:
  AccessDeniedException - if the current session does not have sufficientrights to perform the operation.
throws:
  LockException - if a lock prevents the merge.
throws:
  RepositoryException - if another error occurs.
since:
   JCR 2.0




orderBefore
public void orderBefore(String srcChildRelPath, String destChildRelPath) throws UnsupportedRepositoryOperationException, VersionException, ConstraintViolationException, ItemNotFoundException, LockException, RepositoryException(Code)
If this node supports child node ordering, this method inserts the child node at srcChildRelPath before its sibling, the child node at destChildRelPath, in the child node list.

To place the node srcChildRelPath at the end of the list, a destChildRelPath of null is used.

Note that (apart from the case where destChildRelPath is null) both of these arguments must be relative paths of depth one, in other words they are the names of the child nodes, possibly suffixed with an index.

If srcChildRelPath and destChildRelPath are the same, then no change is made.

Changes to ordering of child nodes are persisted on save of the parent node. But, if this node does not support child node ordering, then a UnsupportedRepositoryOperationException thrown.

If srcChildRelPath is not the relative path to a child node of this node then an ItemNotFoundException is thrown.

If destChildRelPath is neither the relative path to a child node of this node nor null, then an ItemNotFoundException is also thrown.

A ConstraintViolationException will be thrown either immediately or on save if this operation would violate a node type or implementation-specific constraint. Implementations may differ on when this validation is performed.

A VersionException will be thrown either immediately or on save, if this node is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in. Implementations may differ on when this validation is performed.

A LockException will be thrown either immediately (by this method), or on save, if a lock prevents the re-ordering. Implementations may differ on when this validation is performed.
Parameters:
  srcChildRelPath - the relative path to the child node (that is, name plus possible index)to be moved in the ordering
Parameters:
  destChildRelPath - the the relative path to the child node (that is, name plus possible index)before which the node srcChildRelPath will be placed.
throws:
  UnsupportedRepositoryOperationException - if ordering is not supported.
throws:
  ConstraintViolationException - if an implementation-specific ordering restriction is violatedand this implementation performs this validation immediately instead of waiting until save.
throws:
  ItemNotFoundException - if either parameter is not the relative path of a child node of this node.
throws:
  VersionException - if this node is versionable and checked-in or is non-versionable but itsnearest versionable ancestor is checked-in and this implementation performs this validation immediately insteadof waiting until save..
throws:
  LockException - if a lock prevents the re-ordering and this implementation performs this validationimmediately instead of waiting until save..
throws:
  RepositoryException - if another error occurs.




removeHold
public void removeHold(String holdID) throws UnsupportedRepositoryOperationException, RepositoryException(Code)
Removes the specified holdID and the corresponding boolean flag from the jcr:hold and jcr:isDeep properties of this node, respectively.

If this is the last holdID in the property then the hold on this node is lifted.

An UnsupportedRepositoryOperationException is thrown if this node is not of type mix:managedRetention.

A RepositoryException is thrown if another error occurs.
Parameters:
  holdID - a string
throws:
  UnsupportedRepositoryOperationException - if this node is not oftype mix:managedRetention.
throws:
  RepositoryException - if another error occurs.
since:
   JCR 2.0




removeMixin
public void removeMixin(String mixinName) throws NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, RepositoryException(Code)
Removes the specified mixin node type from this node and removes mixinName from this node's jcr:mixinTypes property. Both the semantic change in effective node type and the persistence of the change to the jcr:mixinTypes property occur on save.

If this node does not have the specified mixin, a NoSuchNodeTypeException is thrown either immediately or on save. Implementations may differ on when this validation is done.

A ConstraintViolationException will be thrown either immediately or on save if the removal of a mixin is not allowed. Implementations are free to enforce any policy they like with regard to mixin removal and may differ on when this validation is done.

A VersionException is thrown either immediately or on save if this node is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in. Implementations may differ on when this validation is done.

A LockException is thrown either immediately or on save if a lock prevents the removal of the mixin. Implementations may differ on when this validation is done.
Parameters:
  mixinName - the name of the mixin node type to be removed.
throws:
  NoSuchNodeTypeException - if the specified mixinNameis not currently assigned to this node and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  ConstraintViolationException - if the specified mixin node typeis prevented from being removed and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  VersionException - if this node is versionable and checked-in or is non-versionable but itsnearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  LockException - if a lock prevents the removal of the mixin and thisimplementation performs this validation immediately instead of waiting until save..
throws:
  RepositoryException - if another error occurs.




removeRetentionPolicy
public void removeRetentionPolicy() throws ConstraintViolationException, UnsupportedRepositoryOperationException, RepositoryException(Code)
Causes the current retention policy on this node to no longer apply.

Removes the jcr:retentionPolicy property from this node.

A ConstraintViolationException is thrown if this node does not have a retention policy currently assigned.

An UnsupportedRepositoryOperationException is thrown if this node is not of type mix:managedRetention.

A RepositoryException is thrown if another error occurs.
throws:
  ConstraintViolationException - if this node does not have aretention policy currently assigned.
throws:
  UnsupportedRepositoryOperationException - if this node is not oftype mix:managedRetention.
throws:
  RepositoryException - if another error occurs.
since:
   JCR 2.0




removeShare
public void removeShare() throws VersionException, LockException, ConstraintViolationException, RepositoryException(Code)
A special kind of remove() that removes this node, but does not remove any other node in the shared set of this node.

All of the exceptions defined for remove() apply to this function. In addition, a RepositoryException is thrown if this node cannot be removed without removing another node in the shared set of this node.

If this node is not shared this method removes only this node.
throws:
  VersionException -
throws:
  LockException -
throws:
  ConstraintViolationException -
throws:
  RepositoryException -
See Also:   Node.removeSharedSet()
See Also:   Item.remove
since:
   JCR 2.0




removeSharedSet
public void removeSharedSet() throws VersionException, LockException, ConstraintViolationException, RepositoryException(Code)
A special kind of remove() that removes this node and every other node in the shared set of this node.

This removal must be done atomically, i.e., if one of the nodes cannot be removed, the function throws the exception remove() would have thrown in that case, and none of the nodes are removed.

If this node is not shared this method removes only this node.
throws:
  VersionException -
throws:
  LockException -
throws:
  ConstraintViolationException -
throws:
  RepositoryException -
See Also:   Node.removeShare()
See Also:   Item.remove
since:
   JCR 2.0




restore
public void restore(String versionName, boolean removeExisting) throws VersionException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException(Code)
Restores this node to the state defined by the version with the specified versionName.

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.

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).

An InvalidItemStateException is thrown if this Session (not necessarily this Node) has pending unsaved changes.

A LockException is thrown if a lock prevents the addition of the mixin.

This method will work regardless of whether this node is checked-in or not.

An identifier collision occurs when a node exists outside the subtree rooted at this node with the same identifier as a node that would be introduced by the restore operation into the subtree at this node. The result in such a case is governed by the removeExisting flag. If removeExisting is true, then the incoming node takes precedence, and the existing node (and its subtree) is removed (if possible; otherwise a RepositoryException is thrown). If removeExisting is false, then a ItemExistsException is thrown and no changes are made. Note that this applies not only to cases where the restored node itself conflicts with an existing node but also to cases where a conflict occurs with any node that would be introduced into the workspace by the restore operation. In particular, conflicts involving subnodes of the restored node that have OnParentVersion settings of COPY or VERSION are also governed by the removeExisting flag.
Parameters:
  versionName - a Version object
Parameters:
  removeExisting - a boolean flag that governs what happens in case of an identifier collision.
throws:
  UnsupportedRepositoryOperationException - if this node is not versionable.
throws:
  VersionException - if the specified version is not part of this node's version historyor if an attempt is made to restore the root version (jcr:rootVersion).
throws:
  ItemExistsException - if removeExisting is false and an identifier collision occurs.
throws:
  LockException - if a lock prevents the restore.
throws:
  InvalidItemStateException - if this Session (not necessarily this Node) has pending unsaved changes.
throws:
  RepositoryException - If another error occurs.




restore
public void restore(Version version, boolean removeExisting) throws VersionException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, RepositoryException(Code)
Restores this node to the state defined by the specified version.

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.

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).

An InvalidItemStateException is thrown if this Session (not necessarily this Node) has pending unsaved changes.

A LockException is thrown if a lock prevents the restore.

This method will work regardless of whether this node is checked-in or not.

An identifier collision occurs when a node exists outside the subtree rooted at this node with the same identifier as a node that would be introduced by the restore operation into the subtree at this node. The result in such a case is governed by the removeExisting flag. If removeExisting is true, then the incoming node takes precedence, and the existing node (and its subtree) is removed (if possible; otherwise a RepositoryException is thrown). If removeExisting is false, then a ItemExistsException is thrown and no changes are made. Note that this applies not only to cases where the restored node itself conflicts with an existing node but also to cases where a conflict occurs with any node that would be introduced into the workspace by the restore operation. In particular, conflicts involving subnodes of the restored node that have OnParentVersion settings of COPY or VERSION are also governed by the removeExisting flag.
Parameters:
  version - a Version object
Parameters:
  removeExisting - a boolean flag that governs what happens in case of an identifier collision.
throws:
  UnsupportedRepositoryOperationException - if this node is not versionable.
throws:
  VersionException - if the specified version is not part of this node's version historyor if an attempt is made to restore the root version (jcr:rootVersion).
throws:
  ItemExistsException - if removeExisting is false and an identifier collision occurs.
throws:
  InvalidItemStateException - if this Session (not necessarily this Node)has pending unsaved changes.
throws:
  LockException - if a lock prevents the restore.
throws:
  RepositoryException - if another error occurs.




restore
public void restore(Version version, String relPath, boolean removeExisting) throws PathNotFoundException, ItemExistsException, VersionException, ConstraintViolationException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException(Code)
Restores the specified version to relPath, relative to this node.

A node need not exist at relPath, though the parent of relPath must exist, otherwise a PathNotFoundException is thrown.

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.

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.

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.

An identifier collision occurs when a node exists outside the subtree rooted at relPath with the same identifier as a node that would be introduced by the restore operation into the subtree at relPath (Note that in cases where there is no node at relPath, this amounts to saying that an identifier collsion occurs if there exists a node anywhere in this workspace with the same identifier as a node that would be introduced by the restore). The result in such a case is governed by the removeExisting flag. If removeExisting is true, then the incoming node takes precedence, and the existing node (and its subtree) is removed (if possible; otherwise a RepositoryException is thrown). If removeExisting is false, then a ItemExistsException is thrown and no changes are made. Note that this applies not only to cases where the restored node itself conflicts with an existing node but also to cases where a conflict occurs with any node that would be introduced into the workspace by the restore operation. In particular, conflicts involving subnodes of the restored node that have OnParentVersion settings of COPY or VERSION are also governed by the removeExisting flag.

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.

If the restore succeeds, the changes made to this node are persisted immediately, there is no need to call save.

An InvalidItemStateException is thrown if this Session (not necessarily this Node) has pending unsaved changes.

An UnsupportedRepositoryOperationException is thrown if versioning is not supported.

A LockException is thrown if a lock prevents the restore.
Parameters:
  version - a version object
Parameters:
  relPath - the path to which the version is to be restored
Parameters:
  removeExisting - overns what happens on identifier collision.
throws:
  PathNotFoundException - if the parent of relPath does not exist.
throws:
  ItemExistsException - if removeExisting is false and an identifier collision occurs
throws:
  ConstraintViolationException - If the would-be parent of the location relPath isactually a property, or if a node type restriction would be violated
throws:
  VersionException - if the parent node of relPath is versionable and checked-in or isnon-versionable but its nearest versionable ancestor is checked-in or if a node exists at relPath that is notthe node corresponding to the specified version or if an attempt is made to restore the root version(jcr:rootVersion).
throws:
  UnsupportedRepositoryOperationException - if versioning is not supported.
throws:
  LockException - if a lock prevents the restore.
throws:
  InvalidItemStateException - if this Session (not necessarily this Node) has pending unsaved changes.
throws:
  RepositoryException - if another error occurs




restoreByLabel
public void restoreByLabel(String versionLabel, boolean removeExisting) throws VersionException, ItemExistsException, UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException(Code)
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.

A VersionException is thrown if the specified versionLabel does not exist in this node's version history.

An InvalidItemStateException is thrown if this Session (not necessarily this Node) has pending unsaved changes.

A LockException is thrown if a lock prevents the restore.

This method will work regardless of whether this node is checked-in or not.

An identifier collision occurs when a node exists outside the subtree rooted at this node with the same identifier as a node that would be introduced by the restoreByLabel operation into the subtree at this node. The result in such a case is governed by the removeExisting flag. If removeExisting is true, then the incoming node takes precedence, and the existing node (and its subtree) is removed (if possible; otherwise a RepositoryException is thrown). If removeExisting is false, then a ItemExistsException is thrown and no changes are made. Note that this applies not only to cases where the restored node itself conflicts with an existing node but also to cases where a conflict occurs with any node that would be introduced into the workspace by the restore operation. In particular, conflicts involving subnodes of the restored node that have OnParentVersion settings of COPY or VERSION are also governed by the removeExisting flag.
Parameters:
  versionLabel - a String
Parameters:
  removeExisting - a boolean flag that governs what happens in case of an identifier collision.
throws:
  UnsupportedRepositoryOperationException - if this node is not verisonable.
throws:
  VersionException - if the specified versionLabeldoes not exist in this node's version history.
throws:
  ItemExistsException - if removeExisting is false and an identifier collision occurs.
throws:
  LockException - if a lock prevents the restore.
throws:
  InvalidItemStateException - if this Session (not necessarily this Node) has pending unsaved changes.
throws:
  RepositoryException - If another error occurs.




setHold
public void setHold(String holdID, boolean isDeep) throws UnsupportedRepositoryOperationException, RepositoryException(Code)
Places a hold on this node and its properties (if isDeep is false) or this node and its subtree (if isDeep is true).

The supplied holdID is added to the jcr:hold multi-value property and the corresponding jcr:isDeep value is set accordingly. The corresponding jcr:isDeep value is the one with the same index as the holdID value.

The format and interpretation of the holdID is not specified. It is expected to be an identifier associated with the application placing the hold.

An UnsupportedRepositoryOperationException is thrown if this node is not of type mix:managedRetention.

A RepositoryException is thrown if another error occurs.
Parameters:
  holdID - a string
Parameters:
  isDeep - a boolean
throws:
  UnsupportedRepositoryOperationException - if this node is not oftype mix:managedRetention.
throws:
  RepositoryException - if another error occurs.
since:
   JCR 2.0




setPrimaryType
public void setPrimaryType(String nodeTypeName) throws NoSuchNodeTypeException, VersionException, ConstraintViolationException, LockException, RepositoryException(Code)
Changes the primary node type of this node to nodeTypeName. Also immediately changes this node's jcr:primaryType property appropriately. Semantically, the new node type may take effect immediately and must take effect on save. Whichever behavior is adopted it must be the same as the behavior adopted for addMixin() (see below) and the behavior that occurs when a node is first created.

If the presence of an existing property or child node would cause an incompatibility with the new node type a ConstraintViolationException is thrown either immediately or on save.

If the new node type would cause this node to be incompatible with the node type of its parent then a ConstraintViolationException is thrown either immediately or on save.

A ConstraintViolationException is also thrown either immediately or on save if a conflict with an already assigned mixin occurs.

A ConstraintViolationException may also be thrown either immediately or on save if the attempted change violates implementation-specific node type transition rules. A repository that disallows all primary node type changes would simple throw this exception in all cases.

If the specified node type is not recognized a NoSuchNodeTypeException is thrown either immediately or on save.

A VersionException is thrown either immediately or on save if this node is versionable and checked-in, or is non-versionable but its nearest versionable ancestor is checked-in.

A LockException is thrown either immediately or on save if a lock prevents the change of node type.

A RepositoryException will be thrown if another error occurs.
Parameters:
  nodeTypeName - the name of the new node type.
throws:
  ConstraintViolationException - If the specified primary node typeis prevented from being assigned.
throws:
  NoSuchNodeTypeException - If the specified nodeTypeNameis not recognized and this implementation performs this validationimmediately instead of waiting until save.
throws:
  VersionException - if this node is versionable and checked-in or isnon-versionable but its nearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting untilsave.
throws:
  LockException - if a lock prevents the change of the primary node typeand this implementation performs this validation immediately instead ofwaiting until save.
throws:
  RepositoryException - if another error occurs.
since:
   JCR 2.0




setProperty
public Property setProperty(String name, Value value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException(Code)
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.

If, based on the name and value passed, there is more than one property definition that applies, the repository chooses one definition according to some implementation-specific criteria. Once property with name P has been created, the behavior of a subsequent setProperty(P,V) may differ across implementations. Some repositories may allow P to be dynamically re-bound to a different property definition (based for example, on the new value being of a different type than the original value) while other repositories may not allow such dynamic re-binding.

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.

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.

If the property is multi-valued, a ValueFormatException is thrown.

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.

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.

A ConstraintViolationException will be thrown either immediately or on save if the change would violate a node type or implementation-specific constraint. Implementations may differ on when this validation is performed.

A VersionException will be thrown either immediately or on save if this node is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in. Implementations may differ on when this validation is performed.

A LockException will be thrown either immediately or on save if a lock prevents the setting of the property. Implementations may differ on when this validation is performed.
Parameters:
  name - The name of a property of this node
Parameters:
  value - The value to be assigned The updated Property object
throws:
  ValueFormatException - if value cannot be converted to the type of the specifiedproperty or if the property already exists and is multi-valued.
throws:
  VersionException - if this node is versionable and checked-in or is non-versionable but itsnearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  LockException - if a lock prevents the setting of the property and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  ConstraintViolationException - if the change would violate a node-type or other constraintand this implementation performs this validation immediately instead of waiting until save.
throws:
  RepositoryException - if another error occurs.




setProperty
public Property setProperty(String name, Value value, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException(Code)
Sets the specified (single-value) property to the specified value. If the property does not yet exist, it is created.

The type of the new property is determined by the type parameter specified.

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 the property is not single-valued then a ValueFormatException is also thrown.

If the property already exists it assumes both the new value and the new property type.

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.

To persist the addition or removal of a property, save must be called on the Session, this Node, or an ancestor of this Node.

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.

A ConstraintViolationException will be thrown either immediately or on save if the change would violate a node type or implementation-specific constraint. Implementations may differ on when this validation is performed.

A VersionException will be thrown either immediately or on save if this node is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in. Implementations may differ on when this validation is performed.

A LockException will be thrown either immediately or on save if a lock prevents the setting of the property. Implementations may differ on when this validation is performed.
Parameters:
  name - the name of the property to be set.
Parameters:
  value - a Value object.
Parameters:
  type - the type of the property. the Property object set, or nullif this method was used to remove a property (by setting its value to null).
throws:
  ValueFormatException - if value cannot be converted to the specified typeor if the property already exists and is multi-valued.
throws:
  VersionException - if this node is versionable and checked-in or is non-versionable but itsnearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  LockException - if a lock prevents the setting of the property and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  ConstraintViolationException - if the change would violate a node-type or other constraintand this implementation performs this validation immediately instead of waiting until save.
throws:
  RepositoryException - if another error occurs.




setProperty
public Property setProperty(String name, Value[] values) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException(Code)
Sets the specified (multi-value) property to the specified array of values. If the property does not yet exist, it is created. Same as Node.setProperty(String name,Value value) except that an array of Value objects is assigned instead of a single Value.

The property type of the property will be that specified by the node type of this node. If the property type of the supplied Value objects is different from that required, then a best-effort conversion is attempted. If the conversion fails, a ValueFormatException is thrown.

All Value objects in the array must be of the same type, otherwise a ValueFormatException is thrown. If the property is not multi-valued then a ValueFormatException is also thrown. If another error occurs, a RepositoryException is thrown.

If the node type of this node does not indicate a specific property type, then the property type of the supplied Value objects is used and if the property already exists it assumes both the new values and the new property type.

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.

Note that this is different from passing an array that contains null elements. In such a case, the array is compacted by removing the nulls. The resulting set of values never contains nulls. However, the set may be empty: N.setProperty("P", new Value[]{null}) would set the property to the empty set of values.

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.

A ConstraintViolationException will be thrown either immediately or on save if the change would violate a node type or implementation-specific constraint. Implementations may differ on when this validation is performed.

A VersionException will be thrown either immediately or on save if this node is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in. Implementations may differ on when this validation is performed.

A LockException will be thrown either immediately or on save if a lock prevents the setting of the property. Implementations may differ on when this validation is performed.
Parameters:
  name - the name of the property to be set.
Parameters:
  values - an array of Value objects. the updated Property object.
throws:
  ValueFormatException - if value cannot be converted to the type of the specified propertyor if the property already exists and is not multi-valued.
throws:
  VersionException - if this node is versionable and checked-in or is non-versionable but itsnearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  LockException - if a lock prevents the setting of the property and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  ConstraintViolationException - if the change would violate a node-type or other constraintand this implementation performs this validation immediately instead of waiting until save.
throws:
  RepositoryException - if another error occurs.




setProperty
public Property setProperty(String name, Value[] values, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException(Code)
Sets the specified (multi-value) property to the specified array of values. If the property does not yet exist, it is created. The type of the property is determined by the type parameter specified.

If the property type of the supplied Value objects is different from that specified, then a best-effort conversion is attempted. If the conversion fails, a ValueFormatException is thrown.

If the property already exists it assumes both the new values and the new property type.

All Value objects in the array must be of the same type, otherwise a ValueFormatException is thrown. If the property is not multi-valued then a ValueFormatException is also thrown. If another error occurs, a RepositoryException is thrown.

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.

Note that this is different from passing an array that contains null elements. In such a case, the array is compacted by removing the nulls. The resulting set of values never contains nulls. However, the set may be empty: N.setProperty("P", new Value[]{null}, type) would set the property to the empty set of values.

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.

A ConstraintViolationException will be thrown either immediately or on save if the change would violate a node type or implementation-specific constraint. Implementations may differ on when this validation is performed.

A VersionException will be thrown either immediately or on save if this node is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in. Implementations may differ on when this validation is performed.

A LockException will be thrown either immediately or on save if a lock prevents the setting of the property. Implementations may differ on when this validation is performed.
Parameters:
  name - the name of the property to be set.
Parameters:
  values - an array of Value objects.
Parameters:
  type - the type of the property. the updated Property object.
throws:
  ValueFormatException - if value cannot be converted to the specified typeor if the property already exists and is not multi-valued.
throws:
  VersionException - if this node is versionable and checked-in or is non-versionable but itsnearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  LockException - if a lock prevents the setting of the property and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  ConstraintViolationException - if the change would violate a node-type or other constraintand this implementation performs this validation immediately instead of waiting until save.
throws:
  RepositoryException - if another error occurs.




setProperty
public Property setProperty(String name, String[] values) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException(Code)
Sets the specified property to the specified array of values. Same as Node.setProperty(String name,Value[] values) except that the values are specified as String objects instead of Value objects.
Parameters:
  name - the name of the property to be set.
Parameters:
  values - an array of Value objects. the updated Property object.
throws:
  ValueFormatException - if value cannot be converted to the type of the specified propertyor if the property already exists and is not multi-valued.
throws:
  VersionException - if this node is versionable and checked-in or is non-versionable but itsnearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  LockException - if a lock prevents the setting of the property and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  ConstraintViolationException - if the change would violate a node-type or other constraintand this implementation performs this validation immediately instead of waiting until save.
throws:
  RepositoryException - if another error occurs.



setProperty
public Property setProperty(String name, String[] values, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException(Code)
Sets the specified property to the specified array of values and to the specified type. Same as Node.setProperty(String name,Value[] values,int type) except that the values are specified as String objects instead of Value objects.
Parameters:
  name - the name of the property to be set.
Parameters:
  values - an array of Value objects.
Parameters:
  type - the type of the property. the updated Property object.
throws:
  ValueFormatException - if value cannot be converted to the specified typeor if the property already exists and is not multi-valued.
throws:
  VersionException - if this node is versionable and checked-in or is non-versionable but itsnearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  LockException - if a lock prevents the setting of the property and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  ConstraintViolationException - if the change would violate a node-type or other constraintand this implementation performs this validation immediately instead of waiting until save.
throws:
  RepositoryException - if another error occurs.



setProperty
public Property setProperty(String name, String value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException(Code)
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.

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.

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.

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.

A ConstraintViolationException will be thrown either immediately or on save if the change would violate a node type or implementation-specific constraint. Implementations may differ on when this validation is performed.

A VersionException will be thrown either immediately or on save if this node is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in. Implementations may differ on when this validation is performed.

A LockException will be thrown either immediately or on save if a lock prevents the setting of the property. Implementations may differ on when this validation is performed.
Parameters:
  name - The name of a property of this node
Parameters:
  value - The value to assigned The updated Property object
throws:
  ValueFormatException - if value cannot be converted to the type of the specified propertyor if the property already exists and is multi-valued.
throws:
  VersionException - if this node is versionable and checked-in or is non-versionable but itsnearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  LockException - if a lock prevents the setting of the property and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  ConstraintViolationException - if the change would violate a node-type or other constraintand this implementation performs this validation immediately instead of waiting until save.
throws:
  RepositoryException - If another error occurs.




setProperty
public Property setProperty(String name, String value, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException(Code)
Sets the specified (single-value) property to the specified value. If the property does not yet exist, it is created.

The type of the property is determined by the type parameter specified.

If the property type specified is not PropertyType.STRING, then a best-effort conversion is attempted. If the conversion fails, a ValueFormatException is thrown.

If the property is not single-valued then a ValueFormatException is also thrown.

If the property already exists it assumes both the new value and the new property type.

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.

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.

A ConstraintViolationException will be thrown either immediately or on save if the change would violate a node type or implementation-specific constraint. Implementations may differ on when this validation is performed.

A VersionException will be thrown either immediately or on save if this node is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in. Implementations may differ on when this validation is performed.

A LockException will be thrown either immediately or on save if a lock prevents the setting of the property. Implementations may differ on when this validation is performed.
Parameters:
  name - the name of the property to be set.
Parameters:
  value - a String object.
Parameters:
  type - the type of the property. the Property object set, or nullif this method was used to remove a property (by setting its value to null).
throws:
  ValueFormatException - if value cannot be converted to the specified typeor if the property already exists and is multi-valued.
throws:
  VersionException - if this node is versionable and checked-in or is non-versionable but itsnearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  LockException - if a lock prevents the setting of the property and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  ConstraintViolationException - if the change would violate a node-type or other constraintand this implementation performs this validation immediately instead of waiting until save.
throws:
  RepositoryException - if another error occurs.




setProperty
public Property setProperty(String name, InputStream value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException(Code)
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.

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.

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.

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.

The passed stream is closed before this method returns either normally or because of an exception.

A ConstraintViolationException will be thrown either immediately or on save if the change would violate a node type or implementation-specific constraint. Implementations may differ on when this validation is performed.

A VersionException will be thrown either immediately or on save if this node is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in. Implementations may differ on when this validation is performed.

A LockException will be thrown either immediately or on save if a lock prevents the setting of the property. Implementations may differ on when this validation is performed. Node.setProperty(String,Binary)
Parameters:
  name - The name of a property of this node
Parameters:
  value - The value to assigned The updated Property object
throws:
  ValueFormatException - if value cannot be converted to the type of the specified propertyor if the property already exists and is multi-valued.
throws:
  VersionException - if this node is versionable and checked-in or is non-versionable but itsnearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  LockException - if a lock prevents the setting of the property and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  ConstraintViolationException - if the change would violate a node-type or other constraintand this implementation performs this validation immediately instead of waiting until save.
throws:
  RepositoryException - If another error occurs.




setProperty
public Property setProperty(String name, Binary value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException(Code)
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.

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.

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", (Binary)null) would remove property called "P" of the node in N.

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.

A ConstraintViolationException will be thrown either immediately or on save if the change would violate a node type or implementation-specific constraint. Implementations may differ on when this validation is performed.

A VersionException will be thrown either immediately or on save if this node is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in. Implementations may differ on when this validation is performed.

A LockException will be thrown either immediately or on save if a lock prevents the setting of the property. Implementations may differ on when this validation is performed.
Parameters:
  name - The name of a property of this node
Parameters:
  value - The value to assigned The updated Property object
throws:
  ValueFormatException - if value cannot be converted to the type of the specified propertyor if the property already exists and is multi-valued.
throws:
  VersionException - if this node is versionable and checked-in or is non-versionable but itsnearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  LockException - if a lock prevents the setting of the property and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  ConstraintViolationException - if the change would violate a node-type or other constraintand this implementation performs this validation immediately instead of waiting until save.
throws:
  RepositoryException - If another error occurs.
since:
   JCR 2.0




setProperty
public Property setProperty(String name, boolean value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException(Code)
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.

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.

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.

A ConstraintViolationException will be thrown either immediately or on save if the change would violate a node type or implementation-specific constraint. Implementations may differ on when this validation is performed.

A VersionException will be thrown either immediately or on save if this node is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in. Implementations may differ on when this validation is performed.

A LockException will be thrown either immediately or on save if a lock prevents the setting of the property. Implementations may differ on when this validation is performed.
Parameters:
  name - The name of a property of this node
Parameters:
  value - The value to assigned The updated Property object
throws:
  ValueFormatException - if value cannot be converted to the type of the specified propertyor if the property already exists and is multi-valued.
throws:
  VersionException - if this node is versionable and checked-in or is non-versionable but itsnearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  LockException - if a lock prevents the setting of the property and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  ConstraintViolationException - if the change would violate a node-type or other constraintand this implementation performs this validation immediately instead of waiting until save.
throws:
  RepositoryException - If another error occurs.




setProperty
public Property setProperty(String name, double value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException(Code)
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.

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.

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.

A ConstraintViolationException will be thrown either immediately or on save if the change would violate a node type or implementation-specific constraint. Implementations may differ on when this validation is performed.

A VersionException will be thrown either immediately or on save if this node is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in. Implementations may differ on when this validation is performed.

A LockException will be thrown either immediately or on save if a lock prevents the setting of the property. Implementations may differ on when this validation is performed.
Parameters:
  name - The name of a property of this node
Parameters:
  value - The value to assigned The updated Property object
throws:
  ValueFormatException - if value cannot be converted to the type of the specified propertyor if the property already exists and is multi-valued.
throws:
  VersionException - if this node is versionable and checked-in or is non-versionable but itsnearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  LockException - if a lock prevents the setting of the property and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  ConstraintViolationException - if the change would violate a node-type or other constraintand this implementation performs this validation immediately instead of waiting until save.
throws:
  RepositoryException - If another error occurs.




setProperty
public Property setProperty(String name, BigDecimal value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException(Code)
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.DECIMAL, 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.

If the node type of this node does not specify a particular property type for the property being set then PropertyType.DECIMAL is used and, if the property already exists, it assumes both the new value and type PropertyType.DECIMAL.

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.

A ConstraintViolationException will be thrown either immediately or on save if the change would violate a node type or implementation-specific constraint. Implementations may differ on when this validation is performed.

A VersionException will be thrown either immediately or on save if this node is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in. Implementations may differ on when this validation is performed.

A LockException will be thrown either immediately or on save if a lock prevents the setting of the property. Implementations may differ on when this validation is performed.
Parameters:
  name - The name of a property of this node
Parameters:
  value - The value to assigned The updated Property object
throws:
  ValueFormatException - if value cannot be converted to the type of the specified propertyor if the property already exists and is multi-valued.
throws:
  VersionException - if this node is versionable and checked-in or is non-versionable but itsnearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  LockException - if a lock prevents the setting of the property and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  ConstraintViolationException - if the change would violate a node-type or other constraintand this implementation performs this validation immediately instead of waiting until save.
throws:
  RepositoryException - If another error occurs.
since:
   JCR 2.0




setProperty
public Property setProperty(String name, long value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException(Code)
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.

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.

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.

A ConstraintViolationException will be thrown either immediately or on save if the change would violate a node type or implementation-specific constraint. Implementations may differ on when this validation is performed.

A VersionException will be thrown either immediately or on save if this node is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in. Implementations may differ on when this validation is performed.

A LockException will be thrown either immediately or on save if a lock prevents the setting of the property. Implementations may differ on when this validation is performed.
Parameters:
  name - The name of a property of this node
Parameters:
  value - The value to assigned The updated Property object
throws:
  ValueFormatException - if value cannot be converted to the type of the specified propertyor if the property already exists and is multi-valued.
throws:
  VersionException - if this node is versionable and checked-in or is non-versionable but itsnearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  LockException - if a lock prevents the setting of the property and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  ConstraintViolationException - if the change would violate a node-type or other constraintand this implementation performs this validation immediately instead of waiting until save.
throws:
  RepositoryException - If another error occurs.




setProperty
public Property setProperty(String name, Calendar value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException(Code)
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.

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.

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.

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.

A ConstraintViolationException will be thrown either immediately or on save if the change would violate a node type or implementation-specific constraint. Implementations may differ on when this validation is performed.

A VersionException will be thrown either immediately or on save if this node is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in. Implementations may differ on when this validation is performed.

A LockException will be thrown either immediately or on save if a lock prevents the setting of the property. Implementations may differ on when this validation is performed.
Parameters:
  name - The name of a property of this node
Parameters:
  value - The value to assigned The updated Property object
throws:
  ValueFormatException - if value cannot be converted to the type of the specified propertyor if the property already exists and is multi-valued.
throws:
  VersionException - if this node is versionable and checked-in or is non-versionable but itsnearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  LockException - if a lock prevents the setting of the property and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  ConstraintViolationException - if the change would violate a node-type or other constraintand this implementation performs this validation immediately instead of waiting until save.
throws:
  RepositoryException - If another error occurs.




setProperty
public Property setProperty(String name, Node value) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException(Code)
Sets the specified (REFERENCE)property to refer to the specified Node. 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 the property type of this property is something other than either PropertyType.REFERENCE or undefined then a ValueFormatException is thrown. If the property is multi-valued, a ValueFormatException is also thrown. If another error occurs, a RepositoryException is thrown.

If the node type of this node does not specify a particular property type for the property being set then PropertyType.REFERENCE is used and, if the property already exists, it assumes both the new value and type PropertyType.REFERENCE.

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", (Node)null) would remove property called "P" of the node in N.

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.

A ConstraintViolationException will be thrown either immediately or on save if the change would violate a node type or implementation-specific constraint. Implementations may differ on when this validation is performed.

A VersionException will be thrown either immediately or on save if this node is versionable and checked-in or is non-versionable but its nearest versionable ancestor is checked-in. Implementations may differ on when this validation is performed.

A LockException will be thrown either immediately or on save if a lock prevents the setting of the property. Implementations may differ on when this validation is performed.
Parameters:
  name - The name of a property of this node
Parameters:
  value - The value to assigned The updated Property object
throws:
  ValueFormatException - if value cannot be converted to the type of the specified propertyor if the property already exists and is multi-valued.
throws:
  VersionException - if this node is versionable and checked-in or is non-versionable but itsnearest versionable ancestor is checked-in and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  LockException - if a lock prevents the setting of the property and thisimplementation performs this validation immediately instead of waiting until save.
throws:
  ConstraintViolationException - if the change would violate a node-type or other constraintand this implementation performs this validation immediately instead of waiting until save.
throws:
  RepositoryException - If another error occurs.




setRetentionPolicy
public void setRetentionPolicy(Node policy) throws ConstraintViolationException, UnsupportedRepositoryOperationException, RepositoryException(Code)
Sets the retention policy of this node to that defined in the specified policy node. Interpretation and enforcement of this policy is an implementation issue.

The jcr:retentionPolicy property of this node is set to refer to the policy node.

A ConstraintViolationException is thrown if the specified node is not a valid retention policy node.

An UnsupportedRepositoryOperationException is thrown if this node is not of type mix:managedRetention.

A RepositoryException is thrown if another error occurs.
Parameters:
  policy - a policy node
throws:
  ConstraintViolationException - if the specified node is not a validretention policy node.
throws:
  UnsupportedRepositoryOperationException - if this node is not oftype mix:managedRetention.
throws:
  RepositoryException - if another error occurs.
since:
   JCR 2.0




unlock
public void unlock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, InvalidItemStateException, RepositoryException(Code)
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. As well, the corresponding lock token is removed from the set of lock tokens held by the current Session.

If this node does not currently hold a lock or holds a lock for which this Session is not the owner, then a LockException is thrown. Note however that the system may give permission to a non-owning session to unlock a lock. Typically such "lock-superuser" capability is intended to facilitate administrational clean-up of orphaned open-scoped locks.

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).

If the current session does not have sufficient privileges to remove the lock, an AccessDeniedException is thrown.

An InvalidItemStateException is thrown if this node has pending unsaved changes.

An UnsupportedRepositoryOperationException is thrown if this implementation does not support locking.

A RepositoryException is thrown if another error occurs.
throws:
  UnsupportedRepositoryOperationException - if this implementation does not support locking.
throws:
  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
throws:
  AccessDeniedException - if the current session does not have permission to unlock this node.
throws:
  InvalidItemStateException - if this node has pending unsaved changes.
throws:
  RepositoryException - if another error occurs.




update
public void update(String srcWorkspace) throws NoSuchWorkspaceException, AccessDeniedException, LockException, InvalidItemStateException, RepositoryException(Code)
If this node does have a corresponding node in the workspace srcWorkspace, then this replaces this node and its subtree with a clone of the corresponding node and its subtree.

If this node does not have a corresponding node in the workspace srcWorkspace, then the update method has no effect.

If the update succeeds the changes made are persisted immediately, there is no need to call save.

Note that update does not respect the checked-in status of nodes. An update may change a node even if it is currently checked-in (This fact is only relevant in an implementation that supports versioning).

If the specified srcWorkspace does not exist, a NoSuchWorkspaceException is thrown.

If the current session does not have sufficient rights to perform the operation, then an AccessDeniedException is thrown.

An InvalidItemStateException is thrown if this Session (not necessarily this Node) has pending unsaved changes.

Throws a LockException if a lock prevents the update.

A RepositoryException is thrown if another error occurs.
Parameters:
  srcWorkspace - the name of the source workspace.
throws:
  NoSuchWorkspaceException - If srcWorkspace does not exist.
throws:
  InvalidItemStateException - if this Session (not necessarily this Node) has pending unsaved changes.
throws:
  AccessDeniedException - If the current session does not have sufficient rights to perform the operation.
throws:
  LockException - if a lock prevents the update.
throws:
  RepositoryException - If another error occurs.




www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.