Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2642A4803 for ; Sat, 21 May 2011 13:08:46 +0000 (UTC) Received: (qmail 43975 invoked by uid 500); 21 May 2011 13:08:46 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 43925 invoked by uid 500); 21 May 2011 13:08:45 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 43918 invoked by uid 99); 21 May 2011 13:08:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 May 2011 13:08:45 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 May 2011 13:08:43 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C45ED23889B2; Sat, 21 May 2011 13:08:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110521130823.C45ED23889B2@eris.apache.org> 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 );