public class BindRequestDecorator extends SingleReplyRequestDecorator<BindRequest> implements BindRequest
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, isAbandoned
getResultResponse, hasResponse
get, getCodecService, getControl, getControls, getControlsLength, getCurrentControl, getDecorated, getDecorator, getMessageId, getMessageLength, getType, hasControl, put, setControlsLength, setMessageLength, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getResponseType
getResultResponse
hasResponse
get, getControl, getControls, getMessageId, getType, hasControl, put
abandon, addAbandonListener, isAbandoned
public BindRequestDecorator(LdapApiService codec, BindRequest decoratedMessage)
codec
- The LDAP service instancedecoratedMessage
- the decorated BindRequests.public BindRequest setMessageId(int messageId)
setMessageId
in interface BindRequest
setMessageId
in interface Message
setMessageId
in class MessageDecorator<BindRequest>
messageId
- The message Idpublic BindRequest addControl(Control control)
addControl
in interface BindRequest
addControl
in interface Message
addControl
in class MessageDecorator<BindRequest>
control
- the control to add.public BindRequest addAllControls(Control[] controls)
addAllControls
in interface BindRequest
addAllControls
in interface Message
addAllControls
in class MessageDecorator<BindRequest>
controls
- the controls to add.public BindRequest removeControl(Control control)
removeControl
in interface BindRequest
removeControl
in interface Message
removeControl
in class MessageDecorator<BindRequest>
control
- the control to remove.public boolean isSimple()
isSimple
in interface BindRequest
public boolean getSimple()
getSimple
in interface BindRequest
public BindRequest setSimple(boolean isSimple)
setSimple
in interface BindRequest
isSimple
- true if authentication is simple, false otherwise.public byte[] getCredentials()
getCredentials
in interface BindRequest
public BindRequest setCredentials(String credentials)
setCredentials
in interface BindRequest
credentials
- the credentials if authentication is simplepublic BindRequest setCredentials(byte[] credentials)
setCredentials
in interface BindRequest
credentials
- the credentials if authentication is simplepublic String getName()
getName
in interface BindRequest
public BindRequest setName(String name)
setName
in interface BindRequest
name
- the name of the authenticating user - leave null for anonymous user.public Dn getDn()
getDn
in interface BindRequest
public BindRequest setDn(Dn dn)
setDn
in interface BindRequest
dn
- the DN of the authenticating user - leave null for anonymous user.public boolean isVersion3()
isVersion3
in interface BindRequest
public boolean getVersion3()
getVersion3
in interface BindRequest
public BindRequest setVersion3(boolean isVersion3)
setVersion3
in interface BindRequest
isVersion3
- 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 BindRequest
public BindRequest setSaslMechanism(String saslMechanism)
setSaslMechanism
in interface BindRequest
saslMechanism
- 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 Asn1Object
computeLength
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 Asn1Object
encode
in interface Decorator<BindRequest>
buffer
- The buffer where to put the PDUEncoderException
- if the buffer can't be encodedCopyright © 2003–2018 The Apache Software Foundation. All rights reserved.