Package org.opends.server.extensions
Class SMTPAlertHandler
java.lang.Object
org.opends.server.extensions.SMTPAlertHandler
- All Implemented Interfaces:
ConfigurationChangeListener<SmtpAlertHandlerCfg>,AlertHandler<SmtpAlertHandlerCfg>
public final class SMTPAlertHandler
extends Object
implements AlertHandler<SmtpAlertHandlerCfg>, ConfigurationChangeListener<SmtpAlertHandlerCfg>
This class implements a Directory Server alert handler that may be used to send administrative alerts via SMTP.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyConfigurationChange(SmtpAlertHandlerCfg configuration) Applies the configuration changes to this change listener.voidPerforms any necessary cleanup that may be necessary when this alert handler is finalized.Retrieves the current configuration for this alert handler.voidinitializeAlertHandler(ServerContext serverContext, SmtpAlertHandlerCfg configuration) Initializes this alert handler based on the information in the provided configuration entry.booleanisConfigurationAcceptable(SmtpAlertHandlerCfg configuration, List<LocalizableMessage> unacceptableReasons) Indicates whether the provided configuration is acceptable for this alert handler.booleanisConfigurationChangeAcceptable(SmtpAlertHandlerCfg configuration, List<LocalizableMessage> unacceptableReasons) Indicates whether the proposed change to the configuration is acceptable to this change listener.voidsendAlertNotification(AlertGenerator generator, String alertType, LocalizableMessage alertMessage) Sends an alert notification based on the provided information.
-
Constructor Details
-
SMTPAlertHandler
public SMTPAlertHandler()Creates a new instance of this SMTP alert handler.
-
-
Method Details
-
initializeAlertHandler
public void initializeAlertHandler(ServerContext serverContext, SmtpAlertHandlerCfg configuration) throws ConfigException Description copied from interface:AlertHandlerInitializes this alert handler based on the information in the provided configuration entry.- Specified by:
initializeAlertHandlerin interfaceAlertHandler<SmtpAlertHandlerCfg>- Parameters:
serverContext- The server contextconfiguration- The configuration to use to initialize this alert handler.- Throws:
ConfigException- If the provided entry does not contain a valid configuration for this alert handler.
-
getAlertHandlerConfiguration
Description copied from interface:AlertHandlerRetrieves the current configuration for this alert handler.- Specified by:
getAlertHandlerConfigurationin interfaceAlertHandler<SmtpAlertHandlerCfg>- Returns:
- The current configuration for this alert handler.
-
finalizeAlertHandler
public void finalizeAlertHandler()Description copied from interface:AlertHandlerPerforms any necessary cleanup that may be necessary when this alert handler is finalized.- Specified by:
finalizeAlertHandlerin interfaceAlertHandler<SmtpAlertHandlerCfg>
-
sendAlertNotification
public void sendAlertNotification(AlertGenerator generator, String alertType, LocalizableMessage alertMessage) Description copied from interface:AlertHandlerSends an alert notification based on the provided information.- Specified by:
sendAlertNotificationin interfaceAlertHandler<SmtpAlertHandlerCfg>- Parameters:
generator- The alert generator that created the alert.alertType- The alert type name for this alert.alertMessage- A message (possiblynull) that can provide more information about this alert.
-
isConfigurationAcceptable
public boolean isConfigurationAcceptable(SmtpAlertHandlerCfg configuration, List<LocalizableMessage> unacceptableReasons) Description copied from interface:AlertHandlerIndicates whether the provided configuration is acceptable for this alert handler.- Specified by:
isConfigurationAcceptablein interfaceAlertHandler<SmtpAlertHandlerCfg>- Parameters:
configuration- The configuration for which to make tje determination.unacceptableReasons- A list to which human-readable reasons may be added to explain why the configuration is not acceptable.- Returns:
trueif the provided configuration is acceptable, orfalseif it is not.
-
isConfigurationChangeAcceptable
public boolean isConfigurationChangeAcceptable(SmtpAlertHandlerCfg configuration, List<LocalizableMessage> unacceptableReasons) Description copied from interface:ConfigurationChangeListenerIndicates whether the proposed change to the configuration is acceptable to this change listener.- Specified by:
isConfigurationChangeAcceptablein interfaceConfigurationChangeListener<SmtpAlertHandlerCfg>- 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
trueif the proposed change is acceptable, orfalseif it is not.
-
applyConfigurationChange
Description copied from interface:ConfigurationChangeListenerApplies the configuration changes to this change listener.- Specified by:
applyConfigurationChangein interfaceConfigurationChangeListener<SmtpAlertHandlerCfg>- Parameters:
configuration- The new configuration containing the changes.- Returns:
- Returns information about the result of changing the configuration.
-