directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1063097 - in /directory: apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/ apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/ apacheds/trunk/protocol-ldap/src/main/ja...
Date Tue, 25 Jan 2011 01:36:14 GMT
Author: akarasulu
Date: Tue Jan 25 01:36:13 2011
New Revision: 1063097

URL: http://svn.apache.org/viewvc?rev=1063097&view=rev
Log:
added encoding decorator to decouple BindRequestImpl

Added:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/BindRequestDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/FooDecorator.java
      - copied, changed from r1063092, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/AddRequestDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/BindRequestImpl.java
  (contents, props changed)
      - copied, changed from r1063086, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequestImpl.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/model/message/BindRequestImplTest.java
  (contents, props changed)
      - copied, changed from r1063063, directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java
Removed:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequestImpl.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java
Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/LdapCoreSessionConnection.java
    directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
    directory/shared/trunk/dsml-engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AuthRequestDsml.java
    directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
    directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/MessageDecorator.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.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=1063097&r1=1063096&r2=1063097&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
Tue Jan 25 01:36:13 2011
@@ -52,7 +52,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.AddResponseImpl;
 import org.apache.directory.shared.ldap.model.message.*;
 import org.apache.directory.shared.ldap.model.message.BindRequest;
-import org.apache.directory.shared.ldap.message.BindRequestImpl;
+import org.apache.directory.shared.ldap.model.message.BindRequestImpl;
 import org.apache.directory.shared.ldap.model.message.BindResponse;
 import org.apache.directory.shared.ldap.message.BindResponseImpl;
 import org.apache.directory.shared.ldap.model.message.CompareRequest;

Modified: directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java?rev=1063097&r1=1063096&r2=1063097&view=diff
==============================================================================
--- directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
(original)
+++ directory/apacheds/trunk/ldap-client-test/src/test/java/org/apache/directory/shared/client/api/operations/bind/SimpleBindRequestTest.java
Tue Jan 25 01:36:13 2011
@@ -42,11 +42,8 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.NextInterceptor;
 import org.apache.directory.server.core.interceptor.context.BindOperationContext;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
-import org.apache.directory.shared.ldap.model.message.BindRequest;
-import org.apache.directory.shared.ldap.message.BindRequestImpl;
-import org.apache.directory.shared.ldap.model.message.BindResponse;
-import org.apache.directory.shared.ldap.model.message.LdapResult;
-import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.model.message.*;
+import org.apache.directory.shared.ldap.model.message.BindRequestImpl;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.junit.After;
 import org.junit.Before;

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java?rev=1063097&r1=1063096&r2=1063097&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
Tue Jan 25 01:36:13 2011
@@ -30,7 +30,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.exception.LdapReferralException;
 import org.apache.directory.shared.ldap.model.message.AbandonRequest;
 import org.apache.directory.shared.ldap.model.message.*;
-import org.apache.directory.shared.ldap.message.BindRequestImpl;
+import org.apache.directory.shared.ldap.model.message.BindRequestImpl;
 import org.apache.directory.shared.ldap.model.message.BindResponse;
 import org.apache.directory.shared.ldap.message.BindResponseImpl;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequest;

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java?rev=1063097&r1=1063096&r2=1063097&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java
Tue Jan 25 01:36:13 2011
@@ -66,13 +66,10 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
-import org.apache.directory.shared.ldap.model.message.BindRequest;
-import org.apache.directory.shared.ldap.message.BindRequestImpl;
-import org.apache.directory.shared.ldap.model.message.BindResponse;
+import org.apache.directory.shared.ldap.model.message.*;
+import org.apache.directory.shared.ldap.model.message.BindRequestImpl;
 import org.apache.directory.shared.ldap.message.LdapEncoder;
-import org.apache.directory.shared.ldap.model.message.ModifyRequest;
 import org.apache.directory.shared.ldap.message.ModifyRequestImpl;
-import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.junit.Ignore;
 import org.junit.Rule;

Modified: directory/shared/trunk/dsml-engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java?rev=1063097&r1=1063096&r2=1063097&view=diff
==============================================================================
--- directory/shared/trunk/dsml-engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java
(original)
+++ directory/shared/trunk/dsml-engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/Dsmlv2Engine.java
Tue Jan 25 01:36:13 2011
@@ -53,7 +53,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.cursor.Cursor;
 import org.apache.directory.shared.ldap.model.message.AddRequest;
 import org.apache.directory.shared.ldap.model.message.BindRequest;
