Package org.opends.server.api
Interface AlertHandler<T extends AlertHandlerCfg>
- Type Parameters:
T- The type of configuration handled by this alert handler.
- All Known Implementing Classes:
JMXAlertHandler,SMTPAlertHandler
public interface AlertHandler<T extends AlertHandlerCfg>
This interface defines the set of methods that must be implemented for a Directory Server alert handler. Alert
handlers are used to present alert notifications in various forms like JMX, e-mail, or paging.
-
Method Summary
Modifier and TypeMethodDescriptionvoidPerforms any necessary cleanup that may be necessary when this alert handler is finalized.Retrieves the current configuration for this alert handler.voidinitializeAlertHandler(ServerContext serverContext, T configuration) Initializes this alert handler based on the information in the provided configuration entry.booleanisConfigurationAcceptable(T configuration, List<LocalizableMessage> unacceptableReasons) Indicates whether the provided configuration is acceptable for this alert handler.voidsendAlertNotification(AlertGenerator generator, String alertType, LocalizableMessage alertMessage) Sends an alert notification based on the provided information.
-
Method Details
-
initializeAlertHandler
void initializeAlertHandler(ServerContext serverContext, T configuration) throws ConfigException, InitializationException Initializes this alert handler based on the information in the provided configuration entry.- 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.InitializationException- If a problem occurs during initialization that is not related to the server configuration.
-
getAlertHandlerConfiguration
AlertHandlerCfg getAlertHandlerConfiguration()Retrieves the current configuration for this alert handler.- Returns:
- The current configuration for this alert handler.
-
isConfigurationAcceptable
Indicates whether the provided configuration is acceptable for this alert handler.- 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.
-
finalizeAlertHandler
void finalizeAlertHandler()Performs any necessary cleanup that may be necessary when this alert handler is finalized. -
sendAlertNotification
void sendAlertNotification(AlertGenerator generator, String alertType, LocalizableMessage alertMessage) Sends an alert notification based on the provided information.- 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.
-