directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1188591 - /directory/shared/branches/shared-txns/ldap/codec/core/src/main/java/org/apache/directory/shared/ldap/codec/api/LdapDecoder.java
Date Tue, 25 Oct 2011 10:15:10 GMT
Author: elecharny
Date: Tue Oct 25 10:15:10 2011
New Revision: 1188591

URL: http://svn.apache.org/viewvc?rev=1188591&view=rev
Log:
Removed commented code

Modified:
    directory/shared/branches/shared-txns/ldap/codec/core/src/main/java/org/apache/directory/shared/ldap/codec/api/LdapDecoder.java

Modified: directory/shared/branches/shared-txns/ldap/codec/core/src/main/java/org/apache/directory/shared/ldap/codec/api/LdapDecoder.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-txns/ldap/codec/core/src/main/java/org/apache/directory/shared/ldap/codec/api/LdapDecoder.java?rev=1188591&r1=1188590&r2=1188591&view=diff
==============================================================================
--- directory/shared/branches/shared-txns/ldap/codec/core/src/main/java/org/apache/directory/shared/ldap/codec/api/LdapDecoder.java
(original)
+++ directory/shared/branches/shared-txns/ldap/codec/core/src/main/java/org/apache/directory/shared/ldap/codec/api/LdapDecoder.java
Tue Oct 25 10:15:10 2011
@@ -104,88 +104,4 @@ public class LdapDecoder
             throw new DecoderException( I18n.err( I18n.ERR_04063 ) );
         }
     }
-
-
-    /**
-     * Decode an incoming buffer into LDAP messages. The result can be 0, 1 or many 
-     * LDAP messages, which will be stored into the array the caller has created.
-     * 
-     * @param buffer The incoming byte buffer
-     * @param messageContainer The LdapMessageContainer which will be used to store the
-     * message being decoded. If the message is not fully decoded, the ucrrent state
-     * is stored into this container
-     * @param decodedMessages The list of decoded messages
-     * @throws Exception If the decoding failed
-     *
-    public void decode( ByteBuffer buffer, LdapMessageContainer<MessageDecorator<?
extends Message>> messageContainer, List<Message> decodedMessages ) throws DecoderException
-    {
-        buffer.mark();
-
-        while ( buffer.hasRemaining() )
-        {
-            try
-            {
-                if ( IS_DEBUG )
-                {
-                    LOG.debug( "Decoding the PDU : " );
-
-                    int size = buffer.limit();
-                    int position = buffer.position();
-                    int pduLength = size - position;
-
-                    byte[] array = new byte[pduLength];
-
-                    System.arraycopy(buffer.array(), position, array, 0, pduLength);
-
-                    buffer.position( size );
-
-                    if ( array.length == 0 )
-                    {
-                        LOG.debug( "NULL buffer, what the HELL ???" );
-                    }
-                    else
-                    {
-                        LOG.debug( Strings.dumpBytes(array) );
-                    }
-
-                    buffer.reset();
-                }
-
-                asn1Decoder.decode( buffer, messageContainer );
-
-                if ( messageContainer.getState() == TLVStateEnum.PDU_DECODED )
-                {
-                    if ( IS_DEBUG )
-                    {
-                        LOG.debug( "Decoded LdapMessage : " + messageContainer.getMessage()
);
-                    }
-
-                    Message message = messageContainer.getMessage();
-
-                    decodedMessages.add( message );
-
-                    messageContainer.clean();
-                }
-            }
-            catch ( DecoderException de )
-            {
-                buffer.clear();
-                messageContainer.clean();
-
-                if ( de instanceof ResponseCarryingException )
-                {
-                    // Transform the DecoderException message to a MessageException
-                    ResponseCarryingMessageException rcme = new ResponseCarryingMessageException(
de.getMessage() );
-                    rcme.setResponse( ( ( ResponseCarryingException ) de ).getResponse()
);
-
-                    throw rcme;
-                }
-                else
-                {
-                    // TODO : This is certainly not the way we should handle such an exception
!
-                    throw new ResponseCarryingException( de.getMessage() );
-                }
-            }
-        }
-    }*/
 }



Mime
View raw message