directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1765212 - /directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Date Mon, 17 Oct 2016 05:48:45 GMT
Author: elecharny
Date: Mon Oct 17 05:48:45 2016
New Revision: 1765212

URL: http://svn.apache.org/viewvc?rev=1765212&view=rev
Log:
Made it possible for users to inject a SocketSessionConfig object to override the default
config. See DirAPI-207

Modified:
    directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java

Modified: directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=1765212&r1=1765211&r2=1765212&view=diff
==============================================================================
--- directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
(original)
+++ directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Mon Oct 17 05:48:45 2016
@@ -192,6 +192,9 @@ public class LdapNetworkConnection exten
 
     /** configuration object for the connection */
     private LdapConnectionConfig config;
+    
+    /** The Sockect configuratio */
+    private SocketSessionConfig connectionConfig;
 
     /** The connector open with the remote server */
     private IoConnector connector;
@@ -420,8 +423,15 @@ public class LdapNetworkConnection exten
     {
         // Use only one thread inside the connector
         connector = new NioSocketConnector( 1 );
-
-        ( ( SocketSessionConfig ) connector.getSessionConfig() ).setReuseAddress( true );
+        
+        if ( connectionConfig != null )
+        {
+            ( ( SocketSessionConfig ) connector.getSessionConfig() ).setAll( connectionConfig
);
+        }
+        else
+        {
+            ( ( SocketSessionConfig ) connector.getSessionConfig() ).setReuseAddress( true
);
+        }
 
         // Add the codec to the chain
         connector.getFilterChain().addLast( "ldapCodec", ldapProtocolFilter );
@@ -4364,4 +4374,22 @@ public class LdapNetworkConnection exten
     {
         this.schemaManager = schemaManager;
     }
+
+
+    /**
+     * @return the connectionConfig
+     */
+    public SocketSessionConfig getConnectionConfig()
+    {
+        return connectionConfig;
+    }
+
+
+    /**
+     * @param connectionConfig the connectionConfig to set
+     */
+    public void setConnectionConfig( SocketSessionConfig connectionConfig )
+    {
+        this.connectionConfig = connectionConfig;
+    }
 }



Mime
View raw message