| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | * Portions Copyright 2007 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.api; |
| | | |
| | | import org.opends.server.admin.std.server.ErrorLogPublisherCfg; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.InitializationException; |
| | | import org.opends.server.types.ErrorLogCategory; |
| | | import org.opends.server.types.ErrorLogSeverity; |
| | | |
| | | |
| | | import java.util.HashSet; |
| | | import java.util.HashMap; |
| | | |
| | | import org.opends.server.admin.std.server.ErrorLogPublisherCfg; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.types.ErrorLogCategory; |
| | | import org.opends.server.types.ErrorLogSeverity; |
| | | import org.opends.server.types.InitializationException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class defines the set of methods and structures that must be |
| | | * implemented for a Directory Server error log publisher. |
| | | * |
| | | * @param <T> The type of error log publisher configuration handled |
| | | * by this log publisher implementation. |
| | | * @param <T> The type of error log publisher configuration handled |
| | | * by this log publisher implementation. |
| | | */ |
| | | public abstract class ErrorLogPublisher |
| | | <T extends ErrorLogPublisherCfg> |
| | | <T extends ErrorLogPublisherCfg> |
| | | { |
| | | /** |
| | | * The hash map that will be used to define specific log severities |
| | |
| | | */ |
| | | protected HashMap<ErrorLogCategory,HashSet<ErrorLogSeverity>> |
| | | definedSeverities = |
| | | new HashMap<ErrorLogCategory, HashSet<ErrorLogSeverity>>(); |
| | | new HashMap<ErrorLogCategory, HashSet<ErrorLogSeverity>>(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * The set of default log severities that will be used if no custom |
| | | * severities have been defined for the associated category. |
| | | */ |
| | | protected HashSet<ErrorLogSeverity> defaultSeverities = |
| | | new HashSet<ErrorLogSeverity>(); |
| | | protected HashSet<ErrorLogSeverity> |
| | | defaultSeverities = new HashSet<ErrorLogSeverity>(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * Initializes this access publisher provider based on the |
| | | * information in the provided debug publisher configuration. |
| | | * |
| | | * @param config |
| | | * The error publisher configuration that contains the |
| | | * information to use to initialize this error publisher. |
| | | * @throws org.opends.server.config.ConfigException |
| | | * If an unrecoverable problem arises in the process of |
| | | * performing the initialization as a result of the server |
| | | * configuration. |
| | | * @throws org.opends.server.types.InitializationException |
| | | * If a problem occurs during initialization that is not |
| | | * related to the server configuration. |
| | | * @param config The error publisher configuration that contains |
| | | * the information to use to initialize this error |
| | | * publisher. |
| | | * |
| | | * @throws ConfigException If an unrecoverable problem arises in |
| | | * the process of performing the |
| | | * initialization as a result of the |
| | | * server configuration. |
| | | * |
| | | * @throws InitializationException If a problem occurs during |
| | | * initialization that is not |
| | | * related to the server |
| | | * configuration. |
| | | */ |
| | | public abstract void initializeErrorLogPublisher(T config) |
| | | throws ConfigException, InitializationException; |
| | | throws ConfigException, InitializationException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Close this publisher. |
| | | */ |
| | | public abstract void close(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * Writes a message to the error log using the provided information. |
| | | * |
| | |
| | | String message, int errorID); |
| | | |
| | | } |
| | | |