Class LdapProtocolDecoder

  • All Implemented Interfaces:
    org.apache.mina.filter.codec.ProtocolDecoder

    public class LdapProtocolDecoder
    extends Object
    implements org.apache.mina.filter.codec.ProtocolDecoder
    A LDAP message decoder. It is based on api-ldap decoder.
    Author:
    Apache Directory Project
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static org.slf4j.Logger CODEC_LOG
      The logger
      private org.apache.directory.api.ldap.codec.api.LdapApiService ldapApiService
      The LDAP API Service instance
    • Constructor Summary

      Constructors 
      Constructor Description
      LdapProtocolDecoder​(org.apache.directory.api.ldap.codec.api.LdapApiService ldapApiService)
      Creates a new instance of LdapProtocolEncoder.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void decode​(ByteBuffer buffer, org.apache.directory.api.ldap.codec.api.LdapMessageContainer<org.apache.directory.api.ldap.model.message.AbstractMessage> messageContainer, List<org.apache.directory.api.ldap.model.message.Message> decodedMessages)
      Decode an incoming buffer into LDAP messages.
      void decode​(org.apache.mina.core.session.IoSession session, org.apache.mina.core.buffer.IoBuffer in, org.apache.mina.filter.codec.ProtocolDecoderOutput out)
      void dispose​(org.apache.mina.core.session.IoSession session)
      void finishDecode​(org.apache.mina.core.session.IoSession session, org.apache.mina.filter.codec.ProtocolDecoderOutput out)
    • Field Detail

      • CODEC_LOG

        private static final org.slf4j.Logger CODEC_LOG
        The logger
      • ldapApiService

        private org.apache.directory.api.ldap.codec.api.LdapApiService ldapApiService
        The LDAP API Service instance
    • Constructor Detail

      • LdapProtocolDecoder

        public LdapProtocolDecoder​(org.apache.directory.api.ldap.codec.api.LdapApiService ldapApiService)
        Creates a new instance of LdapProtocolEncoder.
    • Method Detail

      • decode

        public void decode​(org.apache.mina.core.session.IoSession session,
                           org.apache.mina.core.buffer.IoBuffer in,
                           org.apache.mina.filter.codec.ProtocolDecoderOutput out)
                    throws Exception
        Specified by:
        decode in interface org.apache.mina.filter.codec.ProtocolDecoder
        Throws:
        Exception
      • decode

        private void decode​(ByteBuffer buffer,
                            org.apache.directory.api.ldap.codec.api.LdapMessageContainer<org.apache.directory.api.ldap.model.message.AbstractMessage> messageContainer,
                            List<org.apache.directory.api.ldap.model.message.Message> decodedMessages)
                     throws org.apache.directory.api.asn1.DecoderException
        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.
        Parameters:
        buffer - The incoming byte buffer
        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
        decodedMessages - The list of decoded messages
        Throws:
        org.apache.directory.api.asn1.DecoderException - If the decoding failed
      • finishDecode

        public void finishDecode​(org.apache.mina.core.session.IoSession session,
                                 org.apache.mina.filter.codec.ProtocolDecoderOutput out)
                          throws Exception
        Specified by:
        finishDecode in interface org.apache.mina.filter.codec.ProtocolDecoder
        Throws:
        Exception
      • dispose

        public void dispose​(org.apache.mina.core.session.IoSession session)
                     throws Exception
        Specified by:
        dispose in interface org.apache.mina.filter.codec.ProtocolDecoder
        Throws:
        Exception