directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r910150 [6/11] - in /directory: apacheds/trunk/ apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/co...
Date Mon, 15 Feb 2010 01:37:47 GMT
Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestCodec.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestCodec.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestCodec.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/abandon/AbandonRequestCodec.java Mon Feb 15 01:37:34 2010
@@ -27,6 +27,7 @@
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
+import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -47,10 +48,10 @@
 public class AbandonRequestCodec extends LdapMessageCodec
 {
     /** The logger */
-    private static Logger log = LoggerFactory.getLogger( AbandonRequestCodec.class );
+    private static Logger LOGGER = LoggerFactory.getLogger( AbandonRequestCodec.class );
 
     /** Speedup for logs */
-    private static final boolean IS_DEBUG = log.isDebugEnabled();
+    private static final boolean IS_DEBUG = LOGGER.isDebugEnabled();
 
     // ~ Instance fields
     // ----------------------------------------------------------------------------
@@ -90,9 +91,18 @@
      * 
      * @return Returns the type.
      */
-    public int getMessageType()
+    public MessageTypeEnum getMessageType()
     {
-        return LdapConstants.ABANDON_REQUEST;
+        return MessageTypeEnum.ABANDON_REQUEST;
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String getMessageTypeName()
+    {
+        return "ABANDON_REQUEST";
     }
 
 
@@ -106,7 +116,7 @@
         this.abandonedMessageId = abandonedMessageId;
     }
 
-
+    
     /**
      * Compute the AbandonRequest length 
      * 
@@ -115,13 +125,13 @@
      * 
      * Length(AbandonRequest) = Length(0x50) + 1 + Length(abandoned MessageId)
      */
-    public int computeLength()
+    protected int computeLengthProtocolOp()
     {
         int length = 1 + 1 + Value.getNbBytes( abandonedMessageId );
 
         if ( IS_DEBUG )
         {
-            log.debug( "Message length : {}", Integer.valueOf( length ) );
+            LOGGER.debug( "Message length : {}", Integer.valueOf( length ) );
         }
 
         return length;
@@ -129,19 +139,10 @@
 
 
     /**
-     * Encode the AbandonRequest message to a PDU.
-     * 
-     * @param buffer The buffer where to put the PDU
-     * @return The PDU.
+     * Encode the Abandon protocolOp part
      */
-    public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
+    protected void encodeProtocolOp( ByteBuffer buffer ) throws EncoderException
     {
-        if ( buffer == null )
-        {
-            log.error( "Cannot put a PDU in a null buffer !" );
-            throw new EncoderException( "Cannot put a PDU in a null buffer !" );
-        }
-
         try
         {
             // The tag
@@ -156,11 +157,10 @@
         }
         catch ( BufferOverflowException boe )
         {
-            log.error( "The PDU buffer size is too small !" );
-            throw new EncoderException( "The PDU buffer size is too small !" );
+            String msg = "The PDU buffer size is too small !";
+            LOGGER.error( msg );
+            throw new EncoderException( msg );
         }
-
-        return buffer;
     }
 
 
@@ -171,12 +171,11 @@
      */
     public String toString()
     {
-
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         sb.append( "    Abandon Request :\n" );
-        sb.append( "        Message Id : " ).append( abandonedMessageId ).append( '\n' );
+        sb.append( "        Message Id : " ).append( abandonedMessageId );
 
-        return sb.toString();
+        return toString( sb.toString() );
     }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/AttributeDescAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/AttributeDescAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/AttributeDescAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/AttributeDescAction.java Mon Feb 15 01:37:34 2010
@@ -27,7 +27,6 @@
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -58,7 +57,7 @@
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
 
-        SearchRequestCodec searchRequest = ldapMessageContainer.getLdapMessage().getSearchRequest();
+        SearchRequestCodec searchRequest = ldapMessageContainer.getSearchRequest();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
         String attributeDescription = null;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ErrorMessageAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ErrorMessageAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ErrorMessageAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ErrorMessageAction.java Mon Feb 15 01:37:34 2010
@@ -24,12 +24,10 @@
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.LdapResponseCodec;
 import org.apache.directory.shared.ldap.codec.LdapResultCodec;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -59,8 +57,7 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-        LdapResponseCodec response = ldapMessage.getLdapResponse();
+        LdapResponseCodec response = ldapMessageContainer.getLdapResponse();
         LdapResultCodec ldapResult = response.getLdapResult();
 
         // Get the Value and store it in the BindResponse

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAndFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAndFilterAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAndFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAndFilterAction.java Mon Feb 15 01:37:34 2010
@@ -24,12 +24,10 @@
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.AndFilter;
 import org.apache.directory.shared.ldap.codec.search.Filter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -59,8 +57,7 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-
+        
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 
         if ( tlv.getLength() == 0 )
@@ -69,7 +66,7 @@
             throw new DecoderException( "The And filter PDU must not be empty" );
         }
 
-        SearchRequestCodec searchRequest = ldapMessage.getSearchRequest();
+        SearchRequestCodec searchRequest = ldapMessageContainer.getSearchRequest();
 
         // We can allocate the SearchRequest
         Filter andFilter = new AndFilter( ldapMessageContainer.getTlvId() );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitApproxMatchFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitApproxMatchFilterAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitApproxMatchFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitApproxMatchFilterAction.java Mon Feb 15 01:37:34 2010
@@ -24,12 +24,10 @@
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.AttributeValueAssertionFilter;
 import org.apache.directory.shared.ldap.codec.search.Filter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -56,8 +54,7 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-        SearchRequestCodec searchRequest = ldapMessage.getSearchRequest();
+        SearchRequestCodec searchRequest = ldapMessageContainer.getSearchRequest();
 
         // We can allocate the Attribute Value Assertion
         Filter filter = new AttributeValueAssertionFilter( 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAssertionValueFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAssertionValueFilterAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAssertionValueFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAssertionValueFilterAction.java Mon Feb 15 01:37:34 2010
@@ -25,7 +25,6 @@
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.ldap.codec.AttributeValueAssertion;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.AttributeValueAssertionFilter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
@@ -33,7 +32,6 @@
 import org.apache.directory.shared.ldap.entry.client.ClientBinaryValue;
 import org.apache.directory.shared.ldap.entry.client.ClientStringValue;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -63,8 +61,7 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-        SearchRequestCodec searchRequest = ldapMessage.getSearchRequest();
+        SearchRequestCodec searchRequest = ldapMessageContainer.getSearchRequest();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAttributeDescFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAttributeDescFilterAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAttributeDescFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitAttributeDescFilterAction.java Mon Feb 15 01:37:34 2010
@@ -25,12 +25,10 @@
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.ldap.codec.AttributeValueAssertion;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.AttributeValueAssertionFilter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -60,8 +58,7 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-        SearchRequestCodec searchRequest = ldapMessage.getSearchRequest();
+        SearchRequestCodec searchRequest = ldapMessageContainer.getSearchRequest();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitEqualityMatchFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitEqualityMatchFilterAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitEqualityMatchFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitEqualityMatchFilterAction.java Mon Feb 15 01:37:34 2010
@@ -24,12 +24,10 @@
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.AttributeValueAssertionFilter;
 import org.apache.directory.shared.ldap.codec.search.Filter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -59,8 +57,7 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-        SearchRequestCodec searchRequest = ldapMessage.getSearchRequest();
+        SearchRequestCodec searchRequest = ldapMessageContainer.getSearchRequest();
 
         // We can allocate the Attribute Value Assertion
         Filter filter = new AttributeValueAssertionFilter( 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitExtensibleMatchFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitExtensibleMatchFilterAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitExtensibleMatchFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitExtensibleMatchFilterAction.java Mon Feb 15 01:37:34 2010
@@ -23,12 +23,10 @@
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.codec.DecoderException;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.ExtensibleMatchFilter;
 import org.apache.directory.shared.ldap.codec.search.Filter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -55,8 +53,7 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-        SearchRequestCodec searchRequest = ldapMessage.getSearchRequest();
+        SearchRequestCodec searchRequest = ldapMessageContainer.getSearchRequest();
 
         // We can allocate the ExtensibleMatch Filter
         Filter extensibleMatchFilter = new ExtensibleMatchFilter( ldapMessageContainer.getTlvId() );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitGreaterOrEqualFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitGreaterOrEqualFilterAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitGreaterOrEqualFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitGreaterOrEqualFilterAction.java Mon Feb 15 01:37:34 2010
@@ -24,12 +24,10 @@
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.AttributeValueAssertionFilter;
 import org.apache.directory.shared.ldap.codec.search.Filter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -59,8 +57,7 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-        SearchRequestCodec searchRequest = ldapMessage.getSearchRequest();
+        SearchRequestCodec searchRequest = ldapMessageContainer.getSearchRequest();
 
         // We can allocate the Attribute Value Assertion
         Filter filter = new AttributeValueAssertionFilter( 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitLessOrEqualFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitLessOrEqualFilterAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitLessOrEqualFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitLessOrEqualFilterAction.java Mon Feb 15 01:37:34 2010
@@ -24,12 +24,10 @@
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.AttributeValueAssertionFilter;
 import org.apache.directory.shared.ldap.codec.search.Filter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -59,8 +57,7 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-        SearchRequestCodec searchRequest = ldapMessage.getSearchRequest();
+        SearchRequestCodec searchRequest = ldapMessageContainer.getSearchRequest();
 
         // We can allocate the Attribute Value Assertion
         Filter filter = new AttributeValueAssertionFilter( 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitNotFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitNotFilterAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitNotFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitNotFilterAction.java Mon Feb 15 01:37:34 2010
@@ -24,12 +24,10 @@
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.Filter;
 import org.apache.directory.shared.ldap.codec.search.NotFilter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -59,7 +57,6 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 
@@ -69,7 +66,7 @@
             throw new DecoderException( "The Not filter PDU must not be empty" );
         }
 
-        SearchRequestCodec searchRequest = ldapMessage.getSearchRequest();
+        SearchRequestCodec searchRequest = ldapMessageContainer.getSearchRequest();
 
         // We can allocate the SearchRequest
         Filter notFilter = new NotFilter( ldapMessageContainer.getTlvId() );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitOrFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitOrFilterAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitOrFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitOrFilterAction.java Mon Feb 15 01:37:34 2010
@@ -24,12 +24,10 @@
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.Filter;
 import org.apache.directory.shared.ldap.codec.search.OrFilter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -59,7 +57,6 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 
@@ -69,7 +66,7 @@
             throw new DecoderException( "The Or filter PDU must not be empty" );
         }
 
-        SearchRequestCodec searchRequest = ldapMessage.getSearchRequest();
+        SearchRequestCodec searchRequest = ldapMessageContainer.getSearchRequest();
 
         // We can allocate the SearchRequest
         Filter orFilter = new OrFilter( ldapMessageContainer.getTlvId() );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitPresentFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitPresentFilterAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitPresentFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitPresentFilterAction.java Mon Feb 15 01:37:34 2010
@@ -24,12 +24,10 @@
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.PresentFilter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -56,8 +54,7 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-        SearchRequestCodec searchRequest = ldapMessage.getSearchRequest();
+        SearchRequestCodec searchRequest = ldapMessageContainer.getSearchRequest();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitReferralsAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitReferralsAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitReferralsAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitReferralsAction.java Mon Feb 15 01:37:34 2010
@@ -24,11 +24,9 @@
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.LdapResponseCodec;
 import org.apache.directory.shared.ldap.codec.LdapResultCodec;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -58,8 +56,7 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-        LdapResponseCodec response = ldapMessage.getLdapResponse();
+        LdapResponseCodec response = ldapMessageContainer.getLdapResponse();
         LdapResultCodec ldapResult = response.getLdapResult();
         
         TLV tlv = ldapMessageContainer.getCurrentTLV();

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitSubstringsFilterAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitSubstringsFilterAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitSubstringsFilterAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/InitSubstringsFilterAction.java Mon Feb 15 01:37:34 2010
@@ -24,12 +24,10 @@
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.Filter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
 import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -59,8 +57,7 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-        SearchRequestCodec searchRequest = ldapMessage.getSearchRequest();
+        SearchRequestCodec searchRequest = ldapMessageContainer.getSearchRequest();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/MatchedDNAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/MatchedDNAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/MatchedDNAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/MatchedDNAction.java Mon Feb 15 01:37:34 2010
@@ -26,7 +26,6 @@
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.LdapResponseCodec;
 import org.apache.directory.shared.ldap.codec.LdapResultCodec;
@@ -62,8 +61,7 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-        LdapResponseCodec response = ldapMessage.getLdapResponse();
+        LdapResponseCodec response = ldapMessageContainer.getLdapResponse();
         LdapResultCodec ldapResult = response.getLdapResult();
 
         // Get the Value and store it in the BindResponse

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ModifyAttributeValueAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ModifyAttributeValueAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ModifyAttributeValueAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ModifyAttributeValueAction.java Mon Feb 15 01:37:34 2010
@@ -23,11 +23,9 @@
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.modify.ModifyRequestCodec;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -57,8 +55,7 @@
     public void action( IAsn1Container container )
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-        ModifyRequestCodec modifyRequest = ldapMessage.getModifyRequest();
+        ModifyRequestCodec modifyRequest = ldapMessageContainer.getModifyRequest();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ReferralAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ReferralAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ReferralAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ReferralAction.java Mon Feb 15 01:37:34 2010
@@ -24,7 +24,6 @@
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.LdapResponseCodec;
 import org.apache.directory.shared.ldap.codec.LdapResultCodec;
@@ -32,7 +31,6 @@
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.LdapURL;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -62,8 +60,7 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-        LdapResponseCodec response = ldapMessage.getLdapResponse();
+        LdapResponseCodec response = ldapMessageContainer.getLdapResponse();
         LdapResultCodec ldapResult = response.getLdapResult();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ResponseAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ResponseAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ResponseAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ResponseAction.java Mon Feb 15 01:37:34 2010
@@ -24,11 +24,9 @@
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.extended.ExtendedResponseCodec;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -59,10 +57,9 @@
     {
 
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
 
         // We can allocate the ExtendedResponse Object
-        ExtendedResponseCodec extendedResponse = ldapMessage.getExtendedResponse();
+        ExtendedResponseCodec extendedResponse = ldapMessageContainer.getExtendedResponse();
 
         // Get the Value and store it in the ExtendedResponse
         TLV tlv = ldapMessageContainer.getCurrentTLV();

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ResponseNameAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ResponseNameAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ResponseNameAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ResponseNameAction.java Mon Feb 15 01:37:34 2010
@@ -25,11 +25,9 @@
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.primitives.OID;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.extended.ExtendedResponseCodec;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -59,10 +57,9 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
 
         // We can allocate the ExtendedResponse Object
-        ExtendedResponseCodec extendedResponse = ldapMessage.getExtendedResponse();
+        ExtendedResponseCodec extendedResponse = ldapMessageContainer.getExtendedResponse();
 
         // Get the Value and store it in the ExtendedResponse
         TLV tlv = ldapMessageContainer.getCurrentTLV();

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ResultCodeAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ResultCodeAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ResultCodeAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ResultCodeAction.java Mon Feb 15 01:37:34 2010
@@ -27,13 +27,11 @@
 import org.apache.directory.shared.asn1.codec.DecoderException;
 import org.apache.directory.shared.asn1.util.IntegerDecoder;
 import org.apache.directory.shared.asn1.util.IntegerDecoderException;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.LdapResponseCodec;
 import org.apache.directory.shared.ldap.codec.LdapResultCodec;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -63,8 +61,7 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec message = ldapMessageContainer.getLdapMessage();
-        LdapResponseCodec response = message.getLdapResponse();
+        LdapResponseCodec response = ldapMessageContainer.getLdapResponse();
         LdapResultCodec ldapResult = new LdapResultCodec();
         response.setLdapResult( ldapResult );
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/SearchResultAttributeValueAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/SearchResultAttributeValueAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/SearchResultAttributeValueAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/SearchResultAttributeValueAction.java Mon Feb 15 01:37:34 2010
@@ -23,11 +23,9 @@
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.SearchResultEntryCodec;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -57,8 +55,7 @@
     public void action( IAsn1Container container )
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-        SearchResultEntryCodec searchResultEntry = ldapMessage.getSearchResultEntry();
+        SearchResultEntryCodec searchResultEntry = ldapMessageContainer.getSearchResultEntry();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ServerSASLCredsAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ServerSASLCredsAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ServerSASLCredsAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ServerSASLCredsAction.java Mon Feb 15 01:37:34 2010
@@ -27,7 +27,6 @@
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.bind.BindResponseCodec;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -58,7 +57,7 @@
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
 
-        BindResponseCodec bindResponseMessage = ldapMessageContainer.getLdapMessage().getBindResponse();
+        BindResponseCodec bindResponseMessage = ldapMessageContainer.getBindResponse();
 
         // Get the Value and store it in the BindRequest
         TLV tlv = ldapMessageContainer.getCurrentTLV();

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreAnyAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreAnyAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreAnyAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreAnyAction.java Mon Feb 15 01:37:34 2010
@@ -24,12 +24,10 @@
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
 import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -59,8 +57,7 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-        SearchRequestCodec searchRequest = ldapMessage.getSearchRequest();
+        SearchRequestCodec searchRequest = ldapMessageContainer.getSearchRequest();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreFinalAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreFinalAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreFinalAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreFinalAction.java Mon Feb 15 01:37:34 2010
@@ -24,12 +24,10 @@
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
 import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -59,8 +57,7 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-        SearchRequestCodec searchRequest = ldapMessage.getSearchRequest();
+        SearchRequestCodec searchRequest = ldapMessageContainer.getSearchRequest();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreMatchValueAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreMatchValueAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreMatchValueAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreMatchValueAction.java Mon Feb 15 01:37:34 2010
@@ -24,12 +24,10 @@
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.ExtensibleMatchFilter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
 import org.apache.directory.shared.ldap.entry.client.ClientBinaryValue;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -59,8 +57,7 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-        SearchRequestCodec searchRequest = ldapMessage.getSearchRequest();
+        SearchRequestCodec searchRequest = ldapMessageContainer.getSearchRequest();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreReferenceAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreReferenceAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreReferenceAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreReferenceAction.java Mon Feb 15 01:37:34 2010
@@ -29,7 +29,6 @@
 import org.apache.directory.shared.ldap.codec.util.LdapURLEncodingException;
 import org.apache.directory.shared.ldap.util.LdapURL;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -61,8 +60,7 @@
 
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
 
-        SearchResultReferenceCodec searchResultReference = ldapMessageContainer.getLdapMessage()
-            .getSearchResultReference();
+        SearchResultReferenceCodec searchResultReference = ldapMessageContainer.getSearchResultReference();
 
         // Get the Value and store it in the BindRequest
         TLV tlv = ldapMessageContainer.getCurrentTLV();

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreTypeMatchingRuleAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreTypeMatchingRuleAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreTypeMatchingRuleAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/StoreTypeMatchingRuleAction.java Mon Feb 15 01:37:34 2010
@@ -24,12 +24,10 @@
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.codec.DecoderException;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.search.ExtensibleMatchFilter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequestCodec;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -59,8 +57,7 @@
     public void action( IAsn1Container container ) throws DecoderException
     {
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-        SearchRequestCodec searchRequest = ldapMessage.getSearchRequest();
+        SearchRequestCodec searchRequest = ldapMessageContainer.getSearchRequest();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ValueAction.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ValueAction.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ValueAction.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/actions/ValueAction.java Mon Feb 15 01:37:34 2010
@@ -23,11 +23,9 @@
 import org.apache.directory.shared.asn1.ber.IAsn1Container;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
-import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
 import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
 import org.apache.directory.shared.ldap.codec.add.AddRequestCodec;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -60,8 +58,7 @@
     {
 
         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer ) container;
-        LdapMessageCodec ldapMessage = ldapMessageContainer.getLdapMessage();
-        AddRequestCodec addRequest = ldapMessage.getAddRequest();
+        AddRequestCodec addRequest = ldapMessageContainer.getAddRequest();
 
         TLV tlv = ldapMessageContainer.getCurrentTLV();
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequestCodec.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequestCodec.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequestCodec.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddRequestCodec.java Mon Feb 15 01:37:34 2010
@@ -33,13 +33,13 @@
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
+import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
 import org.apache.directory.shared.ldap.entry.client.DefaultClientEntry;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -113,9 +113,18 @@
      * 
      * @return Returns the type.
      */
-    public int getMessageType()
+    public MessageTypeEnum getMessageType()
     {
-        return LdapConstants.ADD_REQUEST;
+        return MessageTypeEnum.ADD_REQUEST;
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String getMessageTypeName()
+    {
+        return "ADD_REQUEST";
     }
 
 
@@ -265,7 +274,7 @@
      *                    +--> ...
      *                    +--> 0x04 L7-m-n value
      */
-    public int computeLength()
+    protected int computeLengthProtocolOp()
     {
         // The entry
         addRequestLength = 1 + TLV.getNbBytes( LdapDN.getNbBytes( entry.getDn() ) ) + LdapDN.getNbBytes( entry.getDn() );
@@ -349,13 +358,8 @@
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
-    public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
+    protected void encodeProtocolOp( ByteBuffer buffer ) throws EncoderException
     {
-        if ( buffer == null )
-        {
-            throw new EncoderException( "Cannot put a PDU in a null buffer !" );
-        }
-
         try
         {
             // The AddRequest Tag
@@ -420,8 +424,15 @@
             log.debug( "AddRequest encoding : {}", StringTools.dumpBytes( buffer.array() ) );
             log.debug( "AddRequest initial value : {}", toString() );
         }
+    }
+
 
-        return buffer;
+    /**
+     * @return Returns the currentAttribute type.
+     */
+    public String getCurrentAttributeType()
+    {
+        return currentAttribute.getId();
     }
 
 
@@ -432,7 +443,6 @@
      */
     public String toString()
     {
-
         StringBuilder sb = new StringBuilder();
 
         sb.append( "    Add Request\n" );
@@ -440,22 +450,13 @@
 
         if ( entry == null )
         {
-            sb.append( "            No attributes\n" );
+            sb.append( "            No attributes" );
         }
         else
         {
             sb.append( entry );
         }
 
-        return sb.toString();
-    }
-
-
-    /**
-     * @return Returns the currentAttribute type.
-     */
-    public String getCurrentAttributeType()
-    {
-        return currentAttribute.getId();
+        return toString( sb.toString() );
     }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddResponseCodec.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddResponseCodec.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddResponseCodec.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/add/AddResponseCodec.java Mon Feb 15 01:37:34 2010
@@ -27,6 +27,7 @@
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.LdapResponseCodec;
+import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
 
 
 /**
@@ -59,9 +60,18 @@
      * 
      * @return Returns the type.
      */
-    public int getMessageType()
+    public MessageTypeEnum getMessageType()
     {
-        return LdapConstants.ADD_RESPONSE;
+        return MessageTypeEnum.ADD_RESPONSE;
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String getMessageTypeName()
+    {
+        return "ADD_RESPONSE";
     }
 
 
@@ -78,11 +88,11 @@
      * 
      * Length(AddResponse) = Length(0x69) + Length(L1) + L1
      */
-    public int computeLength()
+    protected int computeLengthProtocolOp()
     {
-        int ldapResponseLength = super.computeLength();
+        int ldapResultLength = super.computeLdapResultLength();
 
-        return 1 + TLV.getNbBytes( ldapResponseLength ) + ldapResponseLength;
+        return 1 + TLV.getNbBytes( ldapResultLength ) + ldapResultLength;
     }
 
 
@@ -92,13 +102,8 @@
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
-    public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
+    protected void encodeProtocolOp( ByteBuffer buffer ) throws EncoderException
     {
-        if ( buffer == null )
-        {
-            throw new EncoderException( "Cannot put a PDU in a null buffer !" );
-        }
-
         try
         {
             // The tag
@@ -111,7 +116,7 @@
         }
 
         // The ldapResult
-        return super.encode( buffer );
+        super.encode( buffer );
     }
 
 
@@ -122,12 +127,6 @@
      */
     public String toString()
     {
-
-        StringBuffer sb = new StringBuffer();
-
-        sb.append( "    Add Response\n" );
-        sb.append( super.toString() );
-
-        return sb.toString();
+        return toString( "    Add Response" );
     }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/BindRequestCodec.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/BindRequestCodec.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/BindRequestCodec.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/BindRequestCodec.java Mon Feb 15 01:37:34 2010
@@ -28,6 +28,7 @@
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
+import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -69,9 +70,18 @@
      * 
      * @return Returns the type.
      */
-    public int getMessageType()
+    public MessageTypeEnum getMessageType()
     {
-        return LdapConstants.BIND_REQUEST;
+        return MessageTypeEnum.BIND_REQUEST;
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String getMessageTypeName()
+    {
+        return "BIND_REQUEST";
     }
 
 
@@ -178,6 +188,7 @@
      * Compute the BindRequest length 
      * 
      * BindRequest : 
+     * <pre>
      * 0x60 L1 
      *   | 
      *   +--> 0x02 0x01 (1..127) version 
@@ -188,8 +199,9 @@
      * L3/4 = Length(authentication) 
      * Length(BindRequest) = Length(0x60) + Length(L1) + L1 + Length(0x02) + 1 + 1 + 
      *      Length(0x04) + Length(L2) + L2 + Length(authentication)
+     * </pre>
      */
-    public int computeLength()
+    protected int computeLengthProtocolOp()
     {
         bindRequestLength = 1 + 1 + 1; // Initialized with version
 
@@ -208,24 +220,19 @@
      * Encode the BindRequest message to a PDU. 
      * 
      * BindRequest : 
-     * 
+     * <pre>
      * 0x60 LL 
      *   0x02 LL version         0x80 LL simple 
      *   0x04 LL name           /   
      *   authentication.encode() 
      *                          \ 0x83 LL mechanism [0x04 LL credential]
-     * 
+     * </pre>
      * 
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
-    public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
+    protected void encodeProtocolOp( ByteBuffer buffer ) throws EncoderException
     {
-        if ( buffer == null )
-        {
-            throw new EncoderException( "Cannot put a PDU in a null buffer !" );
-        }
-
         try
         {
             // The BindRequest Tag
@@ -246,8 +253,6 @@
 
         // The authentication
         authentication.encode( buffer );
-
-        return buffer;
     }
 
 
@@ -258,14 +263,14 @@
      */
     public String toString()
     {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         sb.append( "    BindRequest\n" );
         sb.append( "        Version : '" ).append( version ).append( "'\n" );
 
         if ( ( null == name ) || StringTools.isEmpty( name.toString() ) )
         {
-            sb.append( "        Name : anonymous\n" );
+            sb.append( "        Name : anonymous" );
         }
         else
         {
@@ -273,7 +278,7 @@
 
             if ( authentication instanceof SimpleAuthentication )
             {
-                sb.append( "        Simple authentication : '" ).append( authentication ).append( "'\n" );
+                sb.append( "        Simple authentication : '" ).append( authentication ).append( '\'' );
             }
             else
             {
@@ -281,7 +286,7 @@
             }
         }
 
-        return sb.toString();
+        return toString( sb.toString() );
     }
 
     /* Used only for test perfs

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/BindResponseCodec.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/BindResponseCodec.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/BindResponseCodec.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/BindResponseCodec.java Mon Feb 15 01:37:34 2010
@@ -27,6 +27,7 @@
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.LdapResponseCodec;
+import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -75,9 +76,18 @@
      * 
      * @return Returns the type.
      */
-    public int getMessageType()
+    public MessageTypeEnum getMessageType()
     {
-        return LdapConstants.BIND_RESPONSE;
+        return MessageTypeEnum.BIND_RESPONSE;
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String getMessageTypeName()
+    {
+        return "BIND_RESPONSE";
     }
 
 
@@ -118,6 +128,7 @@
      * Compute the BindResponse length 
      * 
      * BindResponse : 
+     * <pre>
      * 0x61 L1 
      *   | 
      *   +--> LdapResult
@@ -125,12 +136,13 @@
      *   
      * L1 = Length(LdapResult) [ + Length(serverSaslCreds) ] 
      * Length(BindResponse) = Length(0x61) + Length(L1) + L1
+     * </pre>
      */
-    public int computeLength()
+    protected int computeLengthProtocolOp()
     {
-        int ldapResponseLength = super.computeLength();
+        int ldapResultLength = computeLdapResultLength();
 
-        bindResponseLength = ldapResponseLength;
+        bindResponseLength = ldapResultLength;
 
         if ( serverSaslCreds != null )
         {
@@ -143,19 +155,19 @@
 
 
     /**
-     * Encode the BindResponse message to a PDU. BindResponse :
-     * LdapResult.encode [0x87 LL serverSaslCreds]
+     * Encode the BindResponse message to a PDU.
+     * 
+     * BindResponse :
+     * <pre>
+     * LdapResult.encode 
+     * [0x87 LL serverSaslCreds]
+     * </pre>
      * 
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
-    public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
+    protected void encodeProtocolOp( ByteBuffer buffer ) throws EncoderException
     {
-        if ( buffer == null )
-        {
-            throw new EncoderException( "Cannot put a PDU in a null buffer !" );
-        }
-
         try
         {
             // The BindResponse Tag
@@ -182,8 +194,6 @@
         {
             throw new EncoderException( "The PDU buffer size is too small !" );
         }
-
-        return buffer;
     }
 
 
@@ -194,18 +204,19 @@
      */
     public String toString()
     {
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
-        sb.append( "    BindResponse\n" );
-        sb.append( super.toString() );
+        sb.append( "    BindResponse" );
 
         if ( serverSaslCreds != null )
         {
-            sb.append( "        Server sasl credentials : '" ).
+            sb.append( "\n        Server sasl credentials : '" ).
                 append( StringTools.dumpBytes( serverSaslCreds ) ).
-                append( "'\n" );
+                append( '\'' );
         }
+        
+        sb.append( super.toString() );
 
-        return sb.toString();
+        return toString( sb.toString() );
     }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SaslCredentials.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SaslCredentials.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SaslCredentials.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/bind/SaslCredentials.java Mon Feb 15 01:37:34 2010
@@ -23,6 +23,7 @@
 import java.nio.BufferOverflowException;
 import java.nio.ByteBuffer;
 
+import org.apache.directory.shared.asn1.Asn1Object;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.asn1.codec.EncoderException;
@@ -226,17 +227,16 @@
      */
     public String toString()
     {
-
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         sb.append( "        Sasl credentials\n" );
-        sb.append( "            Mechanism :'" ).append( mechanism ).append( "'\n" );
+        sb.append( "            Mechanism :'" ).append( mechanism ).append( '\'' );
 
         if ( credentials != null )
         {
-            sb.append( "            Credentials :'" ).
+            sb.append( "\n            Credentials :'" ).
                 append( StringTools.dumpBytes(  credentials ) ).
-                append( "'\n" );
+                append( '\'' );
         }
 
         return sb.toString();

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestCodec.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestCodec.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestCodec.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/compare/CompareRequestCodec.java Mon Feb 15 01:37:34 2010
@@ -29,6 +29,7 @@
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
+import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -91,9 +92,18 @@
      * 
      * @return Returns the type.
      */
-    public int getMessageType()
+    public MessageTypeEnum getMessageType()
     {
-        return LdapConstants.COMPARE_REQUEST;
+        return MessageTypeEnum.COMPARE_REQUEST;
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String getMessageTypeName()
+    {
+        return "COMPARE_REQUEST";
     }
 
 
@@ -182,9 +192,8 @@
      * 
      * @return The CompareRequest PDU's length
      */
-    public int computeLength()
+    protected int computeLengthProtocolOp()
     {
-
         // The entry
         compareRequestLength = 1 + TLV.getNbBytes( LdapDN.getNbBytes( entry ) ) + LdapDN.getNbBytes( entry );
 
@@ -222,13 +231,8 @@
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
-    public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
+    protected void encodeProtocolOp( ByteBuffer buffer ) throws EncoderException
     {
-        if ( buffer == null )
-        {
-            throw new EncoderException( "Cannot put a PDU in a null buffer !" );
-        }
-
         try
         {
             // The CompareRequest Tag
@@ -259,8 +263,6 @@
         {
             Value.encode( buffer, ( byte[] ) assertionValue );
         }
-
-        return buffer;
     }
 
 
@@ -271,14 +273,13 @@
      */
     public String toString()
     {
-
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         sb.append( "    Compare request\n" );
         sb.append( "        Entry : '" ).append( entry ).append( "'\n" );
         sb.append( "        Attribute description : '" ).append( attributeDesc ).append( "'\n" );
-        sb.append( "        Attribute value : '" ).append( StringTools.dumpObject( assertionValue )  ).append( "'\n" );
+        sb.append( "        Attribute value : '" ).append( StringTools.dumpObject( assertionValue ) ).append( '\'' );
 
-        return sb.toString();
+        return toString( sb.toString() );
     }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseCodec.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseCodec.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseCodec.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/compare/CompareResponseCodec.java Mon Feb 15 01:37:34 2010
@@ -27,6 +27,7 @@
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.LdapResponseCodec;
+import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
 
 
 /**
@@ -53,18 +54,6 @@
 
     // ~ Methods
     // ------------------------------------------------------------------------------------
-
-    /**
-     * Get the message type
-     * 
-     * @return Returns the type.
-     */
-    public int getMessageType()
-    {
-        return LdapConstants.COMPARE_RESPONSE;
-    }
-
-
     /**
      * Compute the CompareResponse length 
      * 
@@ -78,11 +67,11 @@
      * 
      * Length(CompareResponse) = Length(0x6F) + Length(L1) + L1
      */
-    public int computeLength()
+    protected int computeLengthProtocolOp()
     {
-        int ldapResponseLength = super.computeLength();
+        int ldapResultLength = super.computeLdapResultLength();
 
-        return 1 + TLV.getNbBytes( ldapResponseLength ) + ldapResponseLength;
+        return 1 + TLV.getNbBytes( ldapResultLength ) + ldapResultLength;
     }
 
 
@@ -92,13 +81,8 @@
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
-    public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
+    protected void encodeProtocolOp( ByteBuffer buffer ) throws EncoderException
     {
-        if ( buffer == null )
-        {
-            throw new EncoderException( "Cannot put a PDU in a null buffer !" );
-        }
-
         try
         {
             // The tag
@@ -110,8 +94,28 @@
             throw new EncoderException( "The PDU buffer size is too small !" );
         }
 
-        // The ldapResult
-        return super.encode( buffer );
+        // The LdapResult
+        super.encode( buffer );
+    }
+
+    
+    /**
+     * Get the message type
+     * 
+     * @return Returns the type.
+     */
+    public MessageTypeEnum getMessageType()
+    {
+        return MessageTypeEnum.COMPARE_RESPONSE;
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String getMessageTypeName()
+    {
+        return "COMPARE_RESPONSE";
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/del/DelRequestCodec.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/del/DelRequestCodec.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/del/DelRequestCodec.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/del/DelRequestCodec.java Mon Feb 15 01:37:34 2010
@@ -27,6 +27,7 @@
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
+import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 
 
@@ -69,9 +70,18 @@
      * 
      * @return Returns the type.
      */
-    public int getMessageType()
+    public MessageTypeEnum getMessageType()
     {
-        return LdapConstants.DEL_REQUEST;
+        return MessageTypeEnum.DEL_REQUEST;
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String getMessageTypeName()
+    {
+        return "DEL_REQUEST";
     }
 
 
@@ -106,7 +116,7 @@
      * L1 = Length(entry) 
      * Length(DelRequest) = Length(0x4A) + Length(L1) + L1
      */
-    public int computeLength()
+    protected int computeLengthProtocolOp()
     {
         // The entry
         return 1 + TLV.getNbBytes( LdapDN.getNbBytes( entry ) ) + LdapDN.getNbBytes( entry );
@@ -122,13 +132,8 @@
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
-    public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
+    protected void encodeProtocolOp( ByteBuffer buffer ) throws EncoderException
     {
-        if ( buffer == null )
-        {
-            throw new EncoderException( "Cannot put a PDU in a null buffer !" );
-        }
-
         try
         {
             // The DelRequest Tag
@@ -142,8 +147,6 @@
         {
             throw new EncoderException( "The PDU buffer size is too small !" );
         }
-
-        return buffer;
     }
 
 
@@ -154,12 +157,11 @@
      */
     public String toString()
     {
-
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         sb.append( "    Del request\n" );
-        sb.append( "        Entry : '" ).append( entry ).append( "'\n" );
+        sb.append( "        Entry : '" ).append( entry ).append( '\'' );
 
-        return sb.toString();
+        return toString( sb.toString() );
     }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/del/DelResponseCodec.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/del/DelResponseCodec.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/del/DelResponseCodec.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/del/DelResponseCodec.java Mon Feb 15 01:37:34 2010
@@ -27,6 +27,7 @@
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.LdapResponseCodec;
+import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
 
 
 /**
@@ -56,9 +57,18 @@
      * 
      * @return Returns the type.
      */
-    public int getMessageType()
+    public MessageTypeEnum getMessageType()
     {
-        return LdapConstants.DEL_RESPONSE;
+        return MessageTypeEnum.DEL_RESPONSE;
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String getMessageTypeName()
+    {
+        return "DEL_RESPONSE";
     }
 
 
@@ -75,11 +85,11 @@
      * 
      * Length(DelResponse) = Length(0x6B) + Length(L1) + L1
      */
-    public int computeLength()
+    protected int computeLengthProtocolOp()
     {
-        int ldapResponseLength = super.computeLength();
+        int ldapResultLength = super.computeLdapResultLength();
 
-        return 1 + TLV.getNbBytes( ldapResponseLength ) + ldapResponseLength;
+        return 1 + TLV.getNbBytes( ldapResultLength ) + ldapResultLength;
     }
 
 
@@ -89,13 +99,8 @@
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
-    public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
+    protected void encodeProtocolOp( ByteBuffer buffer ) throws EncoderException
     {
-        if ( buffer == null )
-        {
-            throw new EncoderException( "Cannot put a PDU in a null buffer !" );
-        }
-
         try
         {
             // The tag
@@ -108,7 +113,7 @@
         }
 
         // The ldapResult
-        return super.encode( buffer );
+        super.encode( buffer );
     }
 
 
@@ -119,12 +124,6 @@
      */
     public String toString()
     {
-
-        StringBuffer sb = new StringBuffer();
-
-        sb.append( "    Del Response\n" );
-        sb.append( super.toString() );
-
-        return sb.toString();
+        return toString( "    Del Response" );
     }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestCodec.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestCodec.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestCodec.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedRequestCodec.java Mon Feb 15 01:37:34 2010
@@ -28,6 +28,7 @@
 import org.apache.directory.shared.asn1.primitives.OID;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.LdapMessageCodec;
+import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -78,9 +79,18 @@
      * 
      * @return Returns the type.
      */
-    public int getMessageType()
+    public MessageTypeEnum getMessageType()
     {
-        return LdapConstants.EXTENDED_REQUEST;
+        return MessageTypeEnum.EXTENDED_REQUEST;
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String getMessageTypeName()
+    {
+        return "EXTENDED_REQUEST";
     }
 
 
@@ -156,7 +166,7 @@
      * 
      * Length(ExtendedRequest) = Length(0x77) + Length(L1) + L1
      */
-    public int computeLength()
+    protected int computeLengthProtocolOp()
     {
         oidLength = requestName.toString().length();
         extendedRequestLength = 1 + TLV.getNbBytes( oidLength ) + oidLength;
@@ -182,13 +192,8 @@
      * @param buffer The buffer where to put the PDU
      * @return The PDU.
      */
-    public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
+    protected void encodeProtocolOp( ByteBuffer buffer ) throws EncoderException
     {
-        if ( buffer == null )
-        {
-            throw new EncoderException( "Cannot put a PDU in a null buffer !" );
-        }
-
         try
         {
             // The BindResponse Tag
@@ -226,8 +231,6 @@
         {
             throw new EncoderException( "The PDU buffer size is too small !" );
         }
-
-        return buffer;
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseCodec.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseCodec.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseCodec.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/ExtendedResponseCodec.java Mon Feb 15 01:37:34 2010
@@ -28,6 +28,7 @@
 import org.apache.directory.shared.asn1.primitives.OID;
 import org.apache.directory.shared.ldap.codec.LdapConstants;
 import org.apache.directory.shared.ldap.codec.LdapResponseCodec;
+import org.apache.directory.shared.ldap.codec.MessageTypeEnum;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -79,9 +80,18 @@
      * 
      * @return Returns the type.
      */
-    public int getMessageType()
+    public MessageTypeEnum getMessageType()
     {
-        return LdapConstants.EXTENDED_RESPONSE;
+        return MessageTypeEnum.EXTENDED_RESPONSE;
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String getMessageTypeName()
+    {
+        return "EXTENDED_RESPONSE";
     }
 
 
@@ -148,9 +158,11 @@
      * 
      * @return The ExtendedResponse length
      */
-    public int computeLength()
+    protected int computeLengthProtocolOp()
     {
-        extendedResponseLength = super.computeLength();
+        int ldapResultLength = super.computeLdapResultLength();
+        
+        extendedResponseLength = ldapResultLength;
 
         if ( responseName != null )
         {
@@ -187,13 +199,8 @@
      *            The buffer where to put the PDU
      * @return The PDU.
      */
-    public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
+    protected void encodeProtocolOp( ByteBuffer buffer ) throws EncoderException
     {
-        if ( buffer == null )
-        {
-            throw new EncoderException( "Cannot put a PDU in a null buffer !" );
-        }
-
         try
         {
             // The ExtendedResponse Tag
@@ -245,8 +252,6 @@
         {
             throw new EncoderException( "The PDU buffer size is too small !" );
         }
-
-        return buffer;
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/cancel/Cancel.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/cancel/Cancel.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/cancel/Cancel.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/cancel/Cancel.java Mon Feb 15 01:37:34 2010
@@ -113,11 +113,10 @@
     /**
      * Encodes the cancel extended operation.
      * 
-     * @param buffer The encoded sink
      * @return A ByteBuffer that contains the encoded PDU
      * @throws EncoderException If anything goes wrong.
      */
-    public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
+    public ByteBuffer encode() throws EncoderException
     {
         // Allocate the bytes buffer.
         ByteBuffer bb = ByteBuffer.allocate( computeLength() );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/certGeneration/CertGenerationObject.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/certGeneration/CertGenerationObject.java?rev=910150&r1=910149&r2=910150&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/certGeneration/CertGenerationObject.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/extended/operations/certGeneration/CertGenerationObject.java Mon Feb 15 01:37:34 2010
@@ -83,8 +83,7 @@
     }
 
 
-    @Override
-    public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
+    public ByteBuffer encode() throws EncoderException
     {
         ByteBuffer bb = ByteBuffer.allocate( computeLength() );
 



Mime
View raw message