KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejbca > core > model > protect > Protectable


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.protect;
15
16 import java.io.UnsupportedEncodingException JavaDoc;
17 import java.security.NoSuchAlgorithmException JavaDoc;
18 import java.security.NoSuchProviderException JavaDoc;
19
20 /**
21  *
22  * @author tomas
23  * @version $Id: Protectable.java,v 1.1 2006/08/05 09:59:38 anatom Exp $
24  */

25 public interface Protectable {
26
27     /** Creates and returns the hash code created from the object, the version
28      * parameter can be used to handle upgrades to the class, since the hash must
29      * always be the same, even if this method is caled one year later.
30      *
31      * @param dataVersion version of class/hash requested.
32      * @return String hash value
33      */

34     public String JavaDoc getHash(int hashVersion) throws NoSuchAlgorithmException JavaDoc, NoSuchProviderException JavaDoc, UnsupportedEncodingException JavaDoc;
35     
36     /** The same as above, but returns the hash value for the current version of the object
37      *
38      * @return hash value
39      */

40     public String JavaDoc getHash() throws NoSuchAlgorithmException JavaDoc, NoSuchProviderException JavaDoc, UnsupportedEncodingException JavaDoc;
41     
42     public int getHashVersion();
43     
44     /** Returns the String form of the primary key for the database table that
45      * this object is stored in.
46      *
47      * @return String Stringform of primary database key, used as key in the protection database table.
48      */

49     public String JavaDoc getDbKeyString();
50     
51     /** Returns a unique type string for these kinds of objects, for example LOGENTRY.
52      *
53      * @return String can be anything, as long as it is always the same.
54      */

55     public String JavaDoc getEntryType();
56 }
57
Popular Tags