KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > jcr > impl > core > version > VersionImpl


1 package org.exoplatform.services.jcr.impl.core.version;
2
3
4 import javax.jcr.version.VersionException;
5 import javax.jcr.RepositoryException;
6 import java.util.Calendar JavaDoc;
7 import javax.jcr.version.Version;
8
9 /**
10  * A <code>Version</code> object wraps an <code>nt:version</code> node. It
11  * provides convenient access to version information.
12  */

13 public class VersionImpl implements Version {
14
15   /**
16    * Returns the version name of this version. This corresponds to the value
17    * of the <code>jcr:versionName</code> property in the <code>nt:version</code>
18    * node that represents this version.
19    *
20    * @return the version name
21    * @throws RepositoryException if an error occurs.
22    */

23   public String JavaDoc getVersionName() throws RepositoryException {
24     throw new RepositoryException("Version is not supported yet!");
25   }
26
27   /**
28    * Returns the version date of this version. This corresponds to the value
29    * of the <code>jcr:versionDate</code> property in the <code>nt:version</code>
30    * node that represents this version.
31    *
32    * @return a <code>Calendar</code> object
33    * @throws RepositoryException if an error occurs.
34    */

35   public Calendar JavaDoc getVersionDate() throws RepositoryException {
36     throw new RepositoryException("Version is not supported yet!");
37   }
38
39   /**
40    * Returns the version labels of this version. This corresponds to the
41    * values of the <code>jcr:versionName</code> property in the
42    * <code>nt:version<code> node that represents this version.
43    *
44    * @return a string array
45    * @throws RepositoryException if an error occurs.
46    */

47   public String JavaDoc[] getVersionLabels() throws RepositoryException {
48     throw new RepositoryException("Version is not supported yet!");
49   }
50
51   /**
52    * Returns the version labels of this version. This corresponds to the
53    * values of the <code>jcr:versionLabels</code> multi-value property in the
54    * <code>nt:version</code> node that represents this version.
55    *
56    * @param label a version label
57    * @throws RepositoryException if an error occurs.
58    */

59   public void addVersionLabel(String JavaDoc label) throws RepositoryException {
60     throw new RepositoryException("Version is not supported yet!");
61   }
62
63   /**
64    * Removes the specified label from among the labels of this version. This
65    * corresponds to removing a value from the <code>jcr:versionLabels</code>
66    * multi-value property in the <code>nt:version</code> node that represents
67    * this version.
68    *
69    * @param label a version label
70    * @throws RepositoryException if an error occurs.
71    */

72   public void removeVersionLabel(String JavaDoc label) throws RepositoryException {
73     throw new RepositoryException("Version is not supported yet!");
74   }
75
76   /**
77    * Returns the successor versions of this version. This corresponds to
78    * returning all the <code>nt:version</code> nodes referenced by the
79    * <code>jcr:successors</code> multi-value property in the
80    * <code>nt:version</code> node that represents this version.
81    *
82    * @return a <code>Version</code> array.
83    * @throws RepositoryException if an error occurs.
84    */

85   public Version[] getSuccessors() throws RepositoryException {
86     throw new RepositoryException("Version is not supported yet!");
87   }
88
89   /**
90    * Returns the predecessor versions of this version. This corresponds to
91    * returning all the <code>nt:version</code> nodes whose
92    * <code>jcr:successors</code> property includes a reference to the
93    * <code>nt:version</code> node that represents this version.
94    *
95    * @return a <code>Version</code> array.
96    * @throws RepositoryException if an error occurs.
97    */

98   public Version[] getPredecessors() throws RepositoryException {
99     throw new RepositoryException("Version is not supported yet!");
100   }
101
102   /**
103    * Adds the specified <code>v</code> as a successor of this version.
104    * This is used to create a �merge� within the version graph (not to be
105    * confused with the <code>Node.merge</code> method which operates on
106    * workspace nodes). A workspace <code>Node.merge<code> may be used to
107    * produce the appropriate node to be checked-in and then added as a
108    * successor to more than one existing version, using this <code>addSuccessor</code> method,
109    * thus performing both the semantic and the version graph parts of the
110    * full �merge� operation.
111    * <p/>
112    * This method corresponds to adding a reference to an <code>nt:version</code>
113    * node to the <code>jcr:successors</code> multi-value property of the
114    * <code>nt:version</code> node that represents this version.
115    * If <code>v<code> is not already in the same version history as
116    * this node or if adding <code>v<code> as a successor would create a
117    * cycle in the version history then an <code>VersionException</code> is thrown.
118    *
119    * @param v a <code>Version</code> object.
120    * @throws RepositoryException if an error occurs.
121    */

122   public void addSuccessor(Version v) throws VersionException, RepositoryException {
123     throw new RepositoryException("Version is not supported yet!");
124   }
125
126   /**
127    * Removes <code>v</code> from the successors of this version. This
128    * method corresponds to removing a reference to an <code>nt:version</code>
129    * node from the <code>jcr:successors</code> multi-value property of the
130    * <code>nt:version</code> node that represents this version. If
131    * <code>v</code> is not currently a direct successor of this node then an
132    * <code>VersionException</code> is thrown.
133    *
134    * @param v a <code>Version</code> object.
135    * @throws RepositoryException if an error occurs.
136    */

137   public void removeSuccessor(Version v) throws VersionException, RepositoryException {
138     throw new RepositoryException("Version is not supported yet!");
139   }
140 }
141
Popular Tags