Package com.unboundid.ldap.sdk
Class SASLBindRequest
java.lang.Object
com.unboundid.ldap.sdk.LDAPRequest
com.unboundid.ldap.sdk.BindRequest
com.unboundid.ldap.sdk.SASLBindRequest
- All Implemented Interfaces:
ReadOnlyLDAPRequest,Serializable
- Direct Known Subclasses:
ANONYMOUSBindRequest,CRAMMD5BindRequest,DIGESTMD5BindRequest,EXTERNALBindRequest,GenericSASLBindRequest,GSSAPIBindRequest,OAUTHBEARERBindRequest,PLAINBindRequest,SCRAMBindRequest,UnboundIDCertificatePlusPasswordBindRequest,UnboundIDDeliveredOTPBindRequest,UnboundIDExternallyProcessedAuthenticationBindRequest,UnboundIDTOTPBindRequest,UnboundIDYubiKeyOTPBindRequest
@Extensible
@ThreadSafety(level=INTERFACE_NOT_THREADSAFE)
public abstract class SASLBindRequest
extends BindRequest
This class provides an API that should be used to represent an LDAPv3 SASL
bind request. A SASL bind includes a SASL mechanism name and an optional set
of credentials.
See RFC 4422 for more information about the Simple Authentication and Security Layer.
See RFC 4422 for more information about the Simple Authentication and Security Layer.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final byteThe BER type to use for the credentials element in a simple bind request protocol op.Fields inherited from class com.unboundid.ldap.sdk.BindRequest
VERSION_ELEMENT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSASLBindRequest(Control[] controls) Creates a new SASL bind request with the provided controls. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves a human-readable string that describes the type of bind request.intRetrieves the message ID for the last LDAP message sent using this request.abstract StringRetrieves the name of the SASL mechanism used in this SASL bind request.final voidresponseReceived(LDAPResponse response) protected final BindResultsendBindRequest(LDAPConnection connection, String bindDN, ASN1OctetString saslCredentials, Control[] controls, long timeoutMillis) Sends an LDAP message to the directory server and waits for the response.protected final BindResultsendMessage(LDAPConnection connection, LDAPMessage requestMessage, long timeoutMillis) Sends an LDAP message to the directory server and waits for the response.voidAppends a number of lines comprising the Java source code that can be used to recreate this request to the given list.Methods inherited from class com.unboundid.ldap.sdk.BindRequest
duplicate, duplicate, getOperationType, getRebindRequest, processMethods inherited from class com.unboundid.ldap.sdk.LDAPRequest
followReferrals, getControl, getControlList, getControls, getIntermediateResponseListener, getReferralConnector, getReferralConnectorInternal, getReferralDepth, getResponseTimeoutMillis, hasControl, hasControl, setFollowReferrals, setIntermediateResponseListener, setReferralConnector, setReferralDepth, setResponseTimeoutMillis, toString, toString
-
Field Details
-
CRED_TYPE_SASL
The BER type to use for the credentials element in a simple bind request protocol op.- See Also:
-
-
Constructor Details
-
SASLBindRequest
Creates a new SASL bind request with the provided controls.- Parameters:
controls- The set of controls to include in this SASL bind request.
-
-
Method Details
-
getBindType
Retrieves a human-readable string that describes the type of bind request.- Specified by:
getBindTypein classBindRequest- Returns:
- A human-readable string that describes the type of bind request.
-
getSASLMechanismName
Retrieves the name of the SASL mechanism used in this SASL bind request.- Returns:
- The name of the SASL mechanism used in this SASL bind request.
-
getLastMessageID
Retrieves the message ID for the last LDAP message sent using this request.- Specified by:
getLastMessageIDin classLDAPRequest- Returns:
- The message ID for the last LDAP message sent using this request, or -1 if it no LDAP messages have yet been sent using this request.
-
sendBindRequest
@NotNull protected final BindResult sendBindRequest(@NotNull LDAPConnection connection, @Nullable String bindDN, @Nullable ASN1OctetString saslCredentials, @Nullable Control[] controls, long timeoutMillis) throws LDAPException Sends an LDAP message to the directory server and waits for the response.- Parameters:
connection- The connection to the directory server.bindDN- The bind DN to use for the request. It should benullfor most types of SASL bind requests.saslCredentials- The SASL credentials to use for the bind request. It may benullif no credentials are required.controls- The set of controls to include in the request. It may benullif no controls are required.timeoutMillis- The maximum length of time in milliseconds to wait for a response, or zero if it should wait forever.- Returns:
- The bind response message returned by the directory server.
- Throws:
LDAPException- If a problem occurs while sending the request or reading the response, or if a timeout occurred while waiting for the response.
-
sendMessage
@NotNull protected final BindResult sendMessage(@NotNull LDAPConnection connection, @NotNull LDAPMessage requestMessage, long timeoutMillis) throws LDAPException Sends an LDAP message to the directory server and waits for the response.- Parameters:
connection- The connection to the directory server.requestMessage- The LDAP message to send to the directory server.timeoutMillis- The maximum length of time in milliseconds to wait for a response, or zero if it should wait forever.- Returns:
- The response message received from the server.
- Throws:
LDAPException- If a problem occurs while sending the request or reading the response, or if a timeout occurred while waiting for the response.
-
responseReceived
@InternalUseOnly public final void responseReceived(@NotNull LDAPResponse response) throws LDAPException - Throws:
LDAPException
-
toCode
public void toCode(@NotNull List<String> lineList, @NotNull String requestID, int indentSpaces, boolean includeProcessing) Appends a number of lines comprising the Java source code that can be used to recreate this request to the given list.- Specified by:
toCodein interfaceReadOnlyLDAPRequest- Parameters:
lineList- The list to which the source code lines should be added.requestID- The name that should be used as an identifier for the request. If this isnullor empty, then a generic ID will be used.indentSpaces- The number of spaces that should be used to indent the generated code. It must not be negative.includeProcessing- Indicates whether the generated code should include code required to actually process the request and handle the result (iftrue), or just to generate the request (iffalse).
-