public class BindRequestDecorator extends SingleReplyRequestDecorator<BindRequest> implements BindRequest
messageLength| Constructor and Description |
|---|
BindRequestDecorator(LdapApiService codec,
BindRequest decoratedMessage)
Makes a BindRequest a MessageDecorator.
|
| Modifier and Type | Method and Description |
|---|---|
BindRequest |
addAllControls(Control[] controls)
Adds an array of controls to this Message.
|
BindRequest |
addControl(Control control)
Adds a control to this Message.
|
int |
computeLength()
Compute the BindRequest length
BindRequest :
|
ByteBuffer |
encode(ByteBuffer buffer)
Encode the BindRequest message to a PDU.
|
byte[] |
getCredentials()
Gets the simple credentials associated with a simple authentication
attempt or null if this request uses SASL authentication mechanisms.
|
Dn |
getDn()
Gets the DN of the subject in this authentication
request.
|
String |
getName()
Gets the name of the subject in this authentication
request.
|
String |
getSaslMechanism()
Gets the SASL mechanism String associated with this BindRequest if the
bind operation is using SASL.
|
boolean |
getSimple()
Checks to see if the authentication mechanism is simple and not SASL
based.
|
boolean |
getVersion3()
Gets whether or not the Ldap v3 protocol is used.
|
boolean |
isSimple()
Checks to see if the authentication mechanism is simple and not SASL
based.
|
boolean |
isVersion3()
Checks to see if the Ldap v3 protocol is used.
|
BindRequest |
removeControl(Control control)
Deletes a control removing it from this Message.
|
BindRequest |
setCredentials(byte[] credentials)
Sets the simple credentials associated with a simple authentication
attempt.
|
BindRequest |
setCredentials(String credentials)
Sets the simple credentials associated with a simple authentication
attempt.
|
BindRequest |
setDn(Dn dn)
Sets the DN of the subject in this authentication
request.
|
BindRequest |
setMessageId(int messageId)
Sets the Message ID for this request
|
BindRequest |
setName(String name)
Sets the name of the subject in this authentication
request.
|
BindRequest |
setSaslMechanism(String saslMechanism)
Sets the SASL mechanism String associated with this BindRequest if the
bind operation is using SASL.
|
BindRequest |
setSimple(boolean isSimple)
Sets the authentication mechanism to simple or to SASL based
authentication.
|
BindRequest |
setVersion3(boolean isVersion3)
Sets whether or not the LDAP v3 or v2 protocol is used.
|
abandon, addAbandonListener, getResponseType, isAbandonedgetResultResponse, hasResponseget, getCodecService, getControl, getControls, getControlsLength, getCurrentControl, getDecorated, getDecorator, getMessageId, getMessageLength, getType, hasControl, put, setControlsLength, setMessageLength, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetResponseTypegetResultResponsehasResponseget, getControl, getControls, getMessageId, getType, hasControl, putabandon, addAbandonListener, isAbandonedpublic BindRequestDecorator(LdapApiService codec, BindRequest decoratedMessage)
decoratedMessage - the decorated BindRequests.public BindRequest setMessageId(int messageId)
setMessageId in interface BindRequestsetMessageId in interface MessagesetMessageId in class MessageDecorator<BindRequest>messageId - The message Idpublic BindRequest addControl(Control control)
addControl in interface BindRequestaddControl in interface MessageaddControl in class MessageDecorator<BindRequest>control - the control to add.public BindRequest addAllControls(Control[] controls)
addAllControls in interface BindRequestaddAllControls in interface MessageaddAllControls in class MessageDecorator<BindRequest>controls - the controls to add.public BindRequest removeControl(Control control)
removeControl in interface BindRequestremoveControl in interface MessageremoveControl in class MessageDecorator<BindRequest>control - the control to remove.public boolean isSimple()
isSimple in interface BindRequestpublic boolean getSimple()
getSimple in interface BindRequestpublic BindRequest setSimple(boolean isSimple)
setSimple in interface BindRequestisSimple - true if authentication is simple, false otherwise.public byte[] getCredentials()
getCredentials in interface BindRequestpublic BindRequest setCredentials(String credentials)
setCredentials in interface BindRequestcredentials - the credentials if authentication is simplepublic BindRequest setCredentials(byte[] credentials)
setCredentials in interface BindRequestcredentials - the credentials if authentication is simplepublic String getName()
getName in interface BindRequestpublic BindRequest setName(String name)
setName in interface BindRequestname - the name of the authenticating user - leave null for anonymous user.public Dn getDn()
getDn in interface BindRequestpublic BindRequest setDn(Dn dn)
setDn in interface BindRequestdn - the DN of the authenticating user - leave null for anonymous user.public boolean isVersion3()
isVersion3 in interface BindRequestpublic boolean getVersion3()
getVersion3 in interface BindRequestpublic BindRequest setVersion3(boolean isVersion3)
setVersion3 in interface BindRequestisVersion3 - if true the client will be exhibiting version 3 bind behavior,
If false is used version 2 behavior will be exhibited.public String getSaslMechanism()
getSaslMechanism in interface BindRequestpublic BindRequest setSaslMechanism(String saslMechanism)
setSaslMechanism in interface BindRequestsaslMechanism - the SASL mechanismpublic int computeLength()
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)
computeLength in interface Asn1ObjectcomputeLength in interface Decorator<BindRequest>public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
0x60 LL
0x02 LL version 0x80 LL simple
0x04 LL name /
authentication.encode()
\ 0x83 LL mechanism [0x04 LL credential]
encode in interface Asn1Objectencode in interface Decorator<BindRequest>buffer - The buffer where to put the PDUEncoderException - if the buffer can't be encodedCopyright © 2021. All rights reserved.