directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1346939 - in /directory/apacheds/branches/apacheds-txns-merge: core-api/src/main/java/org/apache/directory/server/core/api/ interceptors/authn/src/main/java/org/apache/directory/server/core/authn/ ldap-client-test/src/test/java/org/apache/...
Date Wed, 06 Jun 2012 15:20:01 GMT
Author: elecharny
Date: Wed Jun  6 15:20:01 2012
New Revision: 1346939

URL: http://svn.apache.org/viewvc?rev=1346939&view=rev
Log:
Applied rev 1299690

Modified:
    directory/apacheds/branches/apacheds-txns-merge/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
    directory/apacheds/branches/apacheds-txns-merge/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/DelegatingAuthenticator.java
    directory/apacheds/branches/apacheds-txns-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java

Modified: directory/apacheds/branches/apacheds-txns-merge/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns-merge/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java?rev=1346939&r1=1346938&r2=1346939&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns-merge/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
(original)
+++ directory/apacheds/branches/apacheds-txns-merge/core-api/src/main/java/org/apache/directory/server/core/api/LdapCoreSessionConnection.java
Wed Jun  6 15:20:01 2012
@@ -26,15 +26,13 @@ import java.io.IOException;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
-import java.util.concurrent.atomic.AtomicInteger;
 
+import org.apache.directory.ldap.client.api.AbstractLdapConnection;
 import org.apache.directory.ldap.client.api.EntryCursorImpl;
-import org.apache.directory.ldap.client.api.LdapConnection;
 import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.api.interceptor.context.BindOperationContext;
 import org.apache.directory.shared.asn1.util.Oid;
 import org.apache.directory.shared.ldap.codec.api.LdapApiService;
-import org.apache.directory.shared.ldap.codec.api.LdapApiServiceFactory;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.cursor.EmptyCursor;
 import org.apache.directory.shared.ldap.model.cursor.EntryCursor;
