From 90ddf1f7538c304fe99c80813e5860bb89025c51 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Sun, 24 Jun 2007 01:38:21 +0000
Subject: [PATCH] Update the set of plugins included with the server so that they will look for changes to the set of registered plugin types and reject the change if any of the new plugin types are not appropriate.
---
opends/src/server/org/opends/server/plugins/profiler/ProfilerPlugin.java | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/opends/src/server/org/opends/server/plugins/profiler/ProfilerPlugin.java b/opends/src/server/org/opends/server/plugins/profiler/ProfilerPlugin.java
index bd54584..a798cd4 100644
--- a/opends/src/server/org/opends/server/plugins/profiler/ProfilerPlugin.java
+++ b/opends/src/server/org/opends/server/plugins/profiler/ProfilerPlugin.java
@@ -34,6 +34,7 @@
import java.util.Set;
import org.opends.server.admin.server.ConfigurationChangeListener;
+import org.opends.server.admin.std.meta.PluginCfgDefn;
import org.opends.server.admin.std.server.ProfilerPluginCfg;
import org.opends.server.api.plugin.DirectoryServerPlugin;
import org.opends.server.api.plugin.PluginType;
@@ -251,6 +252,31 @@
{
boolean configAcceptable = true;
+ // Make sure that the plugin is only registered as a startup plugin.
+ if (configuration.getPluginType().isEmpty())
+ {
+ int msgID = MSGID_PLUGIN_PROFILER_NO_PLUGIN_TYPES;
+ String message = getMessage(msgID, String.valueOf(configEntryDN));
+ unacceptableReasons.add(message);
+ configAcceptable = false;
+ }
+ else
+ {
+ for (PluginCfgDefn.PluginType t : configuration.getPluginType())
+ {
+ if (t != PluginCfgDefn.PluginType.STARTUP)
+ {
+ int msgID = MSGID_PLUGIN_PROFILER_INVALID_PLUGIN_TYPE;
+ String message = getMessage(msgID, String.valueOf(configEntryDN),
+ String.valueOf(t));
+ unacceptableReasons.add(message);
+ configAcceptable = false;
+ break;
+ }
+ }
+ }
+
+
// Make sure that the profile directory exists.
File profileDirectory = getFileForPath(configuration.getProfileDirectory());
if (! (profileDirectory.exists() && profileDirectory.isDirectory()))
--
Gitblit v1.10.0