@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class OAUTHBEARERBindRequest extends SASLBindRequest
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
OAUTHBEARER_MECHANISM_NAME
The name for the OAUTHBEARER SASL mechanism.
|
CRED_TYPE_SASL
VERSION_ELEMENT
Constructor and Description |
---|
OAUTHBEARERBindRequest(OAUTHBEARERBindRequestProperties properties,
Control... controls)
Creates a new OAUTHBEARER bind request with the provided set of properties.
|
OAUTHBEARERBindRequest(java.lang.String accessToken,
Control... controls)
Creates a new OAUTHBEARER bind request with the provided access token.
|
Modifier and Type | Method and Description |
---|---|
OAUTHBEARERBindRequest |
duplicate()
Creates a new instance of this LDAP request that may be modified without
impacting this request.
|
OAUTHBEARERBindRequest |
duplicate(Control[] controls)
Creates a new instance of this LDAP request that may be modified without
impacting this request.
|
java.lang.String |
getAccessToken()
Retrieves the access token to include in the bind request.
|
java.util.Map<java.lang.String,java.lang.String> |
getAdditionalKeyValuePairs()
Retrieves an unmodifiable map of additional key-value pairs that should be
included in the bind request.
|
java.lang.String |
getAuthorizationID()
Retrieves the authorization ID to include in the GS2 header for the bind
request, if any.
|
int |
getLastMessageID()
Retrieves the message ID for the last LDAP message sent using this request.
|
java.lang.String |
getRequestMethod()
Retrieves the method to use for HTTP-based requests, if any.
|
java.lang.String |
getRequestPath()
Retrieves the path to use for HTTP-based requests, if any.
|
java.lang.String |
getRequestPostData()
Retrieves the data to submit when posting an HTTP-based request, if any.
|
java.lang.String |
getRequestQueryString()
Retrieves the query string to use for HTTP-based requests, if any.
|
java.lang.String |
getSASLMechanismName()
Retrieves the name of the SASL mechanism used in this SASL bind request.
|
java.lang.String |
getServerAddress()
Retrieves the server address to include in the bind request, if any.
|
java.lang.Integer |
getServerPort()
Retrieves the server port to include in the bind request, if any.
|
protected OAUTHBEARERBindResult |
process(LDAPConnection connection,
int depth)
Sends this bind request to the target server over the provided connection
and returns the corresponding response.
|
void |
toCode(java.util.List<java.lang.String> lineList,
java.lang.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.
|
java.lang.String |
toString()
Retrieves a string representation of the OAUTHBEARER bind request.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of the OAUTHBEARER bind request to the
provided buffer.
|
getBindType, responseReceived, sendBindRequest, sendMessage
getOperationType, getRebindRequest
followReferrals, getControl, getControlList, getControls, getIntermediateResponseListener, getReferralConnector, getReferralConnectorInternal, getReferralDepth, getResponseTimeoutMillis, hasControl, hasControl, setFollowReferrals, setIntermediateResponseListener, setReferralConnector, setReferralDepth, setResponseTimeoutMillis
@NotNull public static final java.lang.String OAUTHBEARER_MECHANISM_NAME
public OAUTHBEARERBindRequest(@NotNull java.lang.String accessToken, @Nullable Control... controls)
accessToken
- The access token to use for this bind request. It
must not be null
or empty.controls
- The set of controls to include in the bind request.
It may be null
or empty if no controls are
needed.public OAUTHBEARERBindRequest(@NotNull OAUTHBEARERBindRequestProperties properties, @Nullable Control... controls)
properties
- The set of properties to use to create this bind
request. It must not be null
.controls
- The set of controls to include in the bind request. It
may be null
or empty if no controls are needed.@NotNull public java.lang.String getSASLMechanismName()
getSASLMechanismName
in class SASLBindRequest
@NotNull public java.lang.String getAccessToken()
@Nullable public java.lang.String getAuthorizationID()
null
if no authorization ID should be
included.@Nullable public java.lang.String getServerAddress()
null
if it should be omitted.@Nullable public java.lang.Integer getServerPort()
null
if it should be omitted.@Nullable public java.lang.String getRequestMethod()
null
if it
should be omitted from the bind request.@Nullable public java.lang.String getRequestPath()
null
if it
should be omitted from the bind request.@Nullable public java.lang.String getRequestPostData()
null
if it
should be omitted from the bind request.@Nullable public java.lang.String getRequestQueryString()
null
if it should be omitted from the bind request.@NotNull public java.util.Map<java.lang.String,java.lang.String> getAdditionalKeyValuePairs()
null
but may
be empty.@NotNull protected OAUTHBEARERBindResult process(@NotNull LDAPConnection connection, int depth) throws LDAPException
process
in class BindRequest
connection
- The connection to use to send this bind request to the
server and read the associated response.depth
- The current referral depth for this request. It should
always be one for the initial request, and should only
be incremented when following referrals.LDAPException
- If a problem occurs while sending the request or
reading the response.@NotNull public OAUTHBEARERBindRequest duplicate()
duplicate
in interface ReadOnlyLDAPRequest
duplicate
in class BindRequest
@NotNull public OAUTHBEARERBindRequest duplicate(@Nullable Control[] controls)
duplicate
in interface ReadOnlyLDAPRequest
duplicate
in class BindRequest
controls
- The set of controls to include in the duplicate request.public int getLastMessageID()
getLastMessageID
in class SASLBindRequest
@NotNull public java.lang.String toString()
toString
in interface ReadOnlyLDAPRequest
toString
in class LDAPRequest
public void toString(@NotNull java.lang.StringBuilder buffer)
toString
in interface ReadOnlyLDAPRequest
toString
in class LDAPRequest
buffer
- The buffer to which the information should be appended. It
must not be null
.public void toCode(@NotNull java.util.List<java.lang.String> lineList, @NotNull java.lang.String requestID, int indentSpaces, boolean includeProcessing)
toCode
in interface ReadOnlyLDAPRequest
toCode
in class SASLBindRequest
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 is null
or
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 (if true
),
or just to generate the request (if
false
).