public class LdapEncoder extends Object
Constructor and Description |
---|
LdapEncoder(LdapApiService codec)
Creates an instance of Ldap message encoder
|
Modifier and Type | Method and Description |
---|---|
static int |
computeReferralLength(Referral referral)
Compute the referral's encoded length
|
ByteBuffer |
encodeMessage(Message message)
Generate the PDU which contains the encoded object.
|
static void |
encodeReferral(ByteBuffer buffer,
Referral referral)
Encode the Referral message to a PDU.
|
public LdapEncoder(LdapApiService codec)
codec
- The Codec service to use to handle Controls and extended operations,
plus to get access to the underlying services.public ByteBuffer encodeMessage(Message message) throws EncoderException
0x30 L1 | +--> 0x02 L2 MessageId +--> ProtocolOp +--> Controls L2 = Length(MessageId) L1 = Length(0x02) + Length(L2) + L2 + Length(ProtocolOp) + Length(Controls) LdapMessageLength = Length(0x30) + Length(L1) + L1
message
- The message to encodeEncoderException
- If anything goes wrong.public static void encodeReferral(ByteBuffer buffer, Referral referral) throws EncoderException
buffer
- The buffer where to put the PDUreferral
- The referral to encodeEncoderException
- If the encoding failedpublic static int computeReferralLength(Referral referral)
referral
- The referral to encodeCopyright © 2003–2015 The Apache Software Foundation. All rights reserved.