From 959c9ded0c297d00500678a0c80d7d6d8a5265fe 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.

---
 opends/src/server/org/opends/server/api/EntryCache.java |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/api/EntryCache.java b/opends/src/server/org/opends/server/api/EntryCache.java
index a7ae1c7..57c01f6 100644
--- a/opends/src/server/org/opends/server/api/EntryCache.java
+++ b/opends/src/server/org/opends/server/api/EntryCache.java
@@ -91,6 +91,38 @@
 
 
   /**
+   * Indicates whether the provided configuration is acceptable for
+   * this entry cache.  It should be possible to call this method on
+   * an uninitialized entry cache instance in order to determine
+   * whether the entry cache 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 entry cache 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 entry cache, or {@code false} if not.
+   */
+  public boolean isConfigurationAcceptable(
+                      EntryCacheCfg configuration,
+                      List<String> unacceptableReasons)
+  {
+    // This default implementation does not perform any special
+    // validation.  It should be overridden by entry cache
+    // implementations that wish to perform more detailed validation.
+    return true;
+  }
+
+
+
+  /**
    * Performs any necessary cleanup work (e.g., flushing all cached
    * entries and releasing any other held resources) that should be
    * performed when the server is to be shut down or the entry cache

--
Gitblit v1.10.0