1 13 14 package org.ejbca.core.ejb.log; 15 16 17 import javax.ejb.CreateException ; 18 19 import org.ejbca.core.ejb.BaseEntityBean; 20 import org.ejbca.core.model.log.LogEntry; 21 import org.ejbca.util.StringTools; 22 23 24 import java.util.Date ; 25 26 77 public abstract class LogEntryDataBean extends BaseEntityBean { 78 79 84 public abstract Integer getId(); 85 86 88 public abstract void setId(Integer id); 89 90 94 public abstract int getAdminType(); 95 96 98 public abstract void setAdminType(int admintype); 99 100 104 public abstract String getAdminData(); 105 106 108 public abstract void setAdminData(String admindata); 109 110 114 public abstract int getCaId(); 115 116 118 public abstract void setCaId(int caid); 119 120 124 public abstract int getModule(); 125 126 128 public abstract void setModule(int module); 129 130 133 public abstract long getTime(); 134 135 137 public abstract void setTime(long time); 138 139 143 public abstract String getUsername(); 144 145 147 public abstract void setUsername(String username); 148 149 153 public abstract String getCertificateSNR(); 154 155 157 public abstract void setCertificateSNR(String certificatesnr); 158 159 163 public abstract int getEvent(); 164 165 167 public abstract void setEvent(int event); 168 169 178 public abstract String getComment(); 179 180 182 public abstract void setComment(String comment); 183 184 187 public Date getTimeAsDate() { 188 return new Date (getTime()); 189 } 190 191 196 public LogEntry getLogEntry() { 197 return new LogEntry(getId().intValue(), getAdminType(), getAdminData(), getCaId(), getModule(), getTimeAsDate(), getUsername(), getCertificateSNR(), getEvent(), getComment()); 198 } 199 200 204 public Integer ejbCreate(Integer id, int admintype, String admindata, int caid, int module, Date time, String username, String certificatesnr, int event, String comment) throws CreateException { 205 setId(id); 206 setAdminType(admintype); 207 setAdminData(admindata); 208 setCaId(caid); 209 setModule(module); 210 setTime(time.getTime()); 211 setUsername(StringTools.strip(username)); 212 setCertificateSNR(certificatesnr); 213 setEvent(event); 214 setComment(comment); 215 return null; 216 } 217 218 220 public void ejbPostCreate(Integer id, int admintype, String admindata, int caid, int module, Date time, String username, String certificatesnr, int event, String comment) { 221 } 223 } 224 225 | Popular Tags |