From 7cf412c3943d58b388dde6b89a8b58c4da66aa95 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Tue, 10 Jul 2007 16:03:42 +0000
Subject: [PATCH] Fix a set of problems with the configuration interface in which there were a number of cases in which insufficient validation was performed.  In particular, if a new configuration object was added over protocol or an existing configuration object was changed from disabled to enabled, then the server would only perform generic validation for that component and would not have any way to perform more detailed validation that could detect larger numbers of problems.

---
 opendj-sdk/opends/src/server/org/opends/server/api/ErrorLogPublisher.java |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/api/ErrorLogPublisher.java b/opendj-sdk/opends/src/server/org/opends/server/api/ErrorLogPublisher.java
index 17840df..c03a398 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/api/ErrorLogPublisher.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/api/ErrorLogPublisher.java
@@ -30,6 +30,7 @@
 
 import java.util.HashSet;
 import java.util.HashMap;
+import java.util.List;
 
 import org.opends.server.admin.std.server.ErrorLogPublisherCfg;
 import org.opends.server.config.ConfigException;
@@ -92,6 +93,39 @@
 
 
   /**
+   * 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.
+   * <BR><BR>
+   * Note that implementations which use a subclass of the provided
+   * configuration class will likely need to cast the configuration
+   * to the appropriate subclass type.
+   *
+   * @param  configuration        The error log publisher
+   *                              configuration for which to make the
+   *                              determination.
+   * @param  unacceptableReasons  A list that may be used to hold the
+   *                              reasons that the provided
+   *                              configuration is not acceptable.
+   *
+   * @return  {@code true} if the provided configuration is acceptable
+   *          for this error log publisher, or {@code false} if not.
+   */
+  public boolean isConfigurationAcceptable(
+                      ErrorLogPublisherCfg configuration,
+                      List<String> unacceptableReasons)
+  {
+    // This default implementation does not perform any special
+    // validation.  It should be overridden by error log publisher
+    // implementations that wish to perform more detailed validation.
+    return true;
+  }
+
+
+
+  /**
    * Close this publisher.
    */
   public abstract void close();

--
Gitblit v1.10.0