From efbc2ca28bd36a2f5b712ecd9da9dfead7692614 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Thu, 19 Jul 2007 20:24:00 +0000
Subject: [PATCH] Update the server so that the set of alert handlers are configurable rather than simply using a hard-coded JMX alert handler.

---
 opendj-sdk/opends/src/server/org/opends/server/api/AlertHandler.java |   35 +++++++++++++++++++++++++++++------
 1 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/api/AlertHandler.java b/opendj-sdk/opends/src/server/org/opends/server/api/AlertHandler.java
index 4f29363..a123ec6 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/api/AlertHandler.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/api/AlertHandler.java
@@ -28,7 +28,9 @@
 
 
 
-import org.opends.server.config.ConfigEntry;
+import java.util.List;
+
+import org.opends.server.admin.std.server.AlertHandlerCfg;
 import org.opends.server.config.ConfigException;
 import org.opends.server.types.InitializationException;
 
@@ -39,16 +41,18 @@
  * for a Directory Server alert handler.  Alert handlers are used to
  * present alert notifications in various forms like JMX, e-mail, or
  * paging.
+ *
+ * @param  <T>  The type of configuration handled by this alert
+ *              handler.
  */
-public interface AlertHandler
+public interface AlertHandler<T extends AlertHandlerCfg>
 {
   /**
    * Initializes this alert handler based on the information in the
    * provided configuration entry.
    *
-   * @param  configEntry  The configuration entry that contains the
-   *                      information to use to initialize this alert
-   *                      handler.
+   * @param  configuration  The configuration to use to initialize
+   *                        this alert handler.
    *
    * @throws  ConfigException  If the provided entry does not contain
    *                           a valid configuration for this alert
@@ -59,12 +63,31 @@
    *                                   related to the server
    *                                   configuration.
    */
-  public void initializeAlertHandler(ConfigEntry configEntry)
+  public void initializeAlertHandler(T configuration)
        throws ConfigException, InitializationException;
 
 
 
   /**
+   * Indicates whether the provided configuration is acceptable for
+   * this alert handler.
+   *
+   * @param  configuration        The configuration for which to make
+   *                              tje determination.
+   * @param  unacceptableReasons  A list to which human-readable
+   *                              reasons may be added to explain why
+   *                              the configuration is not acceptable.
+   *
+   * @return  {@code true} if the provided configuration is
+   *          acceptable, or {@code false} if it is not.
+   */
+  public boolean isConfigurationAcceptable(
+                      AlertHandlerCfg configuration,
+                      List<String> unacceptableReasons);
+
+
+
+  /**
    * Performs any necessary cleanup that may be necessary when this
    * alert handler is finalized.
    */

--
Gitblit v1.10.0