-import org.apache.directory.shared.ldap.message.BindRequestImpl;
+import org.apache.directory.shared.ldap.model.message.BindRequestImpl;
 import org.apache.directory.shared.ldap.model.message.CompareRequest;
 import org.apache.directory.shared.ldap.model.message.CompareResponse;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequest;

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AuthRequestDsml.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AuthRequestDsml.java?rev=1063097&r1=1063096&r2=1063097&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AuthRequestDsml.java
(original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/AuthRequestDsml.java
Tue Jan 25 01:36:13 2011
@@ -21,8 +21,8 @@ package org.apache.directory.shared.dsml
 
 
 import org.apache.directory.shared.ldap.model.message.BindRequest;
+import org.apache.directory.shared.ldap.model.message.BindRequestImpl;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
-import org.apache.directory.shared.ldap.message.BindRequestImpl;
 import org.dom4j.Element;
 
 

Modified: directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java?rev=1063097&r1=1063096&r2=1063097&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
(original)
+++ directory/shared/trunk/dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/request/Dsmlv2Grammar.java
Tue Jan 25 01:36:13 2011
@@ -62,7 +62,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.AddRequestImpl;
 import org.apache.directory.shared.ldap.model.message.*;
 import org.apache.directory.shared.ldap.model.message.BindRequest;
-import org.apache.directory.shared.ldap.message.BindRequestImpl;
+import org.apache.directory.shared.ldap.model.message.BindRequestImpl;
 import org.apache.directory.shared.ldap.message.CompareRequestImpl;
 import org.apache.directory.shared.ldap.message.DeleteRequestImpl;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequest;

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=1063097&r1=1063096&r2=1063097&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
Tue Jan 25 01:36:13 2011
@@ -83,7 +83,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.AddResponse;
 import org.apache.directory.shared.ldap.model.message.*;
 import org.apache.directory.shared.ldap.model.message.BindRequest;
-import org.apache.directory.shared.ldap.message.BindRequestImpl;
+import org.apache.directory.shared.ldap.model.message.BindRequestImpl;
 import org.apache.directory.shared.ldap.model.message.BindResponse;
 import org.apache.directory.shared.ldap.model.message.CompareRequest;
 import org.apache.directory.shared.ldap.message.CompareRequestImpl;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java?rev=1063097&r1=1063096&r2=1063097&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
Tue Jan 25 01:36:13 2011
@@ -76,7 +76,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.AddResponseImpl;
 import org.apache.directory.shared.ldap.model.message.*;
 import org.apache.directory.shared.ldap.model.message.BindRequest;
-import org.apache.directory.shared.ldap.message.BindRequestImpl;
+import org.apache.directory.shared.ldap.model.message.BindRequestImpl;
 import org.apache.directory.shared.ldap.model.message.BindResponse;
 import org.apache.directory.shared.ldap.message.BindResponseImpl;
 import org.apache.directory.shared.ldap.model.message.CompareRequest;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java?rev=1063097&r1=1063096&r2=1063097&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/LdapEncoder.java
Tue Jan 25 01:36:13 2011
@@ -38,6 +38,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.controls.CodecControl;
 import org.apache.directory.shared.ldap.message.decorators.AddRequestDecorator;
 import org.apache.directory.shared.ldap.message.decorators.AddResponseDecorator;
+import org.apache.directory.shared.ldap.message.decorators.BindRequestDecorator;
 import org.apache.directory.shared.ldap.message.decorators.MessageDecorator;
 import org.apache.directory.shared.ldap.model.entry.BinaryValue;
 import org.apache.directory.shared.ldap.model.entry.Entry;
@@ -505,8 +506,9 @@ public class LdapEncoder
      *      Length(0x04) + Length(L2) + L2 + Length(authentication)
      * </pre>
      */
-    private int computeBindRequestLength( BindRequestImpl bindRequest )
+    private int computeBindRequestLength( BindRequestDecorator decorator )
     {
+        BindRequest bindRequest = decorator.getBindRequest();
         int bindRequestLength = 1 + 1 + 1; // Initialized with version
 
         // The name
@@ -545,11 +547,11 @@ public class LdapEncoder
             bindRequestLength += saslLength;
 
             // Store the mechanism and credentials lengths
-            bindRequest.setSaslMechanismLength( saslMechanismLength );
-            bindRequest.setSaslCredentialsLength( saslCredentialsLength );
+            decorator.setSaslMechanismLength( saslMechanismLength );
+            decorator.setSaslCredentialsLength( saslCredentialsLength );
         }
 
-        bindRequest.setBindRequestLength( bindRequestLength );
+        decorator.setBindRequestLength( bindRequestLength );
 
         // Return the result.
         return 1 + TLV.getNbBytes( bindRequestLength ) + bindRequestLength;
@@ -1494,13 +1496,15 @@ public class LdapEncoder
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
-    private void encodeBindRequest( ByteBuffer buffer, BindRequestImpl bindRequest ) throws
EncoderException
+    private void encodeBindRequest( ByteBuffer buffer, BindRequestDecorator decorator ) throws
EncoderException
     {
+        BindRequest bindRequest = decorator.getBindRequest();
+
         try
         {
             // The BindRequest Tag
             buffer.put( LdapConstants.BIND_REQUEST_TAG );
-            buffer.put( TLV.getBytes( bindRequest.getBindRequestLength() ) );
+            buffer.put( TLV.getBytes( decorator.getBindRequestLength() ) );
 
         }
         catch ( BufferOverflowException boe )
@@ -1556,7 +1560,7 @@ public class LdapEncoder
                 byte[] mechanismBytes = Strings.getBytesUtf8(bindRequest.getSaslMechanism());
 
                 buffer.put( TLV
-                    .getBytes( bindRequest.getSaslMechanismLength() + bindRequest.getSaslCredentialsLength()
) );
+                    .getBytes( decorator.getSaslMechanismLength() + decorator.getSaslCredentialsLength()
) );
 
                 Value.encode( buffer, mechanismBytes );
 
@@ -2373,7 +2377,7 @@ public class LdapEncoder
                 return computeAddResponseLength( ( AddResponseDecorator ) decorator );
 
             case BIND_REQUEST:
-                return computeBindRequestLength( ( BindRequestImpl ) message );
+                return computeBindRequestLength( ( BindRequestDecorator ) decorator );
 
             case BIND_RESPONSE:
                 return computeBindResponseLength( ( BindResponseImpl ) message );
@@ -2451,7 +2455,7 @@ public class LdapEncoder
                 break;
 
             case BIND_REQUEST:
-                encodeBindRequest( bb, ( BindRequestImpl ) message );
+                encodeBindRequest( bb, ( BindRequestDecorator ) decorator );
                 break;
 
             case BIND_RESPONSE:

Added: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/BindRequestDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/BindRequestDecorator.java?rev=1063097&view=auto
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/BindRequestDecorator.java
(added)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/BindRequestDecorator.java
Tue Jan 25 01:36:13 2011
@@ -0,0 +1,116 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  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. 
+ *  
+ */
+package org.apache.directory.shared.ldap.message.decorators;
+
+
+import org.apache.directory.shared.ldap.model.message.BindRequest;
+
+
+/**
+ * Doc me!
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class BindRequestDecorator extends MessageDecorator
+{
+
+    /** The bind request length */
+    private int bindRequestLength;
+
+    /** The SASL Mechanism length */
+    private int saslMechanismLength;
+
+    /** The SASL credentials length */
+    private int saslCredentialsLength;
+
+
+    /**
+     * Makes a BindRequest encodable.
+     *
+     * @param decoratedMessage the decorated BindRequests.
+     */
+    public BindRequestDecorator( BindRequest decoratedMessage )
+    {
+        super( decoratedMessage );
+    }
+
+
+    public BindRequest getBindRequest()
+    {
+        return ( BindRequest ) getMessage();
+    }
+
+
+    /**
+     * Stores the encoded length for the BindRequest
+     * @param bindRequestLength The encoded length
+     */
+    public void setBindRequestLength( int bindRequestLength )
+    {
+        this.bindRequestLength = bindRequestLength;
+    }
+
+
+    /**
+     * @return The encoded BindRequest's length
+     */
+    public int getBindRequestLength()
+    {
+        return bindRequestLength;
+    }
+
+
+    /**
+     * Stores the encoded length for the SaslCredentials
+     * @param saslCredentialsLength The encoded length
+     */
+    public void setSaslCredentialsLength( int saslCredentialsLength )
+    {
+        this.saslCredentialsLength = saslCredentialsLength;
+    }
+
+
+    /**
+     * @return The encoded SaslCredentials's length
+     */
+    public int getSaslCredentialsLength()
+    {
+        return saslCredentialsLength;
+    }
+
+
+    /**
+     * Stores the encoded length for the Mechanism
+     * @param saslMechanismLength The encoded length
+     */
+    public void setSaslMechanismLength( int saslMechanismLength )
+    {
+        this.saslMechanismLength = saslMechanismLength;
+    }
+
+
+    /**
+     * @return The encoded SaslMechanism's length
+     */
+    public int getSaslMechanismLength()
+    {
+        return saslMechanismLength;
+    }
+}

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/FooDecorator.java
(from r1063092, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/AddRequestDecorator.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/FooDecorator.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/FooDecorator.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/AddRequestDecorator.java&r1=1063092&r2=1063097&rev=1063097&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/AddRequestDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/FooDecorator.java
Tue Jan 25 01:36:13 2011
@@ -20,39 +20,25 @@
 package org.apache.directory.shared.ldap.message.decorators;
 
 
-import java.util.List;
 import org.apache.directory.shared.ldap.model.message.AddRequest;
 
+import java.util.List;
+
 
 /**
  * Doc me!
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AddRequestDecorator extends MessageDecorator
+public class FooDecorator extends MessageDecorator
 {
-    // ~ Instance fields
-    // ----------------------------------------------------------------------------
-
-    /** The add request length */
-    private int addRequestLength;
-
-    /** The Entry length */
-    private int entryLength;
-
-    /** The list of all attributes length */
-    private List<Integer> attributesLength;
-
-    /** The list of all vals length */
-    private List<Integer> valuesLength;
-
 
     /**
-     * Makes a AddRequest encodable.
+     * Makes a Foo encodable.
      *
-     * @param decoratedMessage the decorated AddRequest
+     * @param decoratedMessage the decorated Foo
      */
-    public AddRequestDecorator( AddRequest decoratedMessage )
+    public FooDecorator( AddRequest decoratedMessage )
     {
         super( decoratedMessage );
     }
@@ -62,80 +48,4 @@ public class AddRequestDecorator extends
     {
         return ( AddRequest ) getMessage();
     }
-
-
-    /**
-     * Stores the encoded length for the AddRequest
-     * @param addRequestLength The encoded length
-     */
-    public void setAddRequestLength( int addRequestLength )
-    {
-        this.addRequestLength = addRequestLength;
-    }
-
-
-    /**
-     * @return The encoded AddRequest's length
-     */
-    public int getAddRequestLength()
-    {
-        return addRequestLength;
-    }
-
-
-    /**
-     * Stores the encoded length for the Entry
-     * @param entryLength The encoded length
-     */
-    public void setEntryLength( int entryLength )
-    {
-        this.entryLength = entryLength;
-    }
-
-
-    /**
-     * @return The encoded Entry's length
-     */
-    public int getEntryLength()
-    {
-        return entryLength;
-    }
-
-
-    /**
-     * Stores the encoded length for the attributes
-     * @param attributesLength The encoded length
-     */
-    public void setAttributesLength( List<Integer> attributesLength )
-    {
-        this.attributesLength = attributesLength;
-    }
-
-
-    /**
-     * @return The encoded values length
-     */
-    public List<Integer> getAttributesLength()
-    {
-        return attributesLength;
-    }
-
-
-    /**
-     * Stores the encoded length for the values
-     * @param valuesLength The encoded length
-     */
-    public void setValuesLength( List<Integer> valuesLength )
-    {
-        this.valuesLength = valuesLength;
-    }
-
-
-    /**
-     * @return The encoded values length
-     */
-    public List<Integer> getValuesLength()
-    {
-        return valuesLength;
-    }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/MessageDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/MessageDecorator.java?rev=1063097&r1=1063096&r2=1063097&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/MessageDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/decorators/MessageDecorator.java
Tue Jan 25 01:36:13 2011
@@ -23,6 +23,7 @@ package org.apache.directory.shared.ldap
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.ldap.model.message.AddRequest;
 import org.apache.directory.shared.ldap.model.message.AddResponse;
+import org.apache.directory.shared.ldap.model.message.BindRequest;
 import org.apache.directory.shared.ldap.model.message.Message;
 
 
@@ -57,6 +58,8 @@ public class MessageDecorator
                 return new AddRequestDecorator( ( AddRequest ) decoratedMessage );
             case ADD_RESPONSE:
                 return new AddResponseDecorator( ( AddResponse ) decoratedMessage );
+            case BIND_REQUEST:
+                return new BindRequestDecorator( ( BindRequest ) decoratedMessage );
             default:
                 return new MessageDecorator( decoratedMessage );
         }

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/BindRequestImpl.java
(from r1063086, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequestImpl.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/BindRequestImpl.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/BindRequestImpl.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequestImpl.java&r1=1063086&r2=1063097&rev=1063097&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/message/BindRequestImpl.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/BindRequestImpl.java
Tue Jan 25 01:36:13 2011
@@ -17,12 +17,13 @@
  *  under the License. 
  *  
  */
-package org.apache.directory.shared.ldap.message;
+package org.apache.directory.shared.ldap.model.message;
 
 
 import java.util.Arrays;
 
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.message.BindResponseImpl;
 import org.apache.directory.shared.ldap.model.message.*;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.util.Strings;
@@ -62,15 +63,6 @@ public class BindRequestImpl extends Abs
     /** The associated response */
     public BindResponse response;
 
-    /** The bind request length */
-    private int bindRequestLength;
-
-    /** The SASL Mechanism length */
-    private int saslMechanismLength;
-
-    /** The SASL credentials length */
-    private int saslCredentialsLength;
-
 
     // ------------------------------------------------------------------------
     // Constructors
@@ -421,63 +413,6 @@ public class BindRequestImpl extends Abs
 
 
     /**
-     * Stores the encoded length for the BindRequest
-     * @param bindRequestLength The encoded length
-     */
-    /* No qualifier*/void setBindRequestLength( int bindRequestLength )
-    {
-        this.bindRequestLength = bindRequestLength;
-    }
-
-
-    /**
-     * @return The encoded BindRequest's length
-     */
-    /* No qualifier */int getBindRequestLength()
-    {
-        return bindRequestLength;
-    }
-
-
-    /**
-     * Stores the encoded length for the SaslCredentials
-     * @param saslCredentialsLength The encoded length
-     */
-    /* No qualifier*/void setSaslCredentialsLength( int saslCredentialsLength )
-    {
-        this.saslCredentialsLength = saslCredentialsLength;
-    }
-
-
-    /**
-     * @return The encoded SaslCredentials's length
-     */
-    /* No qualifier */int getSaslCredentialsLength()
-    {
-        return saslCredentialsLength;
-    }
-
-
-    /**
-     * Stores the encoded length for the Mechanism
-     * @param saslMechanismLength The encoded length
-     */
-    /* No qualifier*/void setSaslMechanismLength( int saslMechanismLength )
-    {
-        this.saslMechanismLength = saslMechanismLength;
-    }
-
-
-    /**
-     * @return The encoded SaslMechanism's length
-     */
-    /* No qualifier */int getSaslMechanismLength()
-    {
-        return saslMechanismLength;
-    }
-
-
-    /**
      * Get a String representation of a BindRequest
      * 
      * @return A BindRequest String

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/BindRequestImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java?rev=1063097&r1=1063096&r2=1063097&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/bind/BindRequestPerfTest.java
Tue Jan 25 01:36:13 2011
@@ -36,7 +36,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.controls.ControlImpl;
 import org.apache.directory.shared.ldap.model.message.BindRequest;
-import org.apache.directory.shared.ldap.message.BindRequestImpl;
+import org.apache.directory.shared.ldap.model.message.BindRequestImpl;
 import org.apache.directory.shared.ldap.message.LdapEncoder;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.name.Dn;

Copied: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/model/message/BindRequestImplTest.java
(from r1063063, directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/model/message/BindRequestImplTest.java?p2=directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/model/message/BindRequestImplTest.java&p1=directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java&r1=1063063&r2=1063097&rev=1063097&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/message/BindRequestImplTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/model/message/BindRequestImplTest.java
Tue Jan 25 01:36:13 2011
@@ -17,7 +17,7 @@
  *  under the License. 
  *  
  */
-package org.apache.directory.shared.ldap.message;
+package org.apache.directory.shared.ldap.model.message;
 
 
 import static org.junit.Assert.assertFalse;

Propchange: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/model/message/BindRequestImplTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message