public class BindRequestCodec extends LdapMessageCodec
ldapMessageLength
parent
Constructor and Description |
---|
BindRequestCodec()
Creates a new BindRequest object.
|
Modifier and Type | Method and Description |
---|---|
protected int |
computeLengthProtocolOp()
Compute the BindRequest length
BindRequest :
|
protected void |
encodeProtocolOp(ByteBuffer buffer)
Encode the BindRequest message to a PDU.
|
LdapAuthentication |
getAuthentication()
Get the user authentication
|
MessageTypeEnum |
getMessageType()
Get the message type
|
String |
getMessageTypeName()
Get the message type Name
|
DN |
getName()
Get the user name
|
SaslCredentials |
getSaslAuthentication()
Get the user sasl authentication
|
SimpleAuthentication |
getSimpleAuthentication()
Get the user simple authentication
|
int |
getVersion()
Get the protocol version
|
boolean |
isLdapV3()
Check if the Ldap version in use is 3
|
void |
setAuthentication(LdapAuthentication authentication)
Set the user authentication
|
void |
setName(DN name)
Set the user name
|
void |
setVersion(int version)
Set the protocol version
|
String |
toString()
Get a String representation of a BindRequest
|
addControl, addControls, computeLength, encode, getCodecControl, getControls, getControls, getCurrentControl, getMessageId, initControls, setMessageId, toString
addLength, encode, getCurrentLength, getExpectedLength, getParent, getTlvId, setCurrentLength, setExpectedLength, setParent
public MessageTypeEnum getMessageType()
getMessageType
in class LdapMessageCodec
public String getMessageTypeName()
getMessageTypeName
in class LdapMessageCodec
public LdapAuthentication getAuthentication()
public SimpleAuthentication getSimpleAuthentication()
public SaslCredentials getSaslAuthentication()
public void setAuthentication(LdapAuthentication authentication)
authentication
- The user authenticationpublic DN getName()
public void setName(DN name)
name
- The user namepublic int getVersion()
public boolean isLdapV3()
public void setVersion(int version)
version
- The protocol versionprotected int computeLengthProtocolOp()
0x60 L1 | +--> 0x02 0x01 (1..127) version +--> 0x04 L2 name +--> authentication L2 = Length(name) L3/4 = Length(authentication) Length(BindRequest) = Length(0x60) + Length(L1) + L1 + Length(0x02) + 1 + 1 + Length(0x04) + Length(L2) + L2 + Length(authentication)
computeLengthProtocolOp
in class LdapMessageCodec
protected void encodeProtocolOp(ByteBuffer buffer) throws EncoderException
0x60 LL 0x02 LL version 0x80 LL simple 0x04 LL name / authentication.encode() \ 0x83 LL mechanism [0x04 LL credential]
encodeProtocolOp
in class LdapMessageCodec
buffer
- The buffer where to put the PDUEncoderException
Copyright © 2003–2016 The Apache Software Foundation. All rights reserved.