From df0af76ae6838013c0e66bf5d17c7e7aae44dac2 Mon Sep 17 00:00:00 2001
From: Valery Kharseko <vharseko@3a-systems.ru>
Date: Thu, 01 Oct 2026 09:35:55 +0000
Subject: [PATCH] [#1120] Apply a change to plugin-type on an enabled plugin without disabling and enabling it again (#1127)

---
 opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java
index e69ff72..7ac2c6b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java
@@ -74,6 +74,8 @@
 {
   private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
 
+  /** The configuration which this plugin is registered with as a change listener. */
+  private PasswordPolicyImportPluginCfg currentConfig;
   /** The attribute type used to specify the password policy for an entry. */
   private AttributeType customPolicyAttribute;
   /** The set of attribute types defined in the schema with the auth password syntax. */
@@ -107,6 +109,7 @@
          throws ConfigException
   {
     configuration.addPasswordPolicyImportChangeListener(this);
+    currentConfig = configuration;
 
     Schema schema = DirectoryServer.getInstance().getServerContext().getSchema();
     customPolicyAttribute = schema.getAttributeType(OP_ATTR_PWPOLICY_POLICY_DN);
@@ -224,6 +227,12 @@
   }
 
   @Override
+  public final void finalizePlugin()
+  {
+    currentConfig.removePasswordPolicyImportChangeListener(this);
+  }
+
+  @Override
   public void processImportBegin(LocalBackend<?> backend, LDIFImportConfig config)
   {
     // Find the set of attribute types with the auth password and user password

--
Gitblit v1.10.0