org.apache.directory.shared.ldap.message
Interface BindRequest

All Superinterfaces:
Message, Request, ResultResponseRequest, SingleReplyRequest
All Known Implementing Classes:
BindRequestImpl

public interface BindRequest
extends SingleReplyRequest

Bind protocol operation request which authenticates and begins a client session. Does not yet contain interfaces for SASL authentication mechanisms.

Version:
$Rev: 379008 $
Author:
Apache Directory Project

Field Summary
static MessageTypeEnum RESP_TYPE
          Bind response message type enumeration value
static MessageTypeEnum TYPE
          Bind request message type enumeration value
 
Method Summary
 byte[] getCredentials()
          Gets the simple credentials associated with a simple authentication attempt or null if this request uses SASL authentication mechanisms.
 java.lang.String getName()
          Gets the distinguished name of the subject in this authentication request.
 java.lang.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.
 void setCredentials(byte[] credentials)
          Sets the simple credentials associated with a simple authentication attempt ignored if this request uses SASL authentication mechanisms.
 void setName(java.lang.String name)
          Sets the distinguished name of the subject in this authentication request.
 void setSaslMechanism(java.lang.String saslMechanism)
          Sets the SASL mechanism String associated with this BindRequest if the bind operation is using SASL.
 void setSimple(boolean isSimple)
          Sets the authentication mechanism to simple or to SASL based authentication.
 void setVersion3(boolean isVersion3)
          Sets whether or not the LDAP v3 or v2 protocol is used.
 
Methods inherited from interface org.apache.directory.shared.ldap.message.SingleReplyRequest
getResponseType
 
Methods inherited from interface org.apache.directory.shared.ldap.message.ResultResponseRequest
getResultResponse
 
Methods inherited from interface org.apache.directory.shared.ldap.message.Request
hasResponse
 
Methods inherited from interface org.apache.directory.shared.ldap.message.Message
add, get, getControls, getMessageId, getType, put, remove
 

Field Detail

TYPE

public static final MessageTypeEnum TYPE
Bind request message type enumeration value


RESP_TYPE

public static final MessageTypeEnum RESP_TYPE
Bind response message type enumeration value

Method Detail

isSimple

public boolean isSimple()
Checks to see if the authentication mechanism is simple and not SASL based.

Returns:
true if the mechanism is simple false if it is SASL based.

getSimple

public boolean getSimple()
Checks to see if the authentication mechanism is simple and not SASL based.

Returns:
true if the mechanism is simple false if it is SASL based.

setSimple

public void setSimple(boolean isSimple)
Sets the authentication mechanism to simple or to SASL based authentication.

Parameters:
isSimple - true if authentication is simple, false otherwise.

getCredentials

public byte[] getCredentials()
Gets the simple credentials associated with a simple authentication attempt or null if this request uses SASL authentication mechanisms.

Returns:
null if the mechanism is SASL or the credentials if it is simple.

setCredentials

public void setCredentials(byte[] credentials)
Sets the simple credentials associated with a simple authentication attempt ignored if this request uses SASL authentication mechanisms.

Parameters:
credentials - the credentials if authentication is simple, null otherwise

getName

public java.lang.String getName()
Gets the distinguished name of the subject in this authentication request. This field may take on a null value (a zero length string) for the purposes of anonymous binds, when authentication has been performed at a lower layer, or when using SASL credentials with a mechanism that includes the LDAPDN in the credentials.

Returns:
the DN of the authenticating user.

setName

public void setName(java.lang.String name)
Sets the distinguished name of the subject in this authentication request. This field may take on a null value (or a zero length string) for the purposes of anonymous binds, when authentication has been performed at a lower layer, or when using SASL credentials with a mechanism that includes the LDAPDN in the credentials.

Parameters:
name - the DN of the authenticating user - leave null for annonymous user.

isVersion3

public boolean isVersion3()
Checks to see if the Ldap v3 protocol is used. Normally this would extract a version number from the bind request sent by the client indicating the version of the protocol to be used in this protocol session. The integer is either a 2 or a 3 at the moment. We thought it was better to just check if the protocol used is 3 or not rather than use an type-safe enumeration type for a binary value. If an LDAPv4 comes out then we shall convert the return type to a type safe enumeration.

Returns:
true if client using version 3 false if it is version 2.

getVersion3

public boolean getVersion3()
Gets whether or not the Ldap v3 protocol is used. Normally this would extract a version number from the bind request sent by the client indicating the version of the protocol to be used in this protocol session. The integer is either a 2 or a 3 at the moment. We thought it was better to just check if the protocol used is 3 or not rather than use an type-safe enumeration type for a binary value. If an LDAPv4 comes out then we shall convert the return type to a type safe enumeration.

Returns:
true if client using version 3 false if it is version 2.

setVersion3

public void setVersion3(boolean isVersion3)
Sets whether or not the LDAP v3 or v2 protocol is used. Normally this would extract a version number from the bind request sent by the client indicating the version of the protocol to be used in this protocol session. The integer is either a 2 or a 3 at the moment. We thought it was better to just check if the protocol used is 3 or not rather than use an type-safe enumeration type for a binary value. If an LDAPv4 comes out then we shall convert the return type to a type safe enumeration.

Parameters:
isVersion3 - if true the client will be exhibiting version 3 bind behavoir, if false is used version 2 behavoir will be exhibited.

getSaslMechanism

public java.lang.String getSaslMechanism()
Gets the SASL mechanism String associated with this BindRequest if the bind operation is using SASL.

Returns:
the SASL mechanism or null if the bind op is simple

setSaslMechanism

public void setSaslMechanism(java.lang.String saslMechanism)
Sets the SASL mechanism String associated with this BindRequest if the bind operation is using SASL.

Parameters:
saslMechanism - the SASL mechanism


Copyright © 2003-2006 . All Rights Reserved.