Class LdapProtocolEncoder
- java.lang.Object
-
- org.apache.directory.api.ldap.codec.protocol.mina.LdapProtocolEncoder
-
- All Implemented Interfaces:
ProtocolEncoder
public class LdapProtocolEncoder extends Object implements ProtocolEncoder
A LDAP message encoder. It is based on api-ldap encoder.- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description LdapProtocolEncoder()Creates a new instance of LdapProtocolEncoder.LdapProtocolEncoder(LdapApiService ldapApiService)Creates a new instance of LdapProtocolEncoder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose(IoSession session)Releases all resources related with this encoder.voidencode(IoSession session, Object message, ProtocolEncoderOutput out)Encodes higher-level message objects into binary or protocol-specific data.
-
-
-
Constructor Detail
-
LdapProtocolEncoder
public LdapProtocolEncoder()
Creates a new instance of LdapProtocolEncoder.
-
LdapProtocolEncoder
public LdapProtocolEncoder(LdapApiService ldapApiService)
Creates a new instance of LdapProtocolEncoder.- Parameters:
ldapApiService- The Service to use
-
-
Method Detail
-
encode
public void encode(IoSession session, Object message, ProtocolEncoderOutput out) throws Exception
Encodes higher-level message objects into binary or protocol-specific data. MINA invokesProtocolEncoder.encode(IoSession, Object, ProtocolEncoderOutput)method with message which is popped from the session write queue, and then the encoder implementation puts encoded messages (typicallyIoBuffers) intoProtocolEncoderOutput.- Specified by:
encodein interfaceProtocolEncoder- Parameters:
session- The current Sessionmessage- the message to encodeout- TheProtocolEncoderOutputthat will receive the encoded message- Throws:
Exception- if the message violated protocol specification
-
dispose
public void dispose(IoSession session) throws Exception
Releases all resources related with this encoder.- Specified by:
disposein interfaceProtocolEncoder- Parameters:
session- The current Session- Throws:
Exception- if failed to dispose all resources
-
-