KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejbca > core > model > IUpgradeableData


1 /*************************************************************************
2  * *
3  * EJBCA: The OpenSource Certificate Authority *
4  * *
5  * This software is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU Lesser General Public *
7  * License as published by the Free Software Foundation; either *
8  * version 2.1 of the License, or any later version. *
9  * *
10  * See terms of license at gnu.org. *
11  * *
12  *************************************************************************/

13  
14 package org.ejbca.core.model;
15
16 /**
17  * IUpgradableData is an interface intended to be used by classed saved to database as BLOB. Every
18  * such class should put all it's data in one of the Collection data structures and it will only
19  * be the collection saved to the database. This is to avoid serialization problems when upgrading
20  * the class.
21  *
22  * @version $Id: IUpgradeableData.java,v 1.1 2006/01/17 20:30:56 anatom Exp $
23  */

24 public interface IUpgradeableData {
25     /**
26      * Should return a constant containing the latest available version of the class.
27      *
28      * @return DOCUMENT ME!
29      */

30     public abstract float getLatestVersion();
31
32     /**
33      * Function returning the current version of the class data.
34      *
35      * @return DOCUMENT ME!
36      */

37     public abstract float getVersion();
38
39     /**
40      * Function sending the data to be saved to the database.
41      *
42      * @return DOCUMENT ME!
43      */

44     public abstract Object JavaDoc saveData();
45
46     /**
47      * Function loading saved data into to data structure.
48      */

49     public abstract void loadData(Object JavaDoc data);
50
51     /**
52      * Function that should handle the update of the data in the class so it's up to date with the
53      * latest version.
54      */

55     public abstract void upgrade();
56 }
57
Popular Tags