1 13 14 package org.ejbca.core.ejb.ra.raadmin; 15 16 import javax.ejb.CreateException ; 17 import java.util.HashMap ; 18 import org.apache.log4j.Logger; 19 import org.ejbca.core.ejb.BaseEntityBean; 20 import org.ejbca.core.model.ra.raadmin.GlobalConfiguration; 21 22 23 24 69 public abstract class GlobalConfigurationDataBean extends BaseEntityBean { 70 71 private static final Logger log = Logger.getLogger(GlobalConfigurationDataBean.class); 72 73 78 public abstract String getConfigurationId(); 79 80 82 public abstract void setConfigurationId(String id); 83 84 88 public abstract HashMap getData(); 89 90 92 public abstract void setData(HashMap data); 93 94 98 public GlobalConfiguration getGlobalConfiguration(){ 99 GlobalConfiguration returnval = new GlobalConfiguration(); 100 returnval.loadData(getData()); 101 return returnval; 102 } 103 104 108 public void setGlobalConfiguration(GlobalConfiguration globalconfiguration){ 109 setData((HashMap ) globalconfiguration.saveData()); 110 } 111 115 116 124 public String ejbCreate(String configurationId, GlobalConfiguration globalConfiguration) throws CreateException { 125 126 setConfigurationId(configurationId); 127 setGlobalConfiguration(globalConfiguration); 128 129 log.debug("Created global configuration "+configurationId); 130 return configurationId; 131 } 132 133 public void ejbPostCreate(String id, GlobalConfiguration globalconfiguration) { 134 } 136 } 137 | Popular Tags |