KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > alfresco > service > cmr > version > VersionHistory


1 /*
2  * Copyright (C) 2005 Alfresco, Inc.
3  *
4  * Licensed under the Mozilla Public License version 1.1
5  * with a permitted attribution clause. You may obtain a
6  * copy of the License at
7  *
8  * http://www.alfresco.org/legal/license.txt
9  *
10  * Unless required by applicable law or agreed to in writing,
11  * software distributed under the License is distributed on an
12  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13  * either express or implied. See the License for the specific
14  * language governing permissions and limitations under the
15  * License.
16  */

17 package org.alfresco.service.cmr.version;
18
19 import java.io.Serializable JavaDoc;
20 import java.util.Collection JavaDoc;
21
22
23
24 /**
25  * Version history interface.
26  *
27  * Collects the versions that make-up a version history.
28  *
29  * @author Roy Wetherall
30  */

31 public interface VersionHistory extends Serializable JavaDoc
32 {
33     /**
34      * Gets the root (or initial) version of the version history.
35      *
36      * @return the root version
37      */

38     public Version getRootVersion();
39     
40     /**
41      * Gets a collection containing all the versions within the
42      * version history.
43      * <p>
44      * The order of the versions is not guarenteed.
45      *
46      * @return collection containing all the versions
47      */

48     public Collection JavaDoc<Version> getAllVersions();
49
50     /**
51      * Gets the predecessor of a specified version
52      *
53      * @param version the version object
54      * @return the predeceeding version, null if root version
55      */

56     public Version getPredecessor(Version version);
57
58     /**
59      * Gets the succeeding versions of a specified version.
60      *
61      * @param version the version object
62      * @return a collection containing the succeeding version, empty is none
63      */

64     public Collection JavaDoc<Version> getSuccessors(Version version);
65     
66     /**
67      * Gets a version with a specified version label. The version label is guarenteed
68      * unique within the version history.
69      *
70      * @param versionLabel the version label
71      * @return the version object
72      * @throws VersionDoesNotExistException indicates requested version does not exisit
73      */

74     public Version getVersion(String JavaDoc versionLabel);
75
76 }
77
Popular Tags