1 13 14 package se.anatom.ejbca.log; 15 16 import javax.ejb.CreateException ; 17 18 import org.ejbca.core.ejb.BaseEntityBean; 19 import org.ejbca.core.model.log.LogEntry; 20 21 22 23 24 76 public abstract class OldLogConfigurationDataBean extends BaseEntityBean { 77 78 83 public abstract Integer getId(); 84 85 87 public abstract void setId(Integer id); 88 89 94 public abstract LogConfiguration getLogConfiguration(); 95 96 98 public abstract void setLogConfiguration(LogConfiguration logConfiguration); 99 100 104 public abstract int getLogEntryRowNumber(); 105 106 108 public abstract void setLogEntryRowNumber(int logEntryRowNumber); 109 110 115 public LogConfiguration loadLogConfiguration() { 116 LogConfiguration logconfiguration = getLogConfiguration(); 117 118 for (int i = 0; i < LogEntry.EVENTNAMES_INFO.length; i++) { 120 if (logconfiguration.getLogEvent(i) == null) { 121 logconfiguration.setLogEvent(i, true); 122 } 123 } 124 125 for (int i = 0; i < LogEntry.EVENTNAMES_ERROR.length; i++) { 126 int index = i + LogEntry.EVENT_ERROR_BOUNDRARY; 127 128 if (logconfiguration.getLogEvent(index) == null) { 129 logconfiguration.setLogEvent(index, true); 130 } 131 } 132 133 return logconfiguration; 134 } 135 136 141 public void saveLogConfiguration(LogConfiguration logConfiguration) { 142 setLogConfiguration(logConfiguration); 143 } 144 145 150 public Integer getAndIncrementRowCount() { 151 int returnval = getLogEntryRowNumber(); 152 setLogEntryRowNumber(returnval + 1); 153 154 return new Integer (returnval); 155 } 156 157 161 171 public Integer ejbCreate(Integer id, LogConfiguration logConfiguration) 172 throws CreateException { 173 setId(id); 174 setLogConfiguration(logConfiguration); 175 setLogEntryRowNumber(0); 176 177 return null; 178 } 179 180 186 public void ejbPostCreate(Integer id, LogConfiguration logConfiguration) { 187 } 189 } 190 | Popular Tags |