org.opends.server.protocols.ldap
Class BindRequestProtocolOp

java.lang.Object
  extended by org.opends.server.protocols.ldap.ProtocolOp
      extended by org.opends.server.protocols.ldap.BindRequestProtocolOp

public class BindRequestProtocolOp
extends ProtocolOp

This class defines the structures and methods for an LDAP bind request protocol op, which is used to authenticate a user to the Directory Server.


Constructor Summary
BindRequestProtocolOp(ASN1OctetString dn, int protocolVersion, ASN1OctetString simplePassword)
          Creates a new bind request protocol op to perform simple authentication with the provided DN and password.
BindRequestProtocolOp(ASN1OctetString dn, java.lang.String saslMechanism, ASN1OctetString saslCredentials)
          Creates a new bind request protocol op to perform SASL authentication with the provided information.
 
Method Summary
static BindRequestProtocolOp decodeBindRequest(ASN1Element element)
          Decodes the provided ASN.1 element as an LDAP bind request protocol op.
 ASN1Element encode()
          Encodes this protocol op to an ASN.1 element suitable for including in an LDAP message.
 AuthenticationType getAuthenticationType()
          Retrieves the authentication type for this bind request.
 ASN1OctetString getDN()
          Retrieves the DN for this bind request.
 java.lang.String getProtocolOpName()
          Retrieves the name for this protocol op type.
 int getProtocolVersion()
          Retrieves the protocol version for this bind request.
 ASN1OctetString getSASLCredentials()
          Retrieves the SASL credentials for this bind request.
 java.lang.String getSASLMechanism()
          Retrieves the SASL mechanism for this bind request.
 ASN1OctetString getSimplePassword()
          Retrieves the simple authentication password for this bind request.
 byte getType()
          Retrieves the BER type for this protocol op.
 void setDN(ASN1OctetString dn)
          Specifies the DN for this bind request.
 void setProtocolVersion(int protocolVersion)
          Specifies the protocol version for this bind request.
 void setSASLAuthenticationInfo(java.lang.String saslMechanism, ASN1OctetString saslCredentials)
          Indicates that this bind request should use SASL authentication with the provided information.
 void setSimplePassword(ASN1OctetString simplePassword)
          Indicates that this bind request should use simple authentication with the provided password.
 void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this LDAP protocol op to the provided buffer.
 void toString(java.lang.StringBuilder buffer, int indent)
          Appends a multi-line string representation of this LDAP protocol op to the provided buffer.
 
Methods inherited from class org.opends.server.protocols.ldap.ProtocolOp
decode, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BindRequestProtocolOp

public BindRequestProtocolOp(ASN1OctetString dn,
                             int protocolVersion,
                             ASN1OctetString simplePassword)
Creates a new bind request protocol op to perform simple authentication with the provided DN and password.

Parameters:
dn - The DN for this bind request.
protocolVersion - The LDAP protocol version for this bind request.
simplePassword - The password for this bind request.

BindRequestProtocolOp

public BindRequestProtocolOp(ASN1OctetString dn,
                             java.lang.String saslMechanism,
                             ASN1OctetString saslCredentials)
Creates a new bind request protocol op to perform SASL authentication with the provided information.

Parameters:
dn - The DN for this bind request.
saslMechanism - The SASL mechanism for this bind request.
saslCredentials - The SASL credentials for this bind request.
Method Detail

getDN

public ASN1OctetString getDN()
Retrieves the DN for this bind request.

Returns:
The DN for this bind request.

setDN

public void setDN(ASN1OctetString dn)
Specifies the DN for this bind request.

Parameters:
dn - The DN for this bind request.

getProtocolVersion

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

Returns:
The protocol version for this bind request.

setProtocolVersion

public void setProtocolVersion(int protocolVersion)
Specifies the protocol version for this bind request.

Parameters:
protocolVersion - The protocol version for this bind request.

getAuthenticationType

public AuthenticationType getAuthenticationType()
Retrieves the authentication type for this bind request.

Returns:
The authentication type for this bind request.

getSimplePassword

public ASN1OctetString getSimplePassword()
Retrieves the simple authentication password for this bind request.

Returns:
The simple authentication password for this bind request, or null if this is a SASL bind request.

setSimplePassword

public void setSimplePassword(ASN1OctetString simplePassword)
Indicates that this bind request should use simple authentication with the provided password.

Parameters:
simplePassword - The simple authentication password for this bind request.

getSASLMechanism

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

Returns:
The SASL mechanism for this bind request, or null if this is a simple bind request.

getSASLCredentials

public ASN1OctetString getSASLCredentials()
Retrieves the SASL credentials for this bind request.

Returns:
The SASL credentials for this bind request, or null if there are none or if this is a simple bind request.

setSASLAuthenticationInfo

public void setSASLAuthenticationInfo(java.lang.String saslMechanism,
                                      ASN1OctetString saslCredentials)
Indicates that this bind request should use SASL authentication with the provided information.

Parameters:
saslMechanism - The SASL mechanism for this bind request.
saslCredentials - The SASL credentials for this bind request.

getType

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

Specified by:
getType in class ProtocolOp
Returns:
The BER type for this protocol op.

getProtocolOpName

public java.lang.String getProtocolOpName()
Retrieves the name for this protocol op type.

Specified by:
getProtocolOpName in class ProtocolOp
Returns:
The name for this protocol op type.

encode

public ASN1Element encode()
Encodes this protocol op to an ASN.1 element suitable for including in an LDAP message.

Specified by:
encode in class ProtocolOp
Returns:
The ASN.1 element containing the encoded protocol op.

decodeBindRequest

public static BindRequestProtocolOp decodeBindRequest(ASN1Element element)
                                               throws LDAPException
Decodes the provided ASN.1 element as an LDAP bind request protocol op.

Parameters:
element - The ASN.1 element to decode.
Returns:
The decoded LDAP bind request protocol op.
Throws:
LDAPException - If a problem occurs while trying to decode the provided ASN.1 element as an LDAP bind request.

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 class ProtocolOp
Parameters:
buffer - The buffer to which the string should be appended.

toString

public void toString(java.lang.StringBuilder buffer,
                     int indent)
Appends a multi-line string representation of this LDAP protocol op to the provided buffer.

Specified by:
toString in class ProtocolOp
Parameters:
buffer - The buffer to which the information should be appended.
indent - The number of spaces from the margin that the lines should be indented.