org.opends.server.api
Class ErrorLogPublisher<T extends ErrorLogPublisherCfg>

java.lang.Object
  extended by org.opends.server.api.ErrorLogPublisher<T>
Type Parameters:
T - The type of error log publisher configuration handled by this log publisher implementation.
Direct Known Subclasses:
TextErrorLogPublisher, ThreadFilterTextErrorLogPublisher

@PublicAPI(stability=VOLATILE,
           mayInstantiate=false,
           mayExtend=true,
           mayInvoke=false)
public abstract class ErrorLogPublisher<T extends ErrorLogPublisherCfg>
extends java.lang.Object

This class defines the set of methods and structures that must be implemented for a Directory Server error log publisher.


Field Summary
protected  java.util.HashSet<Severity> defaultSeverities
          The set of default log severities that will be used if no custom severities have been defined for the associated category.
protected  java.util.HashMap<Category,java.util.HashSet<Severity>> definedSeverities
          The hash map that will be used to define specific log severities for the various categories.
 
Constructor Summary
ErrorLogPublisher()
           
 
Method Summary
abstract  void close()
          Close this publisher.
abstract  DN getDN()
          Gets the DN of the configuration entry for this error log publisher.
abstract  void initializeErrorLogPublisher(T config)
          Initializes this access publisher provider based on the information in the provided debug publisher configuration.
 boolean isConfigurationAcceptable(ErrorLogPublisherCfg configuration, java.util.List<Message> unacceptableReasons)
          Indicates whether the provided configuration is acceptable for this error log publisher.
abstract  void logError(Message message)
          Writes a message to the error log using the provided information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

definedSeverities

protected java.util.HashMap<Category,java.util.HashSet<Severity>> definedSeverities
The hash map that will be used to define specific log severities for the various categories.


defaultSeverities

protected java.util.HashSet<Severity> defaultSeverities
The set of default log severities that will be used if no custom severities have been defined for the associated category.

Constructor Detail

ErrorLogPublisher

public ErrorLogPublisher()
Method Detail

initializeErrorLogPublisher

public abstract void initializeErrorLogPublisher(T config)
                                          throws ConfigException,
                                                 InitializationException
Initializes this access publisher provider based on the information in the provided debug publisher configuration.

Parameters:
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.
InitializationException - If a problem occurs during initialization that is not related to the server configuration.

isConfigurationAcceptable

public boolean isConfigurationAcceptable(ErrorLogPublisherCfg configuration,
                                         java.util.List<Message> unacceptableReasons)
Indicates whether the provided configuration is acceptable for this error log publisher. It should be possible to call this method on an uninitialized error log publisher instance in order to determine whether the error log publisher would be able to use the provided configuration.

Note that implementations which use a subclass of the provided configuration class will likely need to cast the configuration to the appropriate subclass type.

Parameters:
configuration - The error log publisher configuration for which to make the determination.
unacceptableReasons - A list that may be used to hold the reasons that the provided configuration is not acceptable.
Returns:
true if the provided configuration is acceptable for this error log publisher, or false if not.

close

public abstract void close()
Close this publisher.


logError

public abstract void logError(Message message)
Writes a message to the error log using the provided information. The message's category and severity information will be used to determine whether to actually log this message.

Parameters:
message - The message to be logged.

getDN

public abstract DN getDN()
Gets the DN of the configuration entry for this error log publisher.

Returns:
The configuration entry DN.