1 13 14 19 package org.ejbca.core.model.hardtoken; 20 21 import java.io.Serializable ; 22 import java.util.ArrayList ; 23 import java.util.HashMap ; 24 import java.util.Iterator ; 25 26 import org.ejbca.core.model.UpgradeableDataHashMap; 27 28 35 public class HardTokenIssuer extends UpgradeableDataHashMap implements Serializable , Cloneable { 36 37 public static final float LATEST_VERSION = 1; 39 40 protected static final String AVAILABLEHARDTOKENSPROFILES = "availablehardtokensprofiles"; 42 protected static final String DESCRIPTION = "description"; 43 45 public HardTokenIssuer(){ 46 data.put(AVAILABLEHARDTOKENSPROFILES,new ArrayList ()); 47 data.put(DESCRIPTION,""); 48 } 49 50 52 public ArrayList getAvailableHardTokenProfiles(){ 54 return (ArrayList ) data.get(AVAILABLEHARDTOKENSPROFILES); 55 } 56 57 public void setAvailableHardTokenProfiles(ArrayList availablehardtokens){ 58 data.put(AVAILABLEHARDTOKENSPROFILES,availablehardtokens); 59 } 60 61 public String getDescription(){ 62 return (String ) data.get(DESCRIPTION); 63 } 64 65 public void setDescription(String description){ 66 data.put(DESCRIPTION, description); 67 } 68 69 public void setField(String field, Object value){ 70 data.put(field,value); 71 } 72 73 74 public float getLatestVersion(){ 75 return LATEST_VERSION; 76 } 77 78 79 80 public void upgrade(){ 81 } 82 83 public Object clone() throws CloneNotSupportedException { 84 HardTokenIssuer clone = new HardTokenIssuer(); 85 HashMap clonedata = (HashMap ) clone.saveData(); 86 87 Iterator i = (data.keySet()).iterator(); 88 while(i.hasNext()){ 89 Object key = i.next(); 90 clonedata.put(key,data.get(key)); 91 } 92 93 clone.loadData(clonedata); 94 return clone; 95 } 96 97 } 98 | Popular Tags |