com.unboundid.ldap.protocol
Class BindRequestProtocolOp

java.lang.Object
  extended by com.unboundid.ldap.protocol.BindRequestProtocolOp
All Implemented Interfaces:
ProtocolOp, java.io.Serializable

@InternalUseOnly
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class BindRequestProtocolOp
extends java.lang.Object
implements ProtocolOp

This class provides an implementation of an LDAP bind request protocol op.

See Also:
Serialized Form

Field Summary
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 Summary
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.
 
Method Summary
 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.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CRED_TYPE_SIMPLE

public static final byte CRED_TYPE_SIMPLE
The credentials type for simple bind requests.

See Also:
Constant Field Values

CRED_TYPE_SASL

public static final byte CRED_TYPE_SASL
The credentials type for SASL bind requests.

See Also:
Constant Field Values
Constructor Detail

BindRequestProtocolOp

public BindRequestProtocolOp(java.lang.String bindDN,
                             java.lang.String password)
Creates a new bind request protocol op for a simple bind.

Parameters:
bindDN - The DN for this bind request.
password - The password for this bind request.

BindRequestProtocolOp

public BindRequestProtocolOp(java.lang.String bindDN,
                             byte[] password)
Creates a new bind request protocol op for a simple bind.

Parameters:
bindDN - The DN for this bind request.
password - The password for this bind request.

BindRequestProtocolOp

public BindRequestProtocolOp(java.lang.String bindDN,
                             java.lang.String saslMechanism,
                             ASN1OctetString saslCredentials)
Creates a new bind request protocol op for a SASL bind.

Parameters:
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.
Method Detail

getVersion

public int getVersion()
Retrieves the protocol version for this bind request.

Returns:
The protocol version for this bind request.

getBindDN

public java.lang.String getBindDN()
Retrieves the bind DN for this bind request.

Returns:
The bind DN for this bind request, or an empty string if none was provided.

getCredentialsType

public byte getCredentialsType()
Retrieves the credentials type for this bind request. It will either be CRED_TYPE_SIMPLE or CRED_TYPE_SASL.

Returns:
The credentials type for this bind request.

getSimplePassword

public ASN1OctetString getSimplePassword()
Retrieves the password to use for simple authentication.

Returns:
The password to use for simple authentication, or null if SASL authentication will be used.

getSASLMechanism

public java.lang.String getSASLMechanism()
Retrieves the name of the SASL mechanism for this bind request.

Returns:
The name of the SASL mechanism for this bind request, or null if simple authentication will be used.

getSASLCredentials

public ASN1OctetString getSASLCredentials()
Retrieves the credentials to use for SASL authentication, if any.

Returns:
The credentials to use for SASL authentication, or null if there are no SASL credentials or if simple authentication will be used.

getProtocolOpType

public byte getProtocolOpType()
Retrieves the BER type for this protocol op.

Specified by:
getProtocolOpType in interface ProtocolOp
Returns:
The BER type for this protocol op.

writeTo

public void writeTo(ASN1Buffer buffer)
Writes an ASN.1-encoded representation of this LDAP protocol op to the provided ASN.1 buffer. This method is intended for internal use only and should not be used by third-party code.

Specified by:
writeTo in interface ProtocolOp
Parameters:
buffer - The ASN.1 buffer to which the encoded representation should be written.

toString

public java.lang.String toString()
Retrieves a string representation of this protocol op.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this protocol op.

toString

public void toString(java.lang.StringBuilder buffer)
Appends a string representation of this LDAP protocol op to the provided buffer.

Specified by:
toString in interface ProtocolOp
Parameters:
buffer - The buffer to which the string representation should be appended.