Class LDAPException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.unboundid.ldap.sdk.migrate.ldapjdk.LDAPException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
LDAPInterruptedException,LDAPReferralException
@NotExtensible
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public class LDAPException
extends 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
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe int value for the ADMIN_LIMIT_EXCEEDED result code.static final intThe int value for the AFFECTS_MULTIPLE_DSAS result code.static final intThe int value for the ALIAS_DEREFERENCING_PROBLEM result code.static final intThe int value for the ALIAS_PROBLEM result code.static final intThe int value for the ATTRIBUTE_OR_VALUE_EXISTS result code.static final intThe int value for the AUTH_METHOD_NOT_SUPPORTED result code.static final intThe int value for the BUSY result code.static final intThe int value for the CLIENT_LOOP result code.static final intThe int value for the COMPARE_FALSE result code.static final intThe int value for the COMPARE_TRUE result code.static final intThe int value for the CONFIDENTIALITY_REQUIRED result code.static final intThe int value for the CONNECT_ERROR result code.static final intThe int value for the CONSTRAINT_VIOLATION result code.static final intThe int value for the CONTROL_NOT_FOUND result code.static final intThe int value for the ENTRY_ALREADY_EXISTS result code.static final intThe int value for the INAPPROPRIATE_AUTHENTICATION result code.static final intThe int value for the INAPPROPRIATE_MATCHING result code.static final intThe int value for the INDEX_RANGE_ERROR result code.static final intThe int value for the INSUFFICIENT_ACCESS_RIGHTS result code.static final intThe int value for the INVALID_ATTRIBUTE_SYNTAX result code.static final intThe int value for the INVALID_CREDENTIALS result code.static final intThe int value for the INVALID_DN_SYNTAX result code.static final intThe int value for the IS_LEAF result code.static final intThe int value for the LDAP_NOT_SUPPORTED result code.static final intThe int value for the LDAP_PARTIAL_RESULTS result code.static final intThe int value for the LDAP_TIMEOUT result code.static final intThe int value for the LOOP_DETECT result code.static final intThe int value for the MORE_RESULTS_TO_RETURN result code.static final intThe int value for the NAMING_VIOLATION result code.static final intThe int value for the NO_RESULTS_RETURNED result code.static final intThe int value for the NO_SUCH_ATTRIBUTE result code.static final intThe int value for the NO_SUCH_OBJECT result code.static final intThe int value for the NOT_ALLOWED_ON_NONLEAF result code.static final intThe int value for the NOT_ALLOWED_ON_RDN result code.static final intThe int value for the OBJECT_CLASS_MODS_PROHIBITED result code.static final intThe int value for the OBJECT_CLASS_VIOLATION result code.static final intThe int value for the OPERATION_ERROR result code.static final intThe int value for the OTHER result code.static final intThe int value for the PARAM_ERROR result code.static final intThe int value for the PROTOCOL_ERROR result code.static final intThe int value for the REFERRAL result code.static final intThe int value for the REFERRAL_LIMIT_EXCEEDED result code.static final intThe int value for the SASL_BIND_IN_PROGRESS result code.static final intThe int value for the SERVER_DOWN result code.static final intThe int value for the SIZE_LIMIT_EXCEEDED result code.static final intThe int value for the SORT_CONTROL_MISSING result code.static final intThe int value for the STRONG_AUTH_REQUIRED result code.static final intThe int value for the SUCCESS result code.static final intThe int value for the TIME_LIMIT_EXCEEDED result code.static final intThe int value for the UNAVAILABLE result code.static final intThe int value for the UNAVAILABLE_CRITICAL_EXTENSION result code.static final intThe int value for the UNDEFINED_ATTRIBUTE_TYPE result code.static final intThe int value for the UNWILLING_TO_PERFORM result code. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new LDAP exception with no information.LDAPException(LDAPException ldapException) Creates a new LDAP exception from the providedLDAPExceptionobject.LDAPException(String message) Creates a new LDAP exception with the provided information.LDAPException(String message, int resultCode) Creates a new LDAP exception with the provided information.LDAPException(String message, int resultCode, String serverErrorMessage) Creates a new LDAP exception with the provided information.LDAPException(String message, int resultCode, String serverErrorMessage, String matchedDN) Creates a new LDAP exception with the provided information. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves a string representation of the result code for this LDAP exception.static StringerrorCodeToString(int code) Retrieves a string representation of the result code for this LDAP exception.static StringerrorCodeToString(int code, Locale locale) Retrieves a string representation of the result code for this LDAP exception.Retrieves a string representation of the result code for this LDAP exception.Retrieves the error message received from the server, if available.intRetrieves the result code for this LDAP exception.Retrieves the matched DN for this LDAP exception, if available.final LDAPExceptionRetrieves anLDAPExceptionobject that is the equivalent of this LDAP exception.toString()Retrieves a string representation of this LDAP exception.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Field Details
-
SUCCESS
The int value for the SUCCESS result code.- See Also:
-
OPERATION_ERROR
The int value for the OPERATION_ERROR result code.- See Also:
-
PROTOCOL_ERROR
The int value for the PROTOCOL_ERROR result code.- See Also:
-
TIME_LIMIT_EXCEEDED
The int value for the TIME_LIMIT_EXCEEDED result code.- See Also:
-
SIZE_LIMIT_EXCEEDED
The int value for the SIZE_LIMIT_EXCEEDED result code.- See Also:
-
COMPARE_FALSE
The int value for the COMPARE_FALSE result code.- See Also:
-
COMPARE_TRUE
The int value for the COMPARE_TRUE result code.- See Also:
-
AUTH_METHOD_NOT_SUPPORTED
The int value for the AUTH_METHOD_NOT_SUPPORTED result code.- See Also:
-
STRONG_AUTH_REQUIRED
The int value for the STRONG_AUTH_REQUIRED result code.- See Also:
-
LDAP_PARTIAL_RESULTS
The int value for the LDAP_PARTIAL_RESULTS result code.- See Also:
-
REFERRAL
The int value for the REFERRAL result code.- See Also:
-
ADMIN_LIMIT_EXCEEDED
The int value for the ADMIN_LIMIT_EXCEEDED result code.- See Also:
-
UNAVAILABLE_CRITICAL_EXTENSION
The int value for the UNAVAILABLE_CRITICAL_EXTENSION result code.- See Also:
-
CONFIDENTIALITY_REQUIRED
The int value for the CONFIDENTIALITY_REQUIRED result code.- See Also:
-
SASL_BIND_IN_PROGRESS
The int value for the SASL_BIND_IN_PROGRESS result code.- See Also:
-
NO_SUCH_ATTRIBUTE
The int value for the NO_SUCH_ATTRIBUTE result code.- See Also:
-
UNDEFINED_ATTRIBUTE_TYPE
The int value for the UNDEFINED_ATTRIBUTE_TYPE result code.- See Also:
-
INAPPROPRIATE_MATCHING
The int value for the INAPPROPRIATE_MATCHING result code.- See Also:
-
CONSTRAINT_VIOLATION
The int value for the CONSTRAINT_VIOLATION result code.- See Also:
-
ATTRIBUTE_OR_VALUE_EXISTS
The int value for the ATTRIBUTE_OR_VALUE_EXISTS result code.- See Also:
-
INVALID_ATTRIBUTE_SYNTAX
The int value for the INVALID_ATTRIBUTE_SYNTAX result code.- See Also:
-
NO_SUCH_OBJECT
The int value for the NO_SUCH_OBJECT result code.- See Also:
-
ALIAS_PROBLEM
The int value for the ALIAS_PROBLEM result code.- See Also:
-
INVALID_DN_SYNTAX
The int value for the INVALID_DN_SYNTAX result code.- See Also:
-
IS_LEAF
The int value for the IS_LEAF result code.- See Also:
-
ALIAS_DEREFERENCING_PROBLEM
The int value for the ALIAS_DEREFERENCING_PROBLEM result code.- See Also:
-
INAPPROPRIATE_AUTHENTICATION
The int value for the INAPPROPRIATE_AUTHENTICATION result code.- See Also:
-
INVALID_CREDENTIALS
The int value for the INVALID_CREDENTIALS result code.- See Also:
-
INSUFFICIENT_ACCESS_RIGHTS
The int value for the INSUFFICIENT_ACCESS_RIGHTS result code.- See Also:
-
BUSY
The int value for the BUSY result code.- See Also:
-
UNAVAILABLE
The int value for the UNAVAILABLE result code.- See Also:
-
UNWILLING_TO_PERFORM
The int value for the UNWILLING_TO_PERFORM result code.- See Also:
-
LOOP_DETECTED
The int value for the LOOP_DETECT result code.- See Also:
-
SORT_CONTROL_MISSING
The int value for the SORT_CONTROL_MISSING result code.- See Also:
-
INDEX_RANGE_ERROR
The int value for the INDEX_RANGE_ERROR result code.- See Also:
-
NAMING_VIOLATION
The int value for the NAMING_VIOLATION result code.- See Also:
-
OBJECT_CLASS_VIOLATION
The int value for the OBJECT_CLASS_VIOLATION result code.- See Also:
-
NOT_ALLOWED_ON_NONLEAF
The int value for the NOT_ALLOWED_ON_NONLEAF result code.- See Also:
-
NOT_ALLOWED_ON_RDN
The int value for the NOT_ALLOWED_ON_RDN result code.- See Also:
-
ENTRY_ALREADY_EXISTS
The int value for the ENTRY_ALREADY_EXISTS result code.- See Also:
-
OBJECT_CLASS_MODS_PROHIBITED
The int value for the OBJECT_CLASS_MODS_PROHIBITED result code.- See Also:
-
AFFECTS_MULTIPLE_DSAS
The int value for the AFFECTS_MULTIPLE_DSAS result code.- See Also:
-
OTHER
The int value for the OTHER result code.- See Also:
-
SERVER_DOWN
The int value for the SERVER_DOWN result code.- See Also:
-
LDAP_TIMEOUT
The int value for the LDAP_TIMEOUT result code.- See Also:
-
PARAM_ERROR
The int value for the PARAM_ERROR result code.- See Also:
-
CONNECT_ERROR
The int value for the CONNECT_ERROR result code.- See Also:
-
LDAP_NOT_SUPPORTED
The int value for the LDAP_NOT_SUPPORTED result code.- See Also:
-
CONTROL_NOT_FOUND
The int value for the CONTROL_NOT_FOUND result code.- See Also:
-
NO_RESULTS_RETURNED
The int value for the NO_RESULTS_RETURNED result code.- See Also:
-
MORE_RESULTS_TO_RETURN
The int value for the MORE_RESULTS_TO_RETURN result code.- See Also:
-
CLIENT_LOOP
The int value for the CLIENT_LOOP result code.- See Also:
-
REFERRAL_LIMIT_EXCEEDED
The int value for the REFERRAL_LIMIT_EXCEEDED result code.- See Also:
-
-
Constructor Details
-
LDAPException
public LDAPException()Creates a new LDAP exception with no information. -
LDAPException
Creates a new LDAP exception with the provided information.- Parameters:
message- The message for this exception, if available.
-
LDAPException
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
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(@Nullable String message, int resultCode, @Nullable String serverErrorMessage, @Nullable 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
Creates a new LDAP exception from the providedLDAPExceptionobject.- Parameters:
ldapException- TheLDAPExceptionobject to use to create this LDAP exception.
-
-
Method Details
-
getLDAPResultCode
Retrieves the result code for this LDAP exception.- Returns:
- The result code for this LDAP exception.
-
getLDAPErrorMessage
Retrieves the error message received from the server, if available.- Returns:
- The error message received from the server, or
nullif none is available.
-
getMatchedDN
Retrieves the matched DN for this LDAP exception, if available.- Returns:
- The matched DN for this LDAP exception, or
nullif none is available.
-
toLDAPException
Retrieves anLDAPExceptionobject that is the equivalent of this LDAP exception.- Returns:
- The
LDAPExceptionobject that is the equivalent of this LDAP exception.
-
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
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
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
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
Retrieves a string representation of this LDAP exception.
-