directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1125690 - in /directory: apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/
Date Sat, 21 May 2011 13:08:23 GMT
Author: elecharny
Date: Sat May 21 13:08:23 2011
New Revision: 1125690

URL: http://svn.apache.org/viewvc?rev=1125690&view=rev
Log:
Fix for DIRSHARED-115 : made the bind() and asyncBind() methods using the LdapConnectionConfig,
and created a anonymousBind() and anonymousBindAsync() methods

Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapAsyncConnection.java
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java?rev=1125690&r1=1125689&r2=1125690&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
Sat May 21 13:08:23 2011
@@ -1145,6 +1145,16 @@ public class LdapCoreSessionConnection i
      */
     public void bind() throws LdapException, IOException
     {
+        throw new UnsupportedOperationException(
+        "Bind operation using LdapConnectionConfig are not supported on CoreSession based
connection" );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void anonymousBind() throws LdapException, IOException
+    {
         BindRequest bindRequest = new BindRequestImpl();
         bindRequest.setName( Dn.EMPTY_DN );
         bindRequest.setCredentials( ( byte[] ) null );

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapAsyncConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapAsyncConnection.java?rev=1125690&r1=1125689&r2=1125690&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapAsyncConnection.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapAsyncConnection.java
Sat May 21 13:08:23 2011
@@ -74,7 +74,7 @@ public interface LdapAsyncConnection ext
 
 
     /**
-     * Anonymous asynchronous Bind on a server. 
+     * Asynchronous Bind on a server, using the LdapConnectionConfig informations. 
      *
      * @return the bind operation's future
      * @throws LdapException if some error occurred
@@ -84,6 +84,16 @@ public interface LdapAsyncConnection ext
 
 
     /**
+     * Anonymous asynchronous Bind on a server. 
+     *
+     * @return the bind operation's future
+     * @throws LdapException if some error occurred
+     * @throws IOException if some IO error occurred
+     */
+    BindFuture anonymousBindAsync() throws LdapException, IOException;
+
+
+    /**
      * Simple asynchronous Bind on a server.
      *
      * @param name The name we use to authenticate the user, it must be a valid Dn

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java?rev=1125690&r1=1125689&r2=1125690&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
Sat May 21 13:08:23 2011
@@ -143,7 +143,7 @@ public interface LdapConnection
 
 
     /**
-     * Anonymous Bind on a server.
+     * Bind on a server, using the LdapConnectionConfig informations
      *
      * @return The BindResponse LdapResponse
      * @throws LdapException if some error occurred
@@ -153,6 +153,16 @@ public interface LdapConnection
 
 
     /**
+     * Anonymous Bind on a server.
+     *
+     * @return The BindResponse LdapResponse
+     * @throws LdapException if some error occurred
+     * @throws IOException if an I/O exception occurred
+     */
+    void anonymousBind() throws LdapException, IOException;
+
+
+    /**
      * Unauthenticated authentication bind
      *
      * @param name The name we use to authenticate the user. It must be a

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=1125690&r1=1125689&r2=1125690&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Sat May 21 13:08:23 2011
@@ -895,10 +895,27 @@ public class LdapNetworkConnection exten
      */
     public void bind() throws LdapException, IOException
     {
+        LOG.debug( "Bind request" );
+
+        // Create the BindRequest
+        BindRequest bindRequest = createBindRequest( config.getName(), Strings.getBytesUtf8(
config.getCredentials() ) );
+
+        BindResponse bindResponse = bind( bindRequest );
+        
+        processResponse( bindResponse );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void anonymousBind() throws LdapException, IOException
+    {
         LOG.debug( "Anonymous Bind request" );
 
+        
         // Create the BindRequest
-        BindRequest bindRequest = createBindRequest( StringConstants.EMPTY, StringConstants.EMPTY_BYTES
);
+        BindRequest bindRequest = createBindRequest( config.getName(), Strings.getBytesUtf8(
config.getCredentials() ) );
 
         BindResponse bindResponse = bind( bindRequest );
         
@@ -911,7 +928,22 @@ public class LdapNetworkConnection exten
      */
     public BindFuture bindAsync() throws LdapException, IOException
     {
-        LOG.debug( "Anonymous Bind request" );
+        LOG.debug( "Asynchronous Bind request" );
+
+        
+        // Create the BindRequest
+        BindRequest bindRequest = createBindRequest( config.getName(), Strings.getBytesUtf8(
config.getCredentials() ) );
+
+        return bindAsync( bindRequest );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public BindFuture anonymousBindAsync() throws LdapException, IOException
+    {
+        LOG.debug( "Anonymous asynchronous Bind request" );
 
         // Create the BindRequest
         BindRequest bindRequest = createBindRequest( StringConstants.EMPTY, StringConstants.EMPTY_BYTES
);



Mime
View raw message