KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > jcr > version > VersionHistory


1 /*
2  * $Id: VersionHistory.java,v 1.2 2004/07/24 00:16:24 benjmestrallet Exp $
3  *
4  * Copyright 2002-2004 Day Management AG, Switzerland.
5  *
6  * Licensed under the Day RI License, Version 2.0 (the "License"),
7  * as a reference implementation of the following specification:
8  *
9  * Content Repository API for Java Technology, revision 0.12
10  * <http://www.jcp.org/en/jsr/detail?id=170>
11  *
12  * You may not use this file except in compliance with the License.
13  * You may obtain a copy of the License files at
14  *
15  * http://www.day.com/content/en/licenses/day-ri-license-2.0
16  * http://www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an "AS IS" BASIS,
20  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  */

24 package javax.jcr.version;
25
26 import javax.jcr.*;
27 import java.util.*;
28
29 /**
30  * A <code>VersionHistory</code> object wraps an <code>nt:versionHistory</code>
31  * node. It provides convenient access to version history information.
32  */

33 public interface VersionHistory {
34
35   /**
36    * Returns the root version of this version history.
37    *
38    * @return a <code>Version</code> object.
39    * @throws RepositoryException if an error occurs.
40    */

41   public Version getRootVersion() throws RepositoryException;
42
43   /**
44    * Returns an iterator over all the versions within this version history.
45    * The order of the returned objects will not necessarily correspond to the
46    * order of versions in terms of the successor relation. To traverse the
47    * version graph one must traverse the <code>jcr:successor REFERENCE</code>
48    * properties starting with the root version.
49    *
50    * @return a <code>VersionIterator</code> object.
51    * @throws RepositoryException if an error occurs.
52    */

53   public VersionIterator getAllVersions() throws RepositoryException;
54
55   /**
56    * Retrieves a particular version from this version history by version name.
57    *
58    * @param versionName a version name
59    * @return a <code>Version</code> object.
60    * @throws RepositoryException if an error occurs.
61    */

62   public Version getVersion(String JavaDoc versionName) throws RepositoryException;
63
64   /**
65    * Retrieves a particular version from this version history by version date.
66    *
67    * @param date a <code>Calendar</code> object
68    * @return a <code>Version</code> object.
69    * @throws RepositoryException if an error occurs.
70    */

71   public Version getVersion(Calendar date) throws RepositoryException;
72
73
74   /**
75    * Retrieves a particular version from this version history by version label.
76    *
77    * @param label a version label
78    * @return a <code>Version</code> object.
79    * @throws RepositoryException if an error occurs.
80    */

81   public Version getVersionByLabel(String JavaDoc label) throws RepositoryException;
82 }
83
Popular Tags