directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r440175 - in /directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind: BindRequestAsn1Ber.java SimpleAuthenticationAsn1Ber.java
Date Mon, 04 Sep 2006 20:32:01 GMT
Author: elecharny
Date: Mon Sep  4 13:32:00 2006
New Revision: 440175

URL: http://svn.apache.org/viewvc?view=rev&rev=440175
Log:
The decorator now extends Encoder and Decoder interface

Modified:
    directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind/BindRequestAsn1Ber.java
    directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind/SimpleAuthenticationAsn1Ber.java

Modified: directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind/BindRequestAsn1Ber.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind/BindRequestAsn1Ber.java?view=diff&rev=440175&r1=440174&r2=440175
==============================================================================
--- directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind/BindRequestAsn1Ber.java
(original)
+++ directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind/BindRequestAsn1Ber.java
Mon Sep  4 13:32:00 2006
@@ -19,12 +19,11 @@
  */
 package org.apache.directory.shared.ldap.codec.asn1ber.messages.bind;
 
+import org.apache.directory.shared.asn1.ber.Decoder;
+import org.apache.directory.shared.asn1.ber.Encoder;
 import org.apache.directory.shared.asn1.ber.tlv.Length;
-import org.apache.directory.shared.ldap.messages.bind.AuthenticationDecorator;
-import org.apache.directory.shared.ldap.messages.bind.AuthenticationOperation;
 import org.apache.directory.shared.ldap.messages.bind.BindRequestDecorator;
 import org.apache.directory.shared.ldap.messages.bind.BindRequestOperation;
-import org.apache.directory.shared.ldap.messages.bind.SaslCredentialsDecorator;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -36,7 +35,7 @@
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class BindRequestAsn1Ber extends BindRequestDecorator 
+public class BindRequestAsn1Ber extends BindRequestDecorator implements Encoder, Decoder
 {
     /** The logger */
     private static Logger log = LoggerFactory.getLogger( BindRequestAsn1Ber.class );
@@ -80,12 +79,20 @@
         bindRequestLength += 1 + Length.getNbBytes( LdapDN.getNbBytes( getName() ) ) + LdapDN.getNbBytes(
getName() );
 
         // The authentication
-        AuthenticationOperation authenticationDecorator = 
-            ( getAuthentication().isSimple() ?
-                new SimpleAuthenticationAsn1Ber( getAuthentication() ) :
-                new SaslCredentialsAsn1Ber( getAuthentication() ) );
-
-        bindRequestLength += authenticationDecorator.computeLength();
+        if ( getAuthentication().isSimple() )
+        {
+            SimpleAuthenticationAsn1Ber authenticationDecorator = 
+                    new SimpleAuthenticationAsn1Ber( getAuthentication() );
+
+            bindRequestLength += authenticationDecorator.computeLength();
+        }
+        else
+        {
+            SaslCredentialsAsn1Ber authenticationDecorator = 
+                    new SaslCredentialsAsn1Ber( getAuthentication() );
+            
+            bindRequestLength += authenticationDecorator.computeLength();
+        }
 
         // Return the result.
         int length = 1 + Length.getNbBytes( bindRequestLength ) + bindRequestLength;

Modified: directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind/SimpleAuthenticationAsn1Ber.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind/SimpleAuthenticationAsn1Ber.java?view=diff&rev=440175&r1=440174&r2=440175
==============================================================================
--- directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind/SimpleAuthenticationAsn1Ber.java
(original)
+++ directory/sandbox/akarasulu/apacheds-2.0/shared/ldap/src/main/java/org/apache/directory/shared/ldap/codec/asn1ber/messages/bind/SimpleAuthenticationAsn1Ber.java
Mon Sep  4 13:32:00 2006
@@ -19,6 +19,8 @@
  */
 package org.apache.directory.shared.ldap.codec.asn1ber.messages.bind;
 
+import org.apache.directory.shared.asn1.ber.Decoder;
+import org.apache.directory.shared.asn1.ber.Encoder;
 import org.apache.directory.shared.asn1.ber.tlv.Length;
 import org.apache.directory.shared.ldap.messages.bind.AuthenticationOperation;
 import org.apache.directory.shared.ldap.messages.bind.SimpleAuthenticationDecorator;
@@ -31,7 +33,7 @@
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SimpleAuthenticationAsn1Ber extends SimpleAuthenticationDecorator
+public class SimpleAuthenticationAsn1Ber extends SimpleAuthenticationDecorator implements
Encoder, Decoder
 {
     /** The logger */
     private static Logger log = LoggerFactory.getLogger( SimpleAuthenticationAsn1Ber.class
);
@@ -50,9 +52,10 @@
     }
     
     /**
-     * Compute the Simple authentication : 
+     * Compute the Simple authentication length : 
+     * 
+     * Simple authentication : 0x80 L1 simple 
      * 
-     * length Simple authentication : 0x80 L1 simple 
      * L1 = Length(simple) 
      * Length(Simple authentication) = Length(0x80) + Length(L1) + Length(simple)
      */



Mime
View raw message