org.opends.server.extensions
Class ErrorLogAccountStatusNotificationHandler

java.lang.Object
  extended by org.opends.server.api.AccountStatusNotificationHandler<ErrorLogAccountStatusNotificationHandlerCfg>
      extended by org.opends.server.extensions.ErrorLogAccountStatusNotificationHandler
All Implemented Interfaces:
ConfigurationChangeListener<ErrorLogAccountStatusNotificationHandlerCfg>

public class ErrorLogAccountStatusNotificationHandler
extends AccountStatusNotificationHandler<ErrorLogAccountStatusNotificationHandlerCfg>
implements ConfigurationChangeListener<ErrorLogAccountStatusNotificationHandlerCfg>

This class defines an account status notification handler that will write information about status notifications using the Directory Server's error logging facility.


Constructor Summary
ErrorLogAccountStatusNotificationHandler()
           
 
Method Summary
 ConfigChangeResult applyConfigurationChange(ErrorLogAccountStatusNotificationHandlerCfg configuration)
          Applies the configuration changes to this change listener.
 ConfigChangeResult applyConfigurationChange(ErrorLogAccountStatusNotificationHandlerCfg configuration, boolean detailedResults)
          Makes a best-effort attempt to apply the configuration contained in the provided entry.
 void handleStatusNotification(AccountStatusNotification notification)
          Performs any processing that may be necessary in conjunction with the provided account status notification.
 void initializeStatusNotificationHandler(ErrorLogAccountStatusNotificationHandlerCfg configuration)
          Initializes this account status notification handler based on the information in the provided configuration entry.
 boolean isConfigurationAcceptable(AccountStatusNotificationHandlerCfg configuration, java.util.List<Message> unacceptableReasons)
          Indicates whether the provided configuration is acceptable for this account status notification handler.
 boolean isConfigurationChangeAcceptable(ErrorLogAccountStatusNotificationHandlerCfg configuration, java.util.List<Message> unacceptableReasons)
          Indicates whether the proposed change to the configuration is acceptable to this change listener.
 boolean processNotificationHandlerConfig(ErrorLogAccountStatusNotificationHandlerCfg configuration, boolean applyChanges)
          Parses the provided configuration and configure the notification handler.
 
Methods inherited from class org.opends.server.api.AccountStatusNotificationHandler
finalizeStatusNotificationHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErrorLogAccountStatusNotificationHandler

public ErrorLogAccountStatusNotificationHandler()
Method Detail

initializeStatusNotificationHandler

public void initializeStatusNotificationHandler(ErrorLogAccountStatusNotificationHandlerCfg configuration)
                                         throws ConfigException,
                                                InitializationException
Initializes this account status notification handler based on the information in the provided configuration entry.

Specified by:
initializeStatusNotificationHandler in class AccountStatusNotificationHandler<ErrorLogAccountStatusNotificationHandlerCfg>
Parameters:
configuration - The configuration entry that contains the information to use to initialize this account status notification handler.
Throws:
ConfigException - If the provided entry does not contain a valid configuration for this account status notification handler.
InitializationException - If a problem occurs during initialization that is not related to the server configuration.

handleStatusNotification

public void handleStatusNotification(AccountStatusNotification notification)
Performs any processing that may be necessary in conjunction with the provided account status notification.

Specified by:
handleStatusNotification in class AccountStatusNotificationHandler<ErrorLogAccountStatusNotificationHandlerCfg>
Parameters:
notification - The account status notification to be processed.

isConfigurationAcceptable

public boolean isConfigurationAcceptable(AccountStatusNotificationHandlerCfg configuration,
                                         java.util.List<Message> unacceptableReasons)
Indicates whether the provided configuration is acceptable for this account status notification handler. It should be possible to call this method on an uninitialized account status notification handler instance in order to determine whether the handler 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.

Overrides:
isConfigurationAcceptable in class AccountStatusNotificationHandler<ErrorLogAccountStatusNotificationHandlerCfg>
Parameters:
configuration - The account status notification handler 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 account status notification handler, or false if not.

isConfigurationChangeAcceptable

public boolean isConfigurationChangeAcceptable(ErrorLogAccountStatusNotificationHandlerCfg configuration,
                                               java.util.List<Message> unacceptableReasons)
Indicates whether the proposed change to the configuration is acceptable to this change listener.

Specified by:
isConfigurationChangeAcceptable in interface ConfigurationChangeListener<ErrorLogAccountStatusNotificationHandlerCfg>
Parameters:
configuration - The new configuration containing the changes.
unacceptableReasons - A list that can be used to hold messages about why the provided configuration is not acceptable.
Returns:
Returns true if the proposed change is acceptable, or false if it is not.

applyConfigurationChange

public ConfigChangeResult applyConfigurationChange(ErrorLogAccountStatusNotificationHandlerCfg configuration,
                                                   boolean detailedResults)
Makes a best-effort attempt to apply the configuration contained in the provided entry. Information about the result of this processing should be added to the provided message list. Information should always be added to this list if a configuration change could not be applied. If detailed results are requested, then information about the changes applied successfully (and optionally about parameters that were not changed) should also be included.

Parameters:
configuration - The entry containing the new configuration to apply for this component.
detailedResults - Indicates whether detailed information about the processing should be added to the list.
Returns:
Information about the result of the configuration update.

applyConfigurationChange

public ConfigChangeResult applyConfigurationChange(ErrorLogAccountStatusNotificationHandlerCfg configuration)
Applies the configuration changes to this change listener.

Specified by:
applyConfigurationChange in interface ConfigurationChangeListener<ErrorLogAccountStatusNotificationHandlerCfg>
Parameters:
configuration - The new configuration containing the changes.
Returns:
Returns information about the result of changing the configuration.

processNotificationHandlerConfig

public boolean processNotificationHandlerConfig(ErrorLogAccountStatusNotificationHandlerCfg configuration,
                                                boolean applyChanges)
Parses the provided configuration and configure the notification handler.

Parameters:
configuration - The new configuration containing the changes.
applyChanges - If true then take into account the new configuration.
Returns:
The mapping between strings of character set values and the minimum number of characters required from those sets.