Interface BindRequest
-
- All Superinterfaces:
AbandonableRequest
,Message
,Request
,ResultResponseRequest
,SingleReplyRequest
- All Known Implementing Classes:
BindRequestDsml
,BindRequestImpl
public interface BindRequest extends SingleReplyRequest, AbandonableRequest
Bind protocol operation request which authenticates and begins a client session. Does not yet contain interfaces for SASL authentication mechanisms.- Author:
- Apache Directory Project
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BindRequest
addAllControls(Control[] controls)
Adds an array of controls to this Message.BindRequest
addControl(Control control)
Adds a control to this Message.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 name)
Sets the DN of the subject in this authentication request.BindRequest
setMessageId(int messageId)
Sets the Message ID for this requestBindRequest
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.-
Methods inherited from interface org.apache.directory.api.ldap.model.message.AbandonableRequest
abandon, addAbandonListener, isAbandoned
-
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.Request
hasResponse
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.ResultResponseRequest
getResultResponse
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.SingleReplyRequest
getResponseType
-
-
-
-
Method Detail
-
isSimple
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
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
BindRequest setSimple(boolean isSimple)
Sets the authentication mechanism to simple or to SASL based authentication.- Parameters:
isSimple
- true if authentication is simple, false otherwise.- Returns:
- The BindRequest instance
-
getCredentials
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
BindRequest setCredentials(String 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- Returns:
- The BindRequest instance
-
setCredentials
BindRequest 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- Returns:
- The BindRequest instance
-
getName
String getName()
Gets the 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 name in the credentials.- Returns:
- the name of the authenticating user.
-
setName
BindRequest setName(String name)
Sets the 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 name in the credentials.- Parameters:
name
- the name of the authenticating user - leave null for anonymous user.- Returns:
- The BindRequest instance
-
getDn
Dn getDn()
Gets the DN 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 DN in the credentials.- Returns:
- the DN of the authenticating user.
-
setDn
BindRequest setDn(Dn name)
Sets the DN 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 DN in the credentials.- Parameters:
name
- the DN of the authenticating user - leave null for anonymous user.- Returns:
- The BindRequest instance
-
isVersion3
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
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
BindRequest 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 behavior, If false is used version 2 behavior will be exhibited.- Returns:
- The BindRequest instance
-
getSaslMechanism
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 operation is simple
-
setSaslMechanism
BindRequest setSaslMechanism(String saslMechanism)
Sets the SASL mechanism String associated with this BindRequest if the bind operation is using SASL.- Parameters:
saslMechanism
- the SASL mechanism- Returns:
- The BindRequest instance
-
setMessageId
BindRequest setMessageId(int messageId)
Sets the Message ID for this request- Specified by:
setMessageId
in interfaceMessage
- Parameters:
messageId
- The message Id- Returns:
- A Message reference
-
addControl
BindRequest addControl(Control control)
Adds a control to this Message.- Specified by:
addControl
in interfaceMessage
- Parameters:
control
- the control to add.- Returns:
- A Message reference
-
addAllControls
BindRequest addAllControls(Control[] controls)
Adds an array of controls to this Message.- Specified by:
addAllControls
in interfaceMessage
- Parameters:
controls
- the controls to add.- Returns:
- A Message reference
-
removeControl
BindRequest removeControl(Control control)
Deletes a control removing it from this Message.- Specified by:
removeControl
in interfaceMessage
- Parameters:
control
- the control to remove.- Returns:
- A Message reference
-
-