Java Doc for VersionHistory.java in  » 6.0-JDK-Modules » jsr-283 » javax » jcr » version » 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.version 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.jcr.version.VersionHistory

VersionHistory
public interface VersionHistory extends Node(Code)
A VersionHistory object wraps an nt:versionHistory node. It provides convenient access to version history information.




Method Summary
public  voidaddVersionLabel(String versionName, String label, boolean moveLabel)
     Adds the specified label to the specified version.
public  NodeIteratorgetAllFrozenNodes()
     Returns an iterator over all the frozen nodes of all the versions of this version history.
public  VersionIteratorgetAllVersions()
     Returns an iterator over all the versions within this version history. The order of the returned objects will not necessarily correspond to the order of versions in terms of the successor relation.
public  VersiongetRootVersion()
     Returns the root version of this version history.
public  VersiongetVersion(String versionName)
     Retrieves a particular version from this version history by version name.
public  VersiongetVersionByLabel(String label)
     Retrieves a particular version from this version history by version label.
public  String[]getVersionLabels()
     Returns all version labels of the history or an empty array if there are none.
public  String[]getVersionLabels(Version version)
     Returns all version labels of the given version - empty array if none.
public  StringgetVersionableIdentifier()
     Returns the identifier of the versionable node for which this is the version history.
public  StringgetVersionableUUID()
     Returns the identifier of the versionable node for which this is the version history.
public  booleanhasVersionLabel(String label)
     Returns true if any version in the history has the given label.
public  booleanhasVersionLabel(Version version, String label)
     Returns true if the given version has the given label.
public  voidremoveVersion(String versionName)
     Removes the named version from this version history and automatically repairs the version graph.
public  voidremoveVersionLabel(String label)
     Removes the specified label from among the labels of this version history.



Method Detail
addVersionLabel
public void addVersionLabel(String versionName, String label, boolean moveLabel) throws LabelExistsVersionException, VersionException, RepositoryException(Code)
Adds the specified label to the specified version. This corresponds to adding a reference property with a name specified by the label parameter to the jcr:versionLabels subnode of the nt:versionHistory node. The reference property points to the nt:version node that represents the specified version.

Note that this change is made immediately; there is no need to call save. In fact, since the the version storage is read-only with respect to normal repository methods, save does not even function in this context.

Within a particular version history, a given label may appear a maximum of once. If the specified label is already assigned to a version in this history and moveLabel is true then the label is removed from its current location and added to the version with the specified versionName. If moveLabel is false, then an attempt to add a label that already exists in this version history will throw a LabelExistVersionException.

A VersionException is thrown if the named version is not in this VersionHistory or if it is the root version (jcr:rootVersion) or if the label specified is not a valid JCR NAME.
Parameters:
  versionName - the name of the version to which the label is to be added.
Parameters:
  label - the label to be added.
Parameters:
  moveLabel - if true, then if label is already assigned to a version inthis version history, it is moved to the new version specified; if false, then attemptingto assign an already used label will throw a VersionException.
throws:
  LabelExistsVersionException - if moveLabel is false,and an attempt is made to add a label that already exists in this version history
throws:
  VersionException - if an attempt is made to add an existing label to a version historyand moveLabel is false or if the specifed version does not exist inthis version history or if the specified version is the root version (jcr:rootVersion).
throws:
  RepositoryException - if another error occurs.




getAllFrozenNodes
public NodeIterator getAllFrozenNodes() throws RepositoryException(Code)
Returns an iterator over all the frozen nodes of all the versions of this version history. Under simple versioning the order of the returned nodes will be the order of their creation. Under full versioning the order is implementation-dependent. a NodeIterator object.
throws:
  RepositoryException - if an error occurs.
since:
   JCR 2.0



getAllVersions
public VersionIterator getAllVersions() throws RepositoryException(Code)
Returns an iterator over all the versions within this version history. The order of the returned objects will not necessarily correspond to the order of versions in terms of the successor relation. To traverse the version graph one must traverse the jcr:successor REFERENCE properties starting with the root version. A version history will always have at least one version, the root version. Therefore, this method will always return an iterator of at least size 1. a VersionIterator object.
throws:
  RepositoryException - if an error occurs.



getRootVersion
public Version getRootVersion() throws RepositoryException(Code)
Returns the root version of this version history. a Version object.
throws:
  RepositoryException - if an error occurs.



getVersion
public Version getVersion(String versionName) throws VersionException, RepositoryException(Code)
Retrieves a particular version from this version history by version name.

Throws a VersionException if the specified version is not in this version history.
Parameters:
  versionName - a version name a Version object.
