From 5466d1c5eaf7c864ce593b1ebee9903d6383b4b4 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Fri, 14 Sep 2007 15:51:17 +0000
Subject: [PATCH] Revert a change (committed in revision 3066) that added support for changing the plugin type values on the fly and update the configuration definition to indicate that this is not supported and to note that changes to the defined plugin types will only take effect if the plugin is disabled and re-enabled or the server is restarted.

---
 opendj-sdk/opends/src/server/org/opends/server/core/PluginConfigManager.java         |   20 +++++++-------------
 opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/PluginConfiguration.xml |    6 +++++-
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/PluginConfiguration.xml b/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/PluginConfiguration.xml
index cc13da3..6b89ca8 100644
--- a/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/PluginConfiguration.xml
+++ b/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/PluginConfiguration.xml
@@ -91,8 +91,12 @@
   <adm:property name="plugin-type" mandatory="true" multi-valued="true">
     <adm:synopsis>
       The plugin types, which define the conditions under which this plugin
-      should be invoked.
+      should be invoked.  The plugin must be disabled and re-enabled for plugin
+      type changes to take effect.
     </adm:synopsis>
+    <adm:requires-admin-action>
+      <adm:component-restart />
+    </adm:requires-admin-action>
     <adm:syntax>
       <adm:enumeration>
         <adm:value name="startup">
diff --git a/opendj-sdk/opends/src/server/org/opends/server/core/PluginConfigManager.java b/opendj-sdk/opends/src/server/org/opends/server/core/PluginConfigManager.java
index 0f0ee74..e65bf24 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/core/PluginConfigManager.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/core/PluginConfigManager.java
@@ -5411,7 +5411,7 @@
 
 
     // Get the existing plugin if it's already enabled.
-    DirectoryServerPlugin<? extends PluginCfg> existingPlugin =
+    DirectoryServerPlugin existingPlugin =
          registeredPlugins.get(configuration.dn());
 
 
@@ -5441,19 +5441,9 @@
       {
         adminActionRequired = true;
       }
-      //The plugin-types might have been changed. Replace the plugin's
-      //plugin-types with the configuration's plugin-types and re-register the
-      //plugin with new types.
-      Set<PluginType> currPluginTypes = existingPlugin.getPluginTypes();
-      currPluginTypes.clear();
-      for (PluginCfgDefn.PluginType pluginType :
-           configuration.getPluginType())
-      {
-        currPluginTypes.add(getPluginType(pluginType));
-      }
+
       existingPlugin.setInvokeForInternalOperations(
                           configuration.isInvokeForInternalOperations());
-      registerPlugin(existingPlugin, configuration.dn(), currPluginTypes);
 
       return new ConfigChangeResult(resultCode, adminActionRequired, messages);
     }
@@ -5473,7 +5463,11 @@
     }
     catch (InitializationException ie)
     {
-      resultCode = DirectoryServer.getServerErrorResultCode();
+      if (resultCode == ResultCode.SUCCESS)
+      {
+        resultCode = DirectoryServer.getServerErrorResultCode();
+      }
+
       messages.add(ie.getMessageObject());
     }
 

--
Gitblit v1.10.0