1 13 14 package org.ejbca.core.model.protect; 15 16 import java.io.Serializable ; 17 18 23 public class TableVerifyResult implements Serializable { 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 VERIFY_SUCCESS_MSG = "VERIFY_SUCCESS"; 37 public static final String VERIFY_FAILED_MSG = "VERIFY_FAILED"; 38 public static final String VERIFY_DISABLED_MSG = "VERIFY_DISABLED"; 39 public static final String VERIFY_NO_ROW_MSG = "VERIFY_NO_ROW"; 40 public static final String VERIFY_NO_KEY_MSG = "VERIFY_NO_KEY"; 41 public static final String VERIFY_WRONG_HASH_MSG = "VERIFY_WRONG_HASH"; 42 public static final String VERIFY_INCOMPATIBLE_ALG_MSG = "VERIFY_INCOMPATIBLE_ALG"; 43 public static final String VERIFY_UNKNOWN_ERROR_MSG = "VERIFY_UNKNOWN_ERROR"; 44 45 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 getResultConstant() { 57 String 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 |