throws:
  VersionException - if the specified version is not in this version history.
throws:
  RepositoryException - if an error occurs.




getVersionByLabel
public Version getVersionByLabel(String label) throws RepositoryException(Code)
Retrieves a particular version from this version history by version label.

Throws a VersionException if the specified label is not in this version history.
Parameters:
  label - a version label a Version object.
throws:
  VersionException - if the specified label is not in this version history.
throws:
  RepositoryException - if an error occurs.




getVersionLabels
public String[] getVersionLabels() throws RepositoryException(Code)
Returns all version labels of the history or an empty array if there are none. a String array containing all the labels of the version history.
throws:
  RepositoryException - if an error occurs.



getVersionLabels
public String[] getVersionLabels(Version version) throws VersionException, RepositoryException(Code)
Returns all version labels of the given version - empty array if none. Throws a VersionException if the specified version is not in this version history.
Parameters:
  version - a Version object a String array containing all the labels of the given version
throws:
  VersionException - if the specified version is not in this version history.
throws:
  RepositoryException - if another error occurs.



getVersionableIdentifier
public String getVersionableIdentifier() throws RepositoryException(Code)
Returns the identifier of the versionable node for which this is the version history. the identifier of the versionable node for which this is the version history.
throws:
  RepositoryException - if an error occurs.
since:
   JCR 2.0



getVersionableUUID
public String getVersionableUUID() throws RepositoryException(Code)
Returns the identifier of the versionable node for which this is the version history. VersionHistory.getVersionableIdentifier the identifier of the versionable node for which this is the version history.
throws:
  RepositoryException - if an error occurs.



hasVersionLabel
public boolean hasVersionLabel(String label) throws RepositoryException(Code)
Returns true if any version in the history has the given label.
Parameters:
  label - a version label a boolean.
throws:
  RepositoryException - if an error occurs.



hasVersionLabel
public boolean hasVersionLabel(Version version, String label) throws VersionException, RepositoryException(Code)
Returns true if the given version has the given label.
Parameters:
  version - a Version object
Parameters:
  label - a version label a boolean.
throws:
  VersionException - if the specified version is not of this version history.
throws:
  RepositoryException - if another error occurs.



removeVersion
public void removeVersion(String versionName) throws ReferentialIntegrityException, AccessDeniedException, UnsupportedRepositoryOperationException, VersionException, RepositoryException(Code)
Removes the named version from this version history and automatically repairs the version graph. If the version to be removed is V, V's predecessor set is P and V's successor set is S, then the version graph is repaired s follows:
  • For each member of P, remove the reference to V from its successor list and add references to each member of S.
  • For each member of S, remove the reference to V from its predecessor list and add references to each member of P.
Note that this change is made immediately; there is no need to call save. In fact, since the the version storage is read-only with respect to normal repository methods, save does not even function in this context.

A ReferentialIntegrityException will be thrown if the specified version is currently the target of a REFERENCE property elsewhere in the repository (not just in this workspace) and the current Session has read access to that REFERENCE property.

An AccessDeniedException will be thrown if the current Session does not have permission to remove the specified version or if the specified version is currently the target of a REFERENCE property elsewhere in the repository (not just in this workspace) and the current Session does not have read access to that REFERENCE property.

Throws an UnsupportedRepositoryOperationException if this operation is not supported by the implementation.

Throws a VersionException if the named version is not in this VersionHistory.
Parameters:
  versionName - the name of a version in this version history.
throws:
  ReferentialIntegrityException - if the specified version is currently the target of aREFERENCE property elsewhere in the repository (not necessarily in this workspace)and the current Session has read access to that REFERENCE property.
throws:
  AccessDeniedException - if the current Session does not have permission to remove thespecified version or if the specified version is currently the target of a REFERENCEproperty elsewhere in the repository (not just in this workspace) and the current Sessiondoes not have read access to that REFERENCE property.
throws:
  UnsupportedRepositoryOperationException - if this operation is not supported by the implementation.
throws:
  VersionException - if the named version is not in this version history.
throws:
  RepositoryException - if another error occurs.




removeVersionLabel
public void removeVersionLabel(String label) throws VersionException, RepositoryException(Code)
Removes the specified label from among the labels of this version history. This corresponds to removing a property from the jcr:versionLabels child node of the nt:versionHistory node that represents this version history.

Note that this change is made immediately; there is no need to call save. In fact, since the the version storage is read-only with respect to normal repository methods, save does not even function in this context.

If a label is specified that does not exist in this version history, a VersionException is thrown.
Parameters:
  label - a version label
throws:
  VersionException - if the name labvel does not exist in this version history.
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.