@@ -87,8 +85,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.name.Rdn;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
-import org.apache.directory.shared.util.StringConstants;
-import org.apache.directory.shared.util.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -98,7 +94,7 @@ import org.slf4j.LoggerFactory;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class LdapCoreSessionConnection implements LdapConnection
+public class LdapCoreSessionConnection extends AbstractLdapConnection
 {
     /** The logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( LdapCoreSessionConnection.class
);
@@ -106,31 +102,25 @@ public class LdapCoreSessionConnection i
     /** the CoreSession object */
     private CoreSession session;
 
-    /** the SchemaManager */
-    private SchemaManager schemaManager;
-
     /** the session's DirectoryService */
     private DirectoryService directoryService;
 
-    /** The MessageId counter */
-    private AtomicInteger messageId = new AtomicInteger( 0 );
-
-    private LdapApiService codec = LdapApiServiceFactory.getSingleton();
-
-
     public LdapCoreSessionConnection()
     {
+        super();
     }
 
 
     public LdapCoreSessionConnection( DirectoryService directoryService )
     {
+        super();
         setDirectoryService( directoryService );
     }
 
 
     public LdapCoreSessionConnection( CoreSession session )
     {
+        super();
         this.session = session;
         setDirectoryService( session.getDirectoryService() );
 
@@ -1235,58 +1225,6 @@ public class LdapCoreSessionConnection i
     }
 
 
-    /**
-     * {@inheritDoc}
-     */
-    public void bind( Dn name ) throws LdapException, IOException
-    {
-        byte[] credBytes = StringConstants.EMPTY_BYTES;
-
-        BindRequest bindRequest = new BindRequestImpl();
-        bindRequest.setName( name );
-        bindRequest.setCredentials( credBytes );
-
-        BindResponse bindResponse = bind( bindRequest );
-
-        processResponse( bindResponse );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void bind( Dn name, String credentials ) throws LdapException, IOException
-    {
-        byte[] credBytes = ( credentials == null ? StringConstants.EMPTY_BYTES : Strings.getBytesUtf8(
credentials ) );
-
-        BindRequest bindRequest = new BindRequestImpl();
-        bindRequest.setName( name );
-        bindRequest.setCredentials( credBytes );
-
-        BindResponse bindResponse = bind( bindRequest );
-
-        processResponse( bindResponse );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void bind( String name ) throws LdapException, IOException
-    {
-        bind( new Dn( schemaManager, name ), null );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void bind( String name, String credentials ) throws LdapException, IOException
-    {
-        bind( new Dn( schemaManager, name ), credentials );
-    }
-
-
     private void addResponseControls( ResultResponseRequest iReq, Message clientResp )
     {
         Collection<Control> ctrlSet = iReq.getResultResponse().getControls().values();

Modified: directory/apacheds/branches/apacheds-txns-merge/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/DelegatingAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns-merge/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/DelegatingAuthenticator.java?rev=1346939&r1=1346938&r2=1346939&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns-merge/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/DelegatingAuthenticator.java
(original)
+++ directory/apacheds/branches/apacheds-txns-merge/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/DelegatingAuthenticator.java
Wed Jun  6 15:20:01 2012
@@ -23,7 +23,7 @@ package org.apache.directory.server.core
 import java.net.SocketAddress;
 
 import org.apache.directory.ldap.client.api.LdapConnection;
-import org.apache.directory.ldap.client.api.LdapConnectionFactory;
+import org.apache.directory.ldap.client.api.LdapNetworkConnection;
 import org.apache.directory.server.core.api.LdapPrincipal;
 import org.apache.directory.server.core.api.interceptor.context.BindOperationContext;
 import org.apache.directory.server.i18n.I18n;
@@ -122,8 +122,8 @@ public class DelegatingAuthenticator ext
             LOG.debug( "Authenticating {}", bindContext.getDn() );
         }
         
-        // Create a connection on the remote host 
-        LdapConnection ldapConnection = LdapConnectionFactory.getNetworkConnection( delegateHost,
delegatePort );
+        // Create a connection on the remote host
+        LdapConnection ldapConnection = new LdapNetworkConnection( delegateHost, delegatePort
);
         
         try
         {

Modified: directory/apacheds/branches/apacheds-txns-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java?rev=1346939&r1=1346938&r2=1346939&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
(original)
+++ directory/apacheds/branches/apacheds-txns-merge/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
Wed Jun  6 15:20:01 2012
@@ -6,16 +6,16 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ * 
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ * 
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ * 
  */
 package org.apache.directory.shared.client.api.operations.bind;
 
@@ -254,7 +254,7 @@ public class SimpleBindRequestTest exten
 
 
     /**
-     * Test for DIRAPI-49 (LdapNetworkConnection.anonymousBind() uses name and credentials

+     * Test for DIRAPI-49 (LdapNetworkConnection.anonymousBind() uses name and credentials
      * from configuration instead of empty values).
      */
     @Test
@@ -342,7 +342,7 @@ public class SimpleBindRequestTest exten
     /**
      * Test an bind with no password
      */
-    @Test(expected = LdapAuthenticationException.class)
+    @Test(expected = LdapUnwillingToPerformException.class)
     public void testSimpleBindNoPassword() throws Exception
     {
         connection.bind( "uid=admin,ou=system", ( String ) null );
@@ -432,7 +432,7 @@ public class SimpleBindRequestTest exten
         assertFalse( connection.isAuthenticated() );
         assertFalse( connection.isConnected() );
 
-        // And Bind again. The messageId should be 1 
+        // And Bind again. The messageId should be 1
         BindRequest br3 = new BindRequestImpl();
         br3.setName( new Dn( "uid=admin,ou=system" ) );
         br3.setCredentials( Strings.getBytesUtf8( "secret" ) );
@@ -452,7 +452,7 @@ public class SimpleBindRequestTest exten
     {
         try
         {
-            // Inject the interceptor that waits 1 second when binding 
+            // Inject the interceptor that waits 1 second when binding
             // in order to be able to send a request before we get the response
             Interceptor interceptor = new BaseInterceptor( "test" )
             {



Mime
View raw message