KickJava   Java API By Example, From Geeks To Geeks.

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


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.Serializable JavaDoc;
17
18 /**
19  *
20  * @author tomas
21  * @version $Id: TableVerifyResult.java,v 1.2 2006/08/06 12:37:01 anatom Exp $
22  */

23 public class TableVerifyResult implements Serializable JavaDoc {
24
25     private static final long serialVersionUID = -1L;
26     
27     public static final int VERIFY_SUCCESS = 0;
28     public static final int VERIFY_FAILED = 1;
29     public static final int VERIFY_DISABLED = 2;
30     public static final int VERIFY_NO_ROW = 3;
31     public static final int VERIFY_NO_KEY = 4;
32     public static final int VERIFY_WRONG_HASH = 5;
33     public static final int VERIFY_INCOMPATIBLE_ALG = 6;
34     public static final int VERIFY_UNKNOWN_ERROR = 99;
35
36     public static final String JavaDoc VERIFY_SUCCESS_MSG = "VERIFY_SUCCESS";
37     public static final String JavaDoc VERIFY_FAILED_MSG = "VERIFY_FAILED";
38     public static final String JavaDoc VERIFY_DISABLED_MSG = "VERIFY_DISABLED";
39     public static final String JavaDoc VERIFY_NO_ROW_MSG = "VERIFY_NO_ROW";
40     public static final String JavaDoc VERIFY_NO_KEY_MSG = "VERIFY_NO_KEY";
41     public static final String JavaDoc VERIFY_WRONG_HASH_MSG = "VERIFY_WRONG_HASH";
42     public static final String JavaDoc VERIFY_INCOMPATIBLE_ALG_MSG = "VERIFY_INCOMPATIBLE_ALG";
43     public static final String JavaDoc VERIFY_UNKNOWN_ERROR_MSG = "VERIFY_UNKNOWN_ERROR";
44     
45     /** One of the codes above */
46     private int resultCode = VERIFY_SUCCESS;
47
48     public int getResultCode() {
49         return resultCode;
50     }
51
52     public void setResultCode(int resultCode) {
53         this.resultCode = resultCode;
54     }
55
56     public String JavaDoc getResultConstant() {
57         String JavaDoc ret = null;
58         switch (resultCode) {
59         case VERIFY_SUCCESS:
60             ret = VERIFY_SUCCESS_MSG;
61             break;
62         case VERIFY_DISABLED:
63             ret = VERIFY_DISABLED_MSG;
64             break;
65         case VERIFY_FAILED:
66             ret = VERIFY_FAILED_MSG;
67             break;
68         case VERIFY_NO_KEY:
69             ret = VERIFY_NO_KEY_MSG;
70             break;
71         case VERIFY_NO_ROW:
72             ret = VERIFY_NO_ROW_MSG;
73             break;
74         case VERIFY_WRONG_HASH:
75             ret = VERIFY_WRONG_HASH_MSG;
76             break;
77         case VERIFY_INCOMPATIBLE_ALG:
78             ret = VERIFY_INCOMPATIBLE_ALG_MSG;
79             break;
80         case VERIFY_UNKNOWN_ERROR:
81             ret = VERIFY_UNKNOWN_ERROR_MSG;
82             break;
83         default:
84             break;
85         }
86         return ret;
87     }
88
89 }
90
Popular Tags