@NotMutable @ThreadSafety(level=NOT_THREADSAFE) public final class ANONYMOUSBindRequest extends SASLBindRequest
ANONYMOUSBindRequest bindRequest =
new ANONYMOUSBindRequest("Demo Application");
BindResult bindResult;
try
{
bindResult = connection.bind(bindRequest);
// If we get here, then the bind was successful.
}
catch (LDAPException le)
{
// The bind failed for some reason.
bindResult = new BindResult(le.toLDAPResult());
ResultCode resultCode = le.getResultCode();
String errorMessageFromServer = le.getDiagnosticMessage();
}
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ANONYMOUS_MECHANISM_NAME
The name for the ANONYMOUS SASL mechanism.
|
CRED_TYPE_SASLVERSION_ELEMENT| Constructor and Description |
|---|
ANONYMOUSBindRequest()
Creates a new SASL ANONYMOUS bind request with no trace string and no
controls.
|
ANONYMOUSBindRequest(Control... controls)
Creates a new SASL ANONYMOUS bind request with the provided set of controls
and no trace string.
|
ANONYMOUSBindRequest(java.lang.String traceString)
Creates a new SASL ANONYMOUS bind request with the provided trace string
and no controls.
|
ANONYMOUSBindRequest(java.lang.String traceString,
Control... controls)
Creates a new SASL ANONYMOUS bind request with the provided trace string
and controls.
|
| Modifier and Type | Method and Description |
|---|---|
ANONYMOUSBindRequest |
duplicate()
Creates a new instance of this LDAP request that may be modified without
impacting this request.
|
ANONYMOUSBindRequest |
duplicate(Control[] controls)
Creates a new instance of this LDAP request that may be modified without
impacting this request.
|
ANONYMOUSBindRequest |
getRebindRequest(java.lang.String host,
int port)
Retrieves a bind request that may be used to re-bind using the same
credentials authentication type and credentials as previously used to
perform the initial bind.
|
java.lang.String |
getSASLMechanismName()
Retrieves the name of the SASL mechanism used in this SASL bind request.
|
java.lang.String |
getTraceString()
Retrieves the trace string that will be included with the bind request.
|
protected BindResult |
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.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this request to the provided buffer.
|
getBindType, getLastMessageID, responseReceived, sendBindRequest, sendMessagegetOperationTypefollowReferrals, getControl, getControlList, getControls, getIntermediateResponseListener, getReferralConnector, getReferralConnectorInternal, getReferralDepth, getResponseTimeoutMillis, hasControl, hasControl, setFollowReferrals, setIntermediateResponseListener, setReferralConnector, setReferralDepth, setResponseTimeoutMillis, toString@NotNull public static final java.lang.String ANONYMOUS_MECHANISM_NAME
public ANONYMOUSBindRequest()
public ANONYMOUSBindRequest(@Nullable java.lang.String traceString)
traceString - The trace string to include in the bind request, or
null if no trace string is to be provided.public ANONYMOUSBindRequest(@Nullable Control... controls)
controls - The set of controls to include in the request.public ANONYMOUSBindRequest(@Nullable java.lang.String traceString, @Nullable Control... controls)
traceString - The trace string to include in the bind request, or
null if no trace string is to be provided.controls - The set of controls to include in the request.@NotNull public java.lang.String getSASLMechanismName()
getSASLMechanismName in class SASLBindRequest@Nullable public java.lang.String getTraceString()
null if there is to be no trace string.@NotNull protected BindResult process(@NotNull LDAPConnection connection, int depth) throws LDAPException
process in class BindRequestconnection - 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 ANONYMOUSBindRequest getRebindRequest(@NotNull java.lang.String host, int port)
getRebindRequest in class BindRequesthost - The address of the directory server to which the connection
is established.port - The port of the directory server to which the connection is
established.null to indicate that automatic
re-binding is not supported for this type of bind request.@NotNull public ANONYMOUSBindRequest duplicate()
duplicate in interface ReadOnlyLDAPRequestduplicate in class BindRequest@NotNull public ANONYMOUSBindRequest duplicate(@Nullable Control[] controls)
duplicate in interface ReadOnlyLDAPRequestduplicate in class BindRequestcontrols - The set of controls to include in the duplicate request.public void toString(@NotNull java.lang.StringBuilder buffer)
toString in interface ReadOnlyLDAPRequesttoString in class LDAPRequestbuffer - The buffer to which to append a string representation of
this request.public void toCode(@NotNull java.util.List<java.lang.String> lineList, @NotNull java.lang.String requestID, int indentSpaces, boolean includeProcessing)
toCode in interface ReadOnlyLDAPRequesttoCode in class SASLBindRequestlineList - 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).