directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1778643 - /directory/shared/branches/shared-value/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Date Fri, 13 Jan 2017 18:09:06 GMT
Author: elecharny
Date: Fri Jan 13 18:09:06 2017
New Revision: 1778643

URL: http://svn.apache.org/viewvc?rev=1778643&view=rev
Log:
o Added a isSecured() method
o Always try to connect for each operation if we weren't connected before

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=1778643&r1=1778642&r2=1778643&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
Fri Jan 13 18:09:06 2017
@@ -530,6 +530,17 @@ public class LdapNetworkConnection exten
 
 
     /**
+     * Tells if the connection is using a secured channel
+     * 
+     * @return <tt>true</tt> if the session is using a secured channel
+     */
+    public boolean isSecured()
+    {
+        return isConnected() && ldapSession.isSecured();
+    }
+
+    
+    /**
      * Check that a session is valid, ie we can send requests to the
      * server
      *
@@ -1019,6 +1030,9 @@ public class LdapNetworkConnection exten
             throw new IllegalArgumentException( msg );
         }
 
+        // try to connect, if we aren't already connected.
+        connect();
+
         checkSession();
 
         int newId = messageId.incrementAndGet();
@@ -1796,6 +1810,9 @@ public class LdapNetworkConnection exten
             throw new IllegalArgumentException( msg );
         }
 
+        // try to connect, if we aren't already connected.
+        connect();
+
         // If the session has not been establish, or is closed, we get out immediately
         checkSession();
 
@@ -2478,6 +2495,9 @@ public class LdapNetworkConnection exten
             throw new IllegalArgumentException( msg );
         }
 
+        // try to connect, if we aren't already connected.
+        connect();
+
         checkSession();
 
         int newId = messageId.incrementAndGet();
@@ -2807,6 +2827,9 @@ public class LdapNetworkConnection exten
             throw new IllegalArgumentException( msg );
         }
 
+        // try to connect, if we aren't already connected.
+        connect();
+
         checkSession();
 
         int newId = messageId.incrementAndGet();
@@ -2993,6 +3016,9 @@ public class LdapNetworkConnection exten
             throw new IllegalArgumentException( msg );
         }
 
+        // try to connect, if we aren't already connected.
+        connect();
+
         checkSession();
 
         int newId = messageId.incrementAndGet();
@@ -3177,6 +3203,9 @@ public class LdapNetworkConnection exten
             throw new IllegalArgumentException( msg );
         }
 
+        // try to connect, if we aren't already connected.
+        connect();
+
         checkSession();
 
         int newId = messageId.incrementAndGet();
@@ -3324,6 +3353,9 @@ public class LdapNetworkConnection exten
             throw new IllegalArgumentException( msg );
         }
 
+        // try to connect, if we aren't already connected.
+        connect();
+
         checkSession();
 
         int newId = messageId.incrementAndGet();
@@ -3925,6 +3957,9 @@ public class LdapNetworkConnection exten
                 throw new LdapException( "Cannot use TLS when the useSsl flag is set true
in the configuration" );
             }
 
+            // try to connect, if we aren't already connected.
+            connect();
+
             checkSession();
 
             IoFilter sslFilter = ldapSession.getFilterChain().get( SSL_FILTER_KEY );



Mime
View raw message