@NotMutable @ThreadSafety(level=NOT_THREADSAFE) public final class SimpleBindRequest extends BindRequest implements ProtocolOp
VERSION_ELEMENT| Constructor and Description |
|---|
SimpleBindRequest()
Creates a new simple bind request that may be used to perform an anonymous
bind to the directory server (i.e., with a zero-length bind DN and a
zero-length password).
|
SimpleBindRequest(DN bindDN,
byte[] password)
Creates a new simple bind request with the provided bind DN and password.
|
SimpleBindRequest(DN bindDN,
byte[] password,
Control... controls)
Creates a new simple bind request with the provided bind DN and password.
|
SimpleBindRequest(DN bindDN,
PasswordProvider passwordProvider,
Control... controls)
Creates a new simple bind request with the provided bind DN and that will
use a password provider in order to obtain the bind password.
|
SimpleBindRequest(DN bindDN,
java.lang.String password)
Creates a new simple bind request with the provided bind DN and password.
|
SimpleBindRequest(DN bindDN,
java.lang.String password,
Control... controls)
Creates a new simple bind request with the provided bind DN and password.
|
SimpleBindRequest(java.lang.String bindDN,
byte[] password)
Creates a new simple bind request with the provided bind DN and password.
|
SimpleBindRequest(java.lang.String bindDN,
byte[] password,
Control... controls)
Creates a new simple bind request with the provided bind DN and password.
|
SimpleBindRequest(java.lang.String bindDN,
PasswordProvider passwordProvider,
Control... controls)
Creates a new simple bind request with the provided bind DN and that will
use a password provider in order to obtain the bind password.
|
SimpleBindRequest(java.lang.String bindDN,
java.lang.String password)
Creates a new simple bind request with the provided bind DN and password.
|
SimpleBindRequest(java.lang.String bindDN,
java.lang.String password,
Control... controls)
Creates a new simple bind request with the provided bind DN and password.
|
| Modifier and Type | Method and Description |
|---|---|
SimpleBindRequest |
duplicate()
Creates a new instance of this LDAP request that may be modified without
impacting this request.
|
SimpleBindRequest |
duplicate(Control[] controls)
Creates a new instance of this LDAP request that may be modified without
impacting this request.
|
ASN1Element |
encodeProtocolOp()
Encodes this protocol op to an ASN.1 element suitable for inclusion in an
encoded LDAP message.
|
java.lang.String |
getBindDN()
Retrieves the bind DN for this simple bind request.
|
java.lang.String |
getBindType()
Retrieves a human-readable string that describes the type of bind request.
|
int |
getLastMessageID()
Retrieves the message ID for the last LDAP message sent using this request.
|
ASN1OctetString |
getPassword()
Retrieves the password for this simple bind request, if no password
provider has been configured.
|
PasswordProvider |
getPasswordProvider()
Retrieves the password provider for this simple bind request, if defined.
|
byte |
getProtocolOpType()
Retrieves the BER type for this protocol op.
|
SimpleBindRequest |
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.
|
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 |
responseReceived(LDAPResponse response)
Indicates that the provided LDAP response has been received by from the
server.
|
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.
|
void |
writeTo(ASN1Buffer buffer)
Writes an ASN.1-encoded representation of this LDAP protocol op to the
provided ASN.1 buffer.
|
getOperationTypefollowReferrals, getControl, getControlList, getControls, getIntermediateResponseListener, getReferralConnector, getReferralConnectorInternal, getReferralDepth, getResponseTimeoutMillis, hasControl, hasControl, setFollowReferrals, setIntermediateResponseListener, setReferralConnector, setReferralDepth, setResponseTimeoutMillis, toStringpublic SimpleBindRequest()
public SimpleBindRequest(@Nullable java.lang.String bindDN, @Nullable java.lang.String password)
bindDN - The bind DN for this simple bind request.password - The password for this simple bind request.public SimpleBindRequest(@Nullable java.lang.String bindDN, @Nullable byte[] password)
bindDN - The bind DN for this simple bind request.password - The password for this simple bind request.public SimpleBindRequest(@Nullable DN bindDN, @Nullable java.lang.String password)
bindDN - The bind DN for this simple bind request.password - The password for this simple bind request.public SimpleBindRequest(@Nullable DN bindDN, @Nullable byte[] password)
bindDN - The bind DN for this simple bind request.password - The password for this simple bind request.public SimpleBindRequest(@Nullable java.lang.String bindDN, @Nullable java.lang.String password, @Nullable Control... controls)
bindDN - The bind DN for this simple bind request.password - The password for this simple bind request.controls - The set of controls for this simple bind request.public SimpleBindRequest(@Nullable java.lang.String bindDN, @Nullable byte[] password, @Nullable Control... controls)
bindDN - The bind DN for this simple bind request.password - The password for this simple bind request.controls - The set of controls for this simple bind request.public SimpleBindRequest(@Nullable DN bindDN, @Nullable java.lang.String password, @Nullable Control... controls)
bindDN - The bind DN for this simple bind request.password - The password for this simple bind request.controls - The set of controls for this simple bind request.public SimpleBindRequest(@Nullable DN bindDN, @Nullable byte[] password, @Nullable Control... controls)
bindDN - The bind DN for this simple bind request.password - The password for this simple bind request.controls - The set of controls for this simple bind request.public SimpleBindRequest(@NotNull java.lang.String bindDN, @NotNull PasswordProvider passwordProvider, @Nullable Control... controls)
bindDN - The bind DN for this simple bind request. It
must not be null.passwordProvider - The password provider that will be used to obtain
the password for this simple bind request. It
must not be null.controls - The set of controls for this simple bind request.public SimpleBindRequest(@NotNull DN bindDN, @NotNull PasswordProvider passwordProvider, @Nullable Control... controls)
bindDN - The bind DN for this simple bind request. It
must not be null.passwordProvider - The password provider that will be used to obtain
the password for this simple bind request. It
must not be null.controls - The set of controls for this simple bind request.@NotNull public java.lang.String getBindDN()
@Nullable public ASN1OctetString getPassword()
null if a
password provider will be used to obtain the password.@Nullable public PasswordProvider getPasswordProvider()
null if this bind request was created with an explicit
password rather than a password provider.public byte getProtocolOpType()
getProtocolOpType in interface ProtocolOppublic void writeTo(@NotNull ASN1Buffer buffer)
writeTo in interface ProtocolOpbuffer - The ASN.1 buffer to which the encoded representation should
be written.@NotNull public ASN1Element encodeProtocolOp() throws LDAPSDKUsageException
encodeProtocolOp in interface ProtocolOpLDAPSDKUsageException - If this bind request was created with a
password provider rather than a static
password.@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 SimpleBindRequest 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.@InternalUseOnly public void responseReceived(@NotNull LDAPResponse response) throws LDAPException
response - The LDAP response that has been received from the server.
It may be null if the connection has been closed
without having received any response.LDAPException - If a problem occurs while handling the response.@NotNull public java.lang.String getBindType()
getBindType in class BindRequestpublic int getLastMessageID()
getLastMessageID in class LDAPRequest@NotNull public SimpleBindRequest duplicate()
duplicate in interface ReadOnlyLDAPRequestduplicate in class BindRequest@NotNull public SimpleBindRequest 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 ProtocolOptoString 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 ReadOnlyLDAPRequestlineList - 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).