Class LdapProtocolDecoder
- java.lang.Object
-
- org.apache.directory.api.ldap.codec.protocol.mina.LdapProtocolDecoder
-
- All Implemented Interfaces:
ProtocolDecoder
public class LdapProtocolDecoder extends Object implements ProtocolDecoder
A LDAP message decoder. It is based on api-ldap decoder.- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description LdapProtocolDecoder()Creates a new instance of LdapProtocolEncoder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddecode(IoSession session, IoBuffer in, ProtocolDecoderOutput out)Decodes binary or protocol-specific content into higher-level message objects.voiddispose(IoSession session)Releases all resources related with this decoder.voidfinishDecode(IoSession session, ProtocolDecoderOutput out)Invoked when the specifiedsessionis closed.
-
-
-
Method Detail
-
decode
public void decode(IoSession session, IoBuffer in, ProtocolDecoderOutput out) throws Exception
Decodes binary or protocol-specific content into higher-level message objects. MINA invokesProtocolDecoder.decode(IoSession, IoBuffer, ProtocolDecoderOutput)method with read data, and then the decoder implementation puts decoded messages intoProtocolDecoderOutput.- Specified by:
decodein interfaceProtocolDecoder- Parameters:
session- The current Sessionin- the buffer to decodeout- TheProtocolDecoderOutputthat will receive the decoded message- Throws:
Exception- if the read data violated protocol specification
-
finishDecode
public void finishDecode(IoSession session, ProtocolDecoderOutput out) throws Exception
Invoked when the specifiedsessionis closed. This method is useful when you deal with the protocol which doesn't specify the length of a message such as HTTP response withoutcontent-lengthheader. Implement this method to process the remaining data thatProtocolDecoder.decode(IoSession, IoBuffer, ProtocolDecoderOutput)method didn't process completely.- Specified by:
finishDecodein interfaceProtocolDecoder- Parameters:
session- The current Sessionout- TheProtocolDecoderOutputthat contains the decoded message- Throws:
Exception- if the read data violated protocol specification
-
dispose
public void dispose(IoSession session) throws Exception
Releases all resources related with this decoder.- Specified by:
disposein interfaceProtocolDecoder- Parameters:
session- The current Session- Throws:
Exception- if failed to dispose all resources
-
-