org.apache.directory.shared.ldap.codec.bind
Class BindRequest

java.lang.Object
  extended byorg.apache.directory.shared.asn1.Asn1Object
      extended byorg.apache.directory.shared.ldap.codec.LdapMessage
          extended byorg.apache.directory.shared.ldap.codec.bind.BindRequest

public class BindRequest
extends LdapMessage

A BindRequest ldapObject. It's a sub-class of Asn1Object, and it extends the Asn1Object class to be seen as a member of the LdapMessage CHOICE.

Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.asn1.Asn1Object
parent
 
Constructor Summary
BindRequest()
          Creates a new BindRequest object.
 
Method Summary
 int computeLength()
          Compute the BindRequest length BindRequest : 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)
 java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
          Encode the BindRequest message to a PDU.
 LdapAuthentication getAuthentication()
          Get the user authentication
 int getMessageType()
          Get the message type
 java.lang.String 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(javax.naming.Name name)
          Set the user name
 void setVersion(int version)
          Set the protocol version
 java.lang.String toString()
          Get a String representation of a BindRequest
 
Methods inherited from class org.apache.directory.shared.ldap.codec.LdapMessage
addControl, getAbandonRequest, getAddRequest, getAddResponse, getBindRequest, getBindResponse, getCompareRequest, getCompareResponse, getControls, getControls, getCurrentControl, getDelRequest, getDelResponse, getExtendedRequest, getExtendedResponse, getLdapResponse, getMessageId, getMessageTypeName, getModifyDNRequest, getModifyDNResponse, getModifyRequest, getModifyResponse, getSearchRequest, getSearchResultDone, getSearchResultEntry, getSearchResultReference, getUnBindRequest, initControl, setMessageId, setProtocolOP
 
Methods inherited from class org.apache.directory.shared.asn1.Asn1Object
addLength, getCurrentLength, getExpectedLength, getParent, setCurrentLength, setExpectedLength, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BindRequest

public BindRequest()
Creates a new BindRequest object.

Method Detail

getMessageType

public int getMessageType()
Get the message type

Overrides:
getMessageType in class LdapMessage
Returns:
Returns the type.

getAuthentication

public LdapAuthentication getAuthentication()
Get the user authentication

Returns:
The user authentication

getSimpleAuthentication

public SimpleAuthentication getSimpleAuthentication()
Get the user simple authentication

Returns:
The simple user authentication

getSaslAuthentication

public SaslCredentials getSaslAuthentication()
Get the user sasl authentication

Returns:
The sasl user authentication

setAuthentication

public void setAuthentication(LdapAuthentication authentication)
Set the user authentication

Parameters:
authentication - The user authentication

getName

public java.lang.String getName()
Get the user name

Returns:
The user name

setName

public void setName(javax.naming.Name name)
Set the user name

Parameters:
name - The user name

getVersion

public int getVersion()
Get the protocol version

Returns:
The protocol version

isLdapV3

public boolean isLdapV3()
Check if the Ldap version in use is 3

Returns:
true if the ldap version is 3

setVersion

public void setVersion(int version)
Set the protocol version

Parameters:
version - The protocol version

computeLength

public int computeLength()
Compute the BindRequest length BindRequest : 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)

Overrides:
computeLength in class LdapMessage

encode

public java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
                           throws org.apache.directory.shared.asn1.codec.EncoderException
Encode the BindRequest message to a PDU. BindRequest : 0x60 LL 0x02 LL version 0x04 LL name authentication.encode() 0x80 LL simple / \ 0x83 LL mechanism [0x04 LL credential]

Overrides:
encode in class LdapMessage
Parameters:
buffer - The buffer where to put the PDU
Returns:
The PDU.
Throws:
org.apache.directory.shared.asn1.codec.EncoderException - If anything goes wrong.

toString

public java.lang.String toString()
Get a String representation of a BindRequest

Overrides:
toString in class LdapMessage
Returns:
A BindRequest String


Copyright © 2003-2006 . All Rights Reserved.