@InternalUseOnly @NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class BindRequestProtocolOp extends java.lang.Object implements ProtocolOp
Modifier and Type | Field and Description |
---|---|
static byte |
CRED_TYPE_SASL
The credentials type for SASL bind requests.
|
static byte |
CRED_TYPE_SIMPLE
The credentials type for simple bind requests.
|
Constructor and Description |
---|
BindRequestProtocolOp(GenericSASLBindRequest request)
Creates a new bind request protocol op from the provided bind request
object.
|
BindRequestProtocolOp(SimpleBindRequest request)
Creates a new bind request protocol op from the provided bind request
object.
|
BindRequestProtocolOp(java.lang.String bindDN,
byte[] password)
Creates a new bind request protocol op for a simple bind.
|
BindRequestProtocolOp(java.lang.String bindDN,
java.lang.String password)
Creates a new bind request protocol op for a simple bind.
|
BindRequestProtocolOp(java.lang.String bindDN,
java.lang.String saslMechanism,
ASN1OctetString saslCredentials)
Creates a new bind request protocol op for a SASL bind.
|
Modifier and Type | Method and Description |
---|---|
static BindRequestProtocolOp |
decodeProtocolOp(ASN1Element element)
Decodes the provided ASN.1 element as a bind request protocol op.
|
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 bind request.
|
byte |
getCredentialsType()
Retrieves the credentials type for this bind request.
|
byte |
getProtocolOpType()
Retrieves the BER type for this protocol op.
|
ASN1OctetString |
getSASLCredentials()
Retrieves the credentials to use for SASL authentication, if any.
|
java.lang.String |
getSASLMechanism()
Retrieves the name of the SASL mechanism for this bind request.
|
ASN1OctetString |
getSimplePassword()
Retrieves the password to use for simple authentication.
|
int |
getVersion()
Retrieves the protocol version for this bind request.
|
BindRequest |
toBindRequest(Control... controls)
Creates a new bind request object from this bind request protocol op.
|
java.lang.String |
toString()
Retrieves a string representation of this protocol op.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this LDAP protocol op 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.
|
public static final byte CRED_TYPE_SIMPLE
public static final byte CRED_TYPE_SASL
public BindRequestProtocolOp(@Nullable java.lang.String bindDN, @Nullable java.lang.String password)
bindDN
- The DN for this bind request.password
- The password for this bind request.public BindRequestProtocolOp(@Nullable java.lang.String bindDN, @Nullable byte[] password)
bindDN
- The DN for this bind request.password
- The password for this bind request.public BindRequestProtocolOp(@Nullable java.lang.String bindDN, @NotNull java.lang.String saslMechanism, @Nullable ASN1OctetString saslCredentials)
bindDN
- The DN for this bind request.saslMechanism
- The name of the SASL mechanism for this bind
request. It must not be null
.saslCredentials
- The SASL credentials for this bind request, if
any.public BindRequestProtocolOp(@NotNull SimpleBindRequest request) throws LDAPSDKUsageException
request
- The simple bind request to use to create this protocol op.
It must have been created with a static password rather
than using a password provider.LDAPSDKUsageException
- If the provided simple bind request is
configured to use a password provider
rather than a static password.public BindRequestProtocolOp(@NotNull GenericSASLBindRequest request)
request
- The generic SASL bind request to use to create this
protocol op.public int getVersion()
@NotNull public java.lang.String getBindDN()
public byte getCredentialsType()
CRED_TYPE_SIMPLE
or CRED_TYPE_SASL
.@Nullable public ASN1OctetString getSimplePassword()
null
if
SASL authentication will be used.@Nullable public java.lang.String getSASLMechanism()
null
if simple authentication will be used.@Nullable public ASN1OctetString getSASLCredentials()
null
if
there are no SASL credentials or if simple authentication will be
used.public byte getProtocolOpType()
getProtocolOpType
in interface ProtocolOp
@NotNull public ASN1Element encodeProtocolOp()
encodeProtocolOp
in interface ProtocolOp
@NotNull public static BindRequestProtocolOp decodeProtocolOp(@NotNull ASN1Element element) throws LDAPException
element
- The ASN.1 element to be decoded.LDAPException
- If the provided ASN.1 element cannot be decoded as
a bind request protocol op.public void writeTo(@NotNull ASN1Buffer buffer)
writeTo
in interface ProtocolOp
buffer
- The ASN.1 buffer to which the encoded representation should
be written.@NotNull public BindRequest toBindRequest(@Nullable Control... controls)
controls
- The set of controls to include in the bind request. It
may be empty or null
if no controls should be
included.@NotNull public java.lang.String toString()
toString
in class java.lang.Object
public void toString(@NotNull java.lang.StringBuilder buffer)
toString
in interface ProtocolOp
buffer
- The buffer to which the string representation should be
appended.