1 13 14 package org.ejbca.core.ejb.protect; 15 16 17 import java.util.Date ; 18 19 import javax.ejb.CreateException ; 20 21 import org.ejbca.core.ejb.BaseEntityBean; 22 23 78 public abstract class TableProtectDataBean extends BaseEntityBean { 79 80 public static final String KEYTYPE_HMAC = "HMAC"; 81 82 public static final int CURRENT_VERSION = 1; 83 84 89 public abstract String getId(); 90 91 93 public abstract void setId(String id); 94 95 99 public abstract int getVersion(); 100 101 104 public abstract void setVersion(int version); 105 106 110 public abstract int getHashVersion(); 111 112 115 public abstract void setHashVersion(int version); 116 117 121 public abstract String getProtectionAlg(); 122 123 126 public abstract void setProtectionAlg(String alg); 127 128 132 public abstract String getHash(); 133 134 137 public abstract void setHash(String hash); 138 139 143 public abstract String getSignature(); 144 145 148 public abstract void setSignature(String signature); 149 150 153 public abstract long getTime(); 154 155 158 public abstract void setTime(long time); 159 160 164 public abstract String getDbKey(); 165 166 169 public abstract void setDbKey(String dbKey); 170 171 175 public abstract String getDbType(); 176 177 180 public abstract void setDbType(String dbType); 181 182 186 public abstract String getKeyRef(); 187 188 191 public abstract void setKeyRef(String keyRef); 192 193 197 public abstract String getKeyType(); 198 199 202 public abstract void setKeyType(String keyType); 203 204 207 public Date getTimeAsDate() { 208 return new Date (getTime()); 209 } 210 211 215 public String ejbCreate(String id, int hashVersion, String alg, String hash, String signature, Date time, String dbKey, String dbType, String keyRef, String keyType) throws CreateException { 216 setId(id); 217 setVersion(CURRENT_VERSION); 218 setHashVersion(hashVersion); 219 setProtectionAlg(alg); 220 setHash(hash); 221 setSignature(signature); 222 setTime(time.getTime()); 223 setDbKey(dbKey); 224 setDbType(dbType); 225 setKeyRef(keyRef); 226 setKeyType(keyType); 227 return null; 228 } 229 230 232 public void ejbPostCreate(String id, int hashVersion, String alg, String hash, String signature, Date time, String dbKey, String dbType, String keyRef, String keyType) { 233 } 235 } 236 237 | Popular Tags |