⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oldlogconfigurationdatabean.java

📁 一个免费的CA,基于EJB平台的,老师叫我们测试,现把之共享出来让大家参考
💻 JAVA
字号:
/************************************************************************* *                                                                       * *  EJBCA: The OpenSource Certificate Authority                          * *                                                                       * *  This software is free software; you can redistribute it and/or       * *  modify it under the terms of the GNU Lesser General Public           * *  License as published by the Free Software Foundation; either         * *  version 2.1 of the License, or any later version.                    * *                                                                       * *  See terms of license at gnu.org.                                     * *                                                                       * *************************************************************************/package se.anatom.ejbca.log;import javax.ejb.CreateException;import org.ejbca.core.ejb.BaseEntityBean;import org.ejbca.core.model.log.LogEntry;/** * TODO: remove this whole class method for EJBCA 3.3. *  * Entity bean should not be used directly, use though Session beans. Entity Bean representing the * log configuration data. Information stored: * <pre> * Id (Should always be 0)	 * logConfiguration  is the actual log configuration * logentryrownumber is the number of the last row number in the log entry database. * </pre> * * @version $Id: OldLogConfigurationDataBean.java,v 1.4 2006/11/10 09:29:35 anatom Exp $ * * @ejb.bean *   description="This enterprise bean entity represents a Log Entry with accompanying data" *   display-name="OldLogConfigurationDataEB" *   name="OldLogConfigurationData" *   jndi-name="OldLogConfigurationData" *   view-type="local" *   type="CMP" *   reentrant="False" *   cmp-version="2.x" *   transaction-type="Container" *   schema="OldLogConfigurationDataBean" *   primkey-field="id" * * @ejb.pk *   generate="false" *   class="java.lang.Integer" * * @ejb.persistence table-name = "LogConfigurationData" *  * @ejb.home *   generate="local" *   local-extends="javax.ejb.EJBLocalHome" *   local-class="se.anatom.ejbca.log.OldLogConfigurationDataLocalHome" * * @ejb.interface *   generate="local" *   local-extends="javax.ejb.EJBLocalObject" *   local-class="se.anatom.ejbca.log.OldLogConfigurationDataLocal" * * @ejb.finder *   description="findAll" *   signature="java.util.Collection findAll()" *   query="SELECT OBJECT(a) from OldLogConfigurationDataBean a" *    * @ejb.transaction type="Required" * * @jonas.jdbc-mapping *   jndi-name="${datasource.jndi-name}" */public abstract class OldLogConfigurationDataBean extends BaseEntityBean {    /**     * @ejb.pk-field     * @ejb.persistence column-name="id"     * @ejb.interface-method view-type="local"     */    public abstract Integer getId();    /**     */    public abstract void setId(Integer id);    /**     * @ejb.persistence column-name="logConfiguration"     * @ejb.interface-method view-type="local"     * @weblogic.ora.columntyp@     */    public abstract LogConfiguration getLogConfiguration();    /**     */    public abstract void setLogConfiguration(LogConfiguration logConfiguration);    /**     * @ejb.persistence column-name="logEntryRowNumber"     * @ejb.interface-method view-type="local"     */    public abstract int getLogEntryRowNumber();    /**     */    public abstract void setLogEntryRowNumber(int logEntryRowNumber);    /**     * DOCUMENT ME!     *     * @ejb.interface-method view-type="local"     */    public LogConfiguration loadLogConfiguration() {        LogConfiguration logconfiguration = getLogConfiguration();        // Fill in new information from LogEntry constants.        for (int i = 0; i < LogEntry.EVENTNAMES_INFO.length; i++) {            if (logconfiguration.getLogEvent(i) == null) {                logconfiguration.setLogEvent(i, true);            }        }        for (int i = 0; i < LogEntry.EVENTNAMES_ERROR.length; i++) {            int index = i + LogEntry.EVENT_ERROR_BOUNDRARY;            if (logconfiguration.getLogEvent(index) == null) {                logconfiguration.setLogEvent(index, true);            }        }        return logconfiguration;    }    /**     * DOCUMENT ME!     *     * @ejb.interface-method view-type="local"     */    public void saveLogConfiguration(LogConfiguration logConfiguration) {        setLogConfiguration(logConfiguration);    }    /**     * DOCUMENT ME!     *     * @ejb.interface-method view-type="local"     */    public Integer getAndIncrementRowCount() {        int returnval = getLogEntryRowNumber();        setLogEntryRowNumber(returnval + 1);        return new Integer(returnval);    }    //    // Fields required by Container    //    /**     * Entity Bean holding data of log configuration. Create by sending in the id.     *     * @param id the unique id of logconfiguration (should always be 0).     * @param logConfiguration is the serialized representation of the log configuration.     *     * @return the given id     *     * @ejb.create-method view-type="local"     */    public Integer ejbCreate(Integer id, LogConfiguration logConfiguration)            throws CreateException {        setId(id);        setLogConfiguration(logConfiguration);        setLogEntryRowNumber(0);        return null;    }    /**     * DOCUMENT ME!     *     * @param id DOCUMENT ME!     * @param logConfiguration DOCUMENT ME!     */    public void ejbPostCreate(Integer id, LogConfiguration logConfiguration) {        // Do nothing. Required.    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -