com.unboundid.ldap.sdk.migrate.ldapjdk
Class LDAPException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.unboundid.ldap.sdk.migrate.ldapjdk.LDAPException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
LDAPInterruptedException, LDAPReferralException

@NotExtensible
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public class LDAPException
extends java.lang.Exception

This class defines an exception that may be thrown if an error occurs during LDAP-related processing.

This class is primarily intended to be used in the process of updating applications which use the Netscape Directory SDK for Java to switch to or coexist with the UnboundID LDAP SDK for Java. For applications not written using the Netscape Directory SDK for Java, the LDAPException class should be used instead.

See Also:
Serialized Form

Field Summary
static int ADMIN_LIMIT_EXCEEDED
          The int value for the ADMIN_LIMIT_EXCEEDED result code.
static int AFFECTS_MULTIPLE_DSAS
          The int value for the AFFECTS_MULTIPLE_DSAS result code.
static int ALIAS_DEREFERENCING_PROBLEM
          The int value for the ALIAS_DEREFERENCING_PROBLEM result code.
static int ALIAS_PROBLEM
          The int value for the ALIAS_PROBLEM result code.
static int ATTRIBUTE_OR_VALUE_EXISTS
          The int value for the ATTRIBUTE_OR_VALUE_EXISTS result code.
static int AUTH_METHOD_NOT_SUPPORTED
          The int value for the AUTH_METHOD_NOT_SUPPORTED result code.
static int BUSY
          The int value for the BUSY result code.
static int CLIENT_LOOP
          The int value for the CLIENT_LOOP result code.
static int COMPARE_FALSE
          The int value for the COMPARE_FALSE result code.
static int COMPARE_TRUE
          The int value for the COMPARE_TRUE result code.
static int CONFIDENTIALITY_REQUIRED
          The int value for the CONFIDENTIALITY_REQUIRED result code.
static int CONNECT_ERROR
          The int value for the CONNECT_ERROR result code.
static int CONSTRAINT_VIOLATION
          The int value for the CONSTRAINT_VIOLATION result code.
static int CONTROL_NOT_FOUND
          The int value for the CONTROL_NOT_FOUND result code.
static int ENTRY_ALREADY_EXISTS
          The int value for the ENTRY_ALREADY_EXISTS result code.
static int INAPPROPRIATE_AUTHENTICATION
          The int value for the INAPPROPRIATE_AUTHENTICATION result code.
static int INAPPROPRIATE_MATCHING
          The int value for the INAPPROPRIATE_MATCHING result code.
static int INDEX_RANGE_ERROR
          The int value for the INDEX_RANGE_ERROR result code.
static int INSUFFICIENT_ACCESS_RIGHTS
          The int value for the INSUFFICIENT_ACCESS_RIGHTS result code.
static int INVALID_ATTRIBUTE_SYNTAX
          The int value for the INVALID_ATTRIBUTE_SYNTAX result code.
static int INVALID_CREDENTIALS
          The int value for the INVALID_CREDENTIALS result code.
static int INVALID_DN_SYNTAX
          The int value for the INVALID_DN_SYNTAX result code.
static int IS_LEAF
          The int value for the IS_LEAF result code.
static int LDAP_NOT_SUPPORTED
          The int value for the LDAP_NOT_SUPPORTED result code.
static int LDAP_PARTIAL_RESULTS
          The int value for the LDAP_PARTIAL_RESULTS result code.
static int LDAP_TIMEOUT
          The int value for the LDAP_TIMEOUT result code.
static int LOOP_DETECTED
          The int value for the LOOP_DETECT result code.
static int MORE_RESULTS_TO_RETURN
          The int value for the MORE_RESULTS_TO_RETURN result code.
static int NAMING_VIOLATION
          The int value for the NAMING_VIOLATION result code.
static int NO_RESULTS_RETURNED
          The int value for the NO_RESULTS_RETURNED result code.
static int NO_SUCH_ATTRIBUTE
          The int value for the NO_SUCH_ATTRIBUTE result code.
static int NO_SUCH_OBJECT
          The int value for the NO_SUCH_OBJECT result code.
static int NOT_ALLOWED_ON_NONLEAF
          The int value for the NOT_ALLOWED_ON_NONLEAF result code.
static int NOT_ALLOWED_ON_RDN
          The int value for the NOT_ALLOWED_ON_RDN result code.
static int OBJECT_CLASS_MODS_PROHIBITED
          The int value for the OBJECT_CLASS_MODS_PROHIBITED result code.
static int OBJECT_CLASS_VIOLATION
          The int value for the OBJECT_CLASS_VIOLATION result code.
static int OPERATION_ERROR
          The int value for the OPERATION_ERROR result code.
static int OTHER
          The int value for the OTHER result code.
static int PARAM_ERROR
          The int value for the PARAM_ERROR result code.
static int PROTOCOL_ERROR
          The int value for the PROTOCOL_ERROR result code.
static int REFERRAL
          The int value for the REFERRAL result code.
static int REFERRAL_LIMIT_EXCEEDED
          The int value for the REFERRAL_LIMIT_EXCEEDED result code.
static int SASL_BIND_IN_PROGRESS
          The int value for the SASL_BIND_IN_PROGRESS result code.
static int SERVER_DOWN
          The int value for the SERVER_DOWN result code.
static int SIZE_LIMIT_EXCEEDED
          The int value for the SIZE_LIMIT_EXCEEDED result code.
static int SORT_CONTROL_MISSING
          The int value for the SORT_CONTROL_MISSING result code.
static int STRONG_AUTH_REQUIRED
          The int value for the STRONG_AUTH_REQUIRED result code.
static int SUCCESS
          The int value for the SUCCESS result code.
static int TIME_LIMIT_EXCEEDED
          The int value for the TIME_LIMIT_EXCEEDED result code.
static int UNAVAILABLE
          The int value for the UNAVAILABLE result code.
static int UNAVAILABLE_CRITICAL_EXTENSION
          The int value for the UNAVAILABLE_CRITICAL_EXTENSION result code.
static int UNDEFINED_ATTRIBUTE_TYPE
          The int value for the UNDEFINED_ATTRIBUTE_TYPE result code.
static int UNWILLING_TO_PERFORM
          The int value for the UNWILLING_TO_PERFORM result code.
 
Constructor Summary
LDAPException()
          Creates a new LDAP exception with no information.
LDAPException(LDAPException ldapException)
          Creates a new LDAP exception from the provided LDAPException object.
LDAPException(java.lang.String message)
          Creates a new LDAP exception with the provided information.
LDAPException(java.lang.String message, int resultCode)
          Creates a new LDAP exception with the provided information.
LDAPException(java.lang.String message, int resultCode, java.lang.String serverErrorMessage)
          Creates a new LDAP exception with the provided information.
LDAPException(java.lang.String message, int resultCode, java.lang.String serverErrorMessage, java.lang.String matchedDN)
          Creates a new LDAP exception with the provided information.
 
Method Summary
 java.lang.String errorCodeToString()
          Retrieves a string representation of the result code for this LDAP exception.
static java.lang.String errorCodeToString(int code)
          Retrieves a string representation of the result code for this LDAP exception.
static java.lang.String errorCodeToString(int code, java.util.Locale locale)
          Retrieves a string representation of the result code for this LDAP exception.
 java.lang.String errorCodeToString(java.util.Locale l)
          Retrieves a string representation of the result code for this LDAP exception.
 java.lang.String getLDAPErrorMessage()
          Retrieves the error message received from the server, if available.
 int getLDAPResultCode()
          Retrieves the result code for this LDAP exception.
 java.lang.String getMatchedDN()
          Retrieves the matched DN for this LDAP exception, if available.
 LDAPException toLDAPException()
          Retrieves an LDAPException object that is the equivalent of this LDAP exception.
 java.lang.String toString()
          Retrieves a string representation of this LDAP exception.
 
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
 

Field Detail

SUCCESS

public static final int SUCCESS
The int value for the SUCCESS result code.

See Also:
Constant Field Values

OPERATION_ERROR

public static final int OPERATION_ERROR
The int value for the OPERATION_ERROR result code.

See Also:
Constant Field Values

PROTOCOL_ERROR

public static final int PROTOCOL_ERROR
The int value for the PROTOCOL_ERROR result code.

See Also:
Constant Field Values

TIME_LIMIT_EXCEEDED

public static final int TIME_LIMIT_EXCEEDED
The int value for the TIME_LIMIT_EXCEEDED result code.

See Also:
Constant Field Values

SIZE_LIMIT_EXCEEDED

public static final int SIZE_LIMIT_EXCEEDED
The int value for the SIZE_LIMIT_EXCEEDED result code.

See Also:
Constant Field Values

COMPARE_FALSE

public static final int COMPARE_FALSE
The int value for the COMPARE_FALSE result code.

See Also:
Constant Field Values

COMPARE_TRUE

public static final int COMPARE_TRUE
The int value for the COMPARE_TRUE result code.

See Also:
Constant Field Values

AUTH_METHOD_NOT_SUPPORTED

public static final int AUTH_METHOD_NOT_SUPPORTED
The int value for the AUTH_METHOD_NOT_SUPPORTED result code.

See Also:
Constant Field Values

STRONG_AUTH_REQUIRED

public static final int STRONG_AUTH_REQUIRED
The int value for the STRONG_AUTH_REQUIRED result code.

See Also:
Constant Field Values

LDAP_PARTIAL_RESULTS

public static final int LDAP_PARTIAL_RESULTS
The int value for the LDAP_PARTIAL_RESULTS result code.

See Also:
Constant Field Values

REFERRAL

public static final int REFERRAL
The int value for the REFERRAL result code.

See Also:
Constant Field Values

ADMIN_LIMIT_EXCEEDED

public static final int ADMIN_LIMIT_EXCEEDED
The int value for the ADMIN_LIMIT_EXCEEDED result code.

See Also:
Constant Field Values

UNAVAILABLE_CRITICAL_EXTENSION

public static final int UNAVAILABLE_CRITICAL_EXTENSION
The int value for the UNAVAILABLE_CRITICAL_EXTENSION result code.

See Also:
Constant Field Values

CONFIDENTIALITY_REQUIRED

public static final int CONFIDENTIALITY_REQUIRED
The int value for the CONFIDENTIALITY_REQUIRED result code.

See Also:
Constant Field Values

SASL_BIND_IN_PROGRESS

public static final int SASL_BIND_IN_PROGRESS
The int value for the SASL_BIND_IN_PROGRESS result code.

See Also:
Constant Field Values

NO_SUCH_ATTRIBUTE

public static final int NO_SUCH_ATTRIBUTE
The int value for the NO_SUCH_ATTRIBUTE result code.

See Also:
Constant Field Values

UNDEFINED_ATTRIBUTE_TYPE

public static final int UNDEFINED_ATTRIBUTE_TYPE
The int value for the UNDEFINED_ATTRIBUTE_TYPE result code.

See Also:
Constant Field Values

INAPPROPRIATE_MATCHING

public static final int INAPPROPRIATE_MATCHING
The int value for the INAPPROPRIATE_MATCHING result code.

See Also:
Constant Field Values

CONSTRAINT_VIOLATION

public static final int CONSTRAINT_VIOLATION
The int value for the CONSTRAINT_VIOLATION result code.

See Also:
Constant Field Values

ATTRIBUTE_OR_VALUE_EXISTS

public static final int ATTRIBUTE_OR_VALUE_EXISTS
The int value for the ATTRIBUTE_OR_VALUE_EXISTS result code.

See Also:
Constant Field Values

INVALID_ATTRIBUTE_SYNTAX

public static final int INVALID_ATTRIBUTE_SYNTAX
The int value for the INVALID_ATTRIBUTE_SYNTAX result code.

See Also:
Constant Field Values

NO_SUCH_OBJECT

public static final int NO_SUCH_OBJECT
The int value for the NO_SUCH_OBJECT result code.

See Also:
Constant Field Values

ALIAS_PROBLEM

public static final int ALIAS_PROBLEM
The int value for the ALIAS_PROBLEM result code.

See Also:
Constant Field Values

INVALID_DN_SYNTAX

public static final int INVALID_DN_SYNTAX
The int value for the INVALID_DN_SYNTAX result code.

See Also:
Constant Field Values

IS_LEAF

public static final int IS_LEAF
The int value for the IS_LEAF result code.

See Also:
Constant Field Values

ALIAS_DEREFERENCING_PROBLEM

public static final int ALIAS_DEREFERENCING_PROBLEM
The int value for the ALIAS_DEREFERENCING_PROBLEM result code.

See Also:
Constant Field Values

INAPPROPRIATE_AUTHENTICATION

public static final int INAPPROPRIATE_AUTHENTICATION
The int value for the INAPPROPRIATE_AUTHENTICATION result code.

See Also:
Constant Field Values

INVALID_CREDENTIALS

public static final int INVALID_CREDENTIALS
The int value for the INVALID_CREDENTIALS result code.

See Also:
Constant Field Values

INSUFFICIENT_ACCESS_RIGHTS

public static final int INSUFFICIENT_ACCESS_RIGHTS
The int value for the INSUFFICIENT_ACCESS_RIGHTS result code.

See Also:
Constant Field Values

BUSY

public static final int BUSY
The int value for the BUSY result code.

See Also:
Constant Field Values

UNAVAILABLE

public static final int UNAVAILABLE
The int value for the UNAVAILABLE result code.

See Also:
Constant Field Values

UNWILLING_TO_PERFORM

public static final int UNWILLING_TO_PERFORM
The int value for the UNWILLING_TO_PERFORM result code.

See Also:
Constant Field Values

LOOP_DETECTED

public static final int LOOP_DETECTED
The int value for the LOOP_DETECT result code.

See Also:
Constant Field Values

SORT_CONTROL_MISSING

public static final int SORT_CONTROL_MISSING
The int value for the SORT_CONTROL_MISSING result code.

See Also:
Constant Field Values

INDEX_RANGE_ERROR

public static final int INDEX_RANGE_ERROR
The int value for the INDEX_RANGE_ERROR result code.

See Also:
Constant Field Values

NAMING_VIOLATION

public static final int NAMING_VIOLATION
The int value for the NAMING_VIOLATION result code.

See Also:
Constant Field Values

OBJECT_CLASS_VIOLATION

public static final int OBJECT_CLASS_VIOLATION
The int value for the OBJECT_CLASS_VIOLATION result code.

See Also:
Constant Field Values

NOT_ALLOWED_ON_NONLEAF

public static final int NOT_ALLOWED_ON_NONLEAF
The int value for the NOT_ALLOWED_ON_NONLEAF result code.

See Also:
Constant Field Values

NOT_ALLOWED_ON_RDN

public static final int NOT_ALLOWED_ON_RDN
The int value for the NOT_ALLOWED_ON_RDN result code.

See Also:
Constant Field Values

ENTRY_ALREADY_EXISTS

public static final int ENTRY_ALREADY_EXISTS
The int value for the ENTRY_ALREADY_EXISTS result code.

See Also:
Constant Field Values

OBJECT_CLASS_MODS_PROHIBITED

public static final int OBJECT_CLASS_MODS_PROHIBITED
The int value for the OBJECT_CLASS_MODS_PROHIBITED result code.

See Also:
Constant Field Values

AFFECTS_MULTIPLE_DSAS

public static final int AFFECTS_MULTIPLE_DSAS
The int value for the AFFECTS_MULTIPLE_DSAS result code.

See Also:
Constant Field Values

OTHER

public static final int OTHER
The int value for the OTHER result code.

See Also:
Constant Field Values

SERVER_DOWN

public static final int SERVER_DOWN
The int value for the SERVER_DOWN result code.

See Also:
Constant Field Values

LDAP_TIMEOUT

public static final int LDAP_TIMEOUT
The int value for the LDAP_TIMEOUT result code.

See Also:
Constant Field Values

PARAM_ERROR

public static final int PARAM_ERROR
The int value for the PARAM_ERROR result code.

See Also:
Constant Field Values

CONNECT_ERROR

public static final int CONNECT_ERROR
The int value for the CONNECT_ERROR result code.

See Also:
Constant Field Values

LDAP_NOT_SUPPORTED

public static final int LDAP_NOT_SUPPORTED
The int value for the LDAP_NOT_SUPPORTED result code.

See Also:
Constant Field Values

CONTROL_NOT_FOUND

public static final int CONTROL_NOT_FOUND
The int value for the CONTROL_NOT_FOUND result code.

See Also:
Constant Field Values

NO_RESULTS_RETURNED

public static final int NO_RESULTS_RETURNED
The int value for the NO_RESULTS_RETURNED result code.

See Also:
Constant Field Values

MORE_RESULTS_TO_RETURN

public static final int MORE_RESULTS_TO_RETURN
The int value for the MORE_RESULTS_TO_RETURN result code.

See Also:
Constant Field Values

CLIENT_LOOP

public static final int CLIENT_LOOP
The int value for the CLIENT_LOOP result code.

See Also:
Constant Field Values

REFERRAL_LIMIT_EXCEEDED

public static final int REFERRAL_LIMIT_EXCEEDED
The int value for the REFERRAL_LIMIT_EXCEEDED result code.

See Also:
Constant Field Values
Constructor Detail

LDAPException

public LDAPException()
Creates a new LDAP exception with no information.


LDAPException

public LDAPException(java.lang.String message)
Creates a new LDAP exception with the provided information.

Parameters:
message - The message for this exception, if available.

LDAPException

public LDAPException(java.lang.String message,
                     int resultCode)
Creates a new LDAP exception with the provided information.

Parameters:
message - The message for this exception, if available.
resultCode - The result code for this exception.

LDAPException

public LDAPException(java.lang.String message,
                     int resultCode,
                     java.lang.String serverErrorMessage)
Creates a new LDAP exception with the provided information.

Parameters:
message - The message for this exception, if available.
resultCode - The result code for this exception.
serverErrorMessage - The error message received from the server, if available.

LDAPException

public LDAPException(java.lang.String message,
                     int resultCode,
                     java.lang.String serverErrorMessage,
                     java.lang.String matchedDN)
Creates a new LDAP exception with the provided information.

Parameters:
message - The message for this exception, if available.
resultCode - The result code for this exception.
serverErrorMessage - The error message received from the server, if available.
matchedDN - The matched DN for this exception, if available.

LDAPException

public LDAPException(LDAPException ldapException)
Creates a new LDAP exception from the provided LDAPException object.

Parameters:
ldapException - The LDAPException object to use to create this LDAP exception.
Method Detail

getLDAPResultCode

public int getLDAPResultCode()
Retrieves the result code for this LDAP exception.

Returns:
The result code for this LDAP exception.

getLDAPErrorMessage

public java.lang.String getLDAPErrorMessage()
Retrieves the error message received from the server, if available.

Returns:
The error message received from the server, or null if none is available.

getMatchedDN

public java.lang.String getMatchedDN()
Retrieves the matched DN for this LDAP exception, if available.

Returns:
The matched DN for this LDAP exception, or null if none is available.

toLDAPException

public final LDAPException toLDAPException()
Retrieves an LDAPException object that is the equivalent of this LDAP exception.

Returns:
The LDAPException object that is the equivalent of this LDAP exception.

errorCodeToString

public java.lang.String errorCodeToString()
Retrieves a string representation of the result code for this LDAP exception.

Returns:
A string representation of the result code for this LDAP exception.

errorCodeToString

public java.lang.String errorCodeToString(java.util.Locale l)
Retrieves a string representation of the result code for this LDAP exception.

Parameters:
l - The locale for the string representation.
Returns:
A string representation of the result code for this LDAP exception.

errorCodeToString

public static java.lang.String errorCodeToString(int code)
Retrieves a string representation of the result code for this LDAP exception.

Parameters:
code - The result code for which to retrieve the corresponding message.
Returns:
A string representation of the result code for this LDAP exception.

errorCodeToString

public static java.lang.String errorCodeToString(int code,
                                                 java.util.Locale locale)
Retrieves a string representation of the result code for this LDAP exception.

Parameters:
code - The result code for which to retrieve the corresponding message.
locale - The locale for the string representation.
Returns:
A string representation of the result code for this LDAP exception.

toString

public java.lang.String toString()
Retrieves a string representation of this LDAP exception.

Overrides:
toString in class java.lang.Throwable
Returns:
A string representation of this LDAP exception.