|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.api.ldap.codec.api.MessageDecorator<M>
org.apache.directory.api.ldap.codec.decorators.RequestDecorator<M>
org.apache.directory.api.ldap.codec.decorators.ResultResponseRequestDecorator<M,R>
org.apache.directory.api.ldap.codec.decorators.SingleReplyRequestDecorator<BindRequest,BindResponse>
org.apache.directory.api.ldap.codec.decorators.BindRequestDecorator
public class BindRequestDecorator
A decorator for the BindRequest message
| Field Summary |
|---|
| Fields inherited from class org.apache.directory.api.ldap.codec.api.MessageDecorator |
|---|
messageLength |
| Fields inherited from interface org.apache.directory.api.ldap.model.message.BindRequest |
|---|
RESP_TYPE, TYPE |
| Constructor Summary | |
|---|---|
BindRequestDecorator(LdapApiService codec,
BindRequest decoratedMessage)
Makes a BindRequest a MessageDecorator. |
|
| Method Summary | |
|---|---|
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. |
int |
getBindRequestLength()
|
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. |
int |
getSaslCredentialsLength()
|
String |
getSaslMechanism()
Gets the SASL mechanism String associated with this BindRequest if the bind operation is using SASL. |
int |
getSaslMechanismLength()
|
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. |
void |
setBindRequestLength(int bindRequestLength)
Stores the encoded length for the BindRequest |
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. |
void |
setSaslCredentialsLength(int saslCredentialsLength)
Stores the encoded length for the SaslCredentials |
BindRequest |
setSaslMechanism(String saslMechanism)
Sets the SASL mechanism String associated with this BindRequest if the bind operation is using SASL. |
void |
setSaslMechanismLength(int saslMechanismLength)
Stores the encoded length for the Mechanism |
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. |
| Methods inherited from class org.apache.directory.api.ldap.codec.decorators.SingleReplyRequestDecorator |
|---|
abandon, addAbandonListener, getResponseType, isAbandoned |
| Methods inherited from class org.apache.directory.api.ldap.codec.decorators.ResultResponseRequestDecorator |
|---|
getResultResponse, hasResponse |
| Methods inherited from class org.apache.directory.api.ldap.codec.api.MessageDecorator |
|---|
get, getCodecService, getControl, getControls, getControlsLength, getCurrentControl, getDecorated, getDecorator, getMessageId, getMessageLength, getType, hasControl, put, setControlsLength, setMessageLength, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.directory.api.ldap.model.message.SingleReplyRequest |
|---|
getResponseType |
| Methods inherited from interface org.apache.directory.api.ldap.model.message.ResultResponseRequest |
|---|
getResultResponse |
| Methods inherited from interface org.apache.directory.api.ldap.model.message.Request |
|---|
hasResponse |
| Methods inherited from interface org.apache.directory.api.ldap.model.message.Message |
|---|
get, getControl, getControls, getMessageId, getType, hasControl, put |
| Methods inherited from interface org.apache.directory.api.ldap.model.message.AbandonableRequest |
|---|
abandon, addAbandonListener, isAbandoned |
| Constructor Detail |
|---|
public BindRequestDecorator(LdapApiService codec,
BindRequest decoratedMessage)
decoratedMessage - the decorated BindRequests.| Method Detail |
|---|
public void setBindRequestLength(int bindRequestLength)
bindRequestLength - The encoded lengthpublic int getBindRequestLength()
public void setSaslCredentialsLength(int saslCredentialsLength)
saslCredentialsLength - The encoded lengthpublic int getSaslCredentialsLength()
public void setSaslMechanismLength(int saslMechanismLength)
saslMechanismLength - The encoded lengthpublic int getSaslMechanismLength()
public BindRequest setMessageId(int messageId)
setMessageId in interface BindRequestsetMessageId in interface MessagesetMessageId in class MessageDecorator<BindRequest>messageId - The message Id
public BindRequest addControl(Control control)
throws MessageException
addControl in interface BindRequestaddControl in interface MessageaddControl in class MessageDecorator<BindRequest>control - the control to add.
MessageException - if controls cannot be added to this Message or the control is
not known etc.
public BindRequest addAllControls(Control[] controls)
throws MessageException
addAllControls in interface BindRequestaddAllControls in interface MessageaddAllControls in class MessageDecorator<BindRequest>controls - the controls to add.
MessageException - if controls cannot be added to this Message or they are not known etc.
public BindRequest removeControl(Control control)
throws MessageException
removeControl in interface BindRequestremoveControl in interface MessageremoveControl in class MessageDecorator<BindRequest>control - the control to remove.
MessageException - if controls cannot be added to this Message or the control is
not known etc.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 simple
public BindRequest setCredentials(byte[] credentials)
setCredentials in interface BindRequestcredentials - the credentials if authentication is simple
public 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 mechanism
public 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 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 Decorator<BindRequest>buffer - The buffer where to put the PDU
EncoderException - if the buffer can't be encoded
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||