com.unboundid.ldap.sdk
Class LDAPBindException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.unboundid.util.LDAPSDKException
              extended by com.unboundid.ldap.sdk.LDAPException
                  extended by com.unboundid.ldap.sdk.LDAPBindException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
SASLBindInProgressException

public class LDAPBindException
extends LDAPException

This class defines an exception that can be thrown if the server sends a bind response with a result code other than ResultCode#SUCCESS, which indicates that the bind operation did not complete successfully. This may be used to obtain access to any server SASL credentials contained in the non-successful bind result.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.unboundid.ldap.sdk.LDAPException
NO_CONTROLS, NO_REFERRALS
 
Constructor Summary
LDAPBindException(BindResult bindResult)
          Creates a new LDAP bind exception from the provided bind result.
 
Method Summary
 BindResult getBindResult()
          Retrieves the bind result that was returned by the server.
 ASN1OctetString getServerSASLCredentials()
          Retrieves the server SASL credentials included in the bind result, if any.
 LDAPResult toLDAPResult()
          Creates a new LDAPResult object from this exception.
 
Methods inherited from class com.unboundid.ldap.sdk.LDAPException
getDiagnosticMessage, getExceptionMessage, getMatchedDN, getReferralURLs, getResponseControl, getResponseControls, getResultCode, getResultString, hasResponseControl, hasResponseControl, toString
 
Methods inherited from class com.unboundid.util.LDAPSDKException
toString
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LDAPBindException

public LDAPBindException(BindResult bindResult)
Creates a new LDAP bind exception from the provided bind result.

Parameters:
bindResult - The bind result to use to create this exception.
Method Detail

toLDAPResult

public LDAPResult toLDAPResult()
Creates a new LDAPResult object from this exception.

Overrides:
toLDAPResult in class LDAPException
Returns:
The LDAPResult object created from this exception.

getBindResult

public BindResult getBindResult()
Retrieves the bind result that was returned by the server.

Returns:
The bind result that was returned by the server.

getServerSASLCredentials

public ASN1OctetString getServerSASLCredentials()
Retrieves the server SASL credentials included in the bind result, if any.

Returns:
The server SASL credentials included in the bind result, or null if the bind result did not include any server SASL credentials.