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/loggers/debug/DebugLogger.java | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/opends/src/server/org/opends/server/loggers/debug/DebugLogger.java b/opends/src/server/org/opends/server/loggers/debug/DebugLogger.java
index 1d45247..66caf42 100644
--- a/opends/src/server/org/opends/server/loggers/debug/DebugLogger.java
+++ b/opends/src/server/org/opends/server/loggers/debug/DebugLogger.java
@@ -350,10 +350,11 @@
ClassPropertyDefinition pd =
d.getJavaImplementationClassPropertyDefinition();
// Load the class and cast it to a DebugLogPublisher.
+ DebugLogPublisher publisher = null;
Class<? extends DebugLogPublisher> theClass;
try {
theClass = pd.loadClass(className, DebugLogPublisher.class);
- theClass.newInstance();
+ publisher = theClass.newInstance();
} catch (Exception e) {
int msgID = MSGID_CONFIG_LOGGER_INVALID_DEBUG_LOGGER_CLASS;
String message = getMessage(msgID, className,
@@ -367,8 +368,16 @@
// Determine the initialization method to use: it must take a
// single parameter which is the exact type of the configuration
// object.
- theClass.getMethod("initializeDebugLogPublisher", config.definition()
- .getServerConfigurationClass());
+ Method method = theClass.getMethod("isConfigurationAcceptable",
+ DebugLogPublisherCfg.class,
+ List.class);
+ Boolean acceptable = (Boolean) method.invoke(publisher, config,
+ unacceptableReasons);
+
+ if (! acceptable)
+ {
+ return false;
+ }
} catch (Exception e) {
int msgID = MSGID_CONFIG_LOGGER_INVALID_DEBUG_LOGGER_CLASS;
String message = getMessage(msgID, className,
--
Gitblit v1.10.0