mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

neil_a_wilson
26.24.2006 cf6ce939e5b551c147d76a86c91345622916756a
Update the LDAP connection handler to ensure that it invokes the post-connect
plugins at the appropriate time. Update the LDAP client connection to ensure
that it invokes the post-disconnect plugins at the appropriate time.

OpenDS Issue Number: 728
2 files modified
29 ■■■■■ changed files
opends/src/server/org/opends/server/protocols/ldap/LDAPClientConnection.java 13 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java 16 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/protocols/ldap/LDAPClientConnection.java
@@ -56,6 +56,7 @@
import org.opends.server.core.ModifyDNOperation;
import org.opends.server.core.Operation;
import org.opends.server.core.PersistentSearch;
import org.opends.server.core.PluginConfigManager;
import org.opends.server.core.SearchOperation;
import org.opends.server.core.UnbindOperation;
import org.opends.server.extensions.NullConnectionSecurityProvider;
@@ -1125,7 +1126,17 @@
    }
    // NYI -- Invoke the post-disconnect plugins.
    try
    {
      PluginConfigManager pluginManager =
           DirectoryServer.getPluginConfigManager();
      pluginManager.invokePostDisconnectPlugins(this, disconnectReason,
                                                messageID, message);
    }
    catch (Exception e)
    {
      assert debugException(CLASS_NAME, "disconnect", e);
    }
  }
opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java
@@ -50,8 +50,10 @@
import org.opends.server.api.ConfigurableComponent;
import org.opends.server.api.ConnectionHandler;
import org.opends.server.api.ConnectionSecurityProvider;
import org.opends.server.api.plugin.PostConnectPluginResult;
import org.opends.server.core.DirectoryServer;
import org.opends.server.core.InitializationException;
import org.opends.server.core.PluginConfigManager;
import org.opends.server.config.BooleanConfigAttribute;
import org.opends.server.config.ConfigAttribute;
import org.opends.server.config.ConfigEntry;
@@ -1279,9 +1281,21 @@
                  }
                  // If we've gotten here, then we'll take the connection so
                  // choose a request handler and register the client with it.
                  // invoke the post-connect plugins and register the client
                  // connection with a request handler.
                  try
                  {
                    PluginConfigManager pluginManager =
                         DirectoryServer.getPluginConfigManager();
                    PostConnectPluginResult pluginResult =
                         pluginManager.invokePostConnectPlugins(
                              clientConnection);
                    if (pluginResult.connectionTerminated())
                    {
                      iterator.remove();
                      continue;
                    }
                    LDAPRequestHandler requestHandler =
                         requestHandlers[requestHandlerIndex++];
                    if (requestHandlerIndex >= numRequestHandlers)