Package com.nimbusds.common.ldap
Class LDAPConnectionException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.nimbusds.common.ldap.LDAPConnectionException
- All Implemented Interfaces:
Serializable
LDAP connection exception.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enumeration of LDAP connection exception cause types. -
Constructor Summary
ConstructorDescriptionLDAPConnectionException
(String message) Creates a new LDAP connection exception, with no specific cause type.LDAPConnectionException
(String message, LDAPConnectionException.CauseType causeType) Creates a new LDAP connection exception.LDAPConnectionException
(String message, LDAPConnectionException.CauseType causeType, Throwable cause) Creates a new LDAP connection exception. -
Method Summary
Modifier and TypeMethodDescriptionGets the cause type.static LDAPConnectionException
parse
(com.unboundid.ldap.sdk.LDAPException e) Creates a new LDAP connection exception from the specified LDAP SDK exception.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
LDAPConnectionException
Creates a new LDAP connection exception, with no specific cause type.- Parameters:
message
- The exception message. Should not benull
.
-
LDAPConnectionException
Creates a new LDAP connection exception.- Parameters:
message
- The exception message. Should not benull
.causeType
- The cause type,null
if not specified.
-
LDAPConnectionException
public LDAPConnectionException(String message, LDAPConnectionException.CauseType causeType, Throwable cause) Creates a new LDAP connection exception.- Parameters:
message
- The exception message. Should not benull
.causeType
- The cause type,null
if not specified.cause
- The exception cause,null
if not specified.
-
-
Method Details
-
parse
Creates a new LDAP connection exception from the specified LDAP SDK exception.This method contains special logic to compensate for a "bug" in the Unboundid LDAP SDK (found in 1.1.3) where network errors are poorly reported: instead of throwing a java.net.* exception, the SDK produces a general IOException where you need to scan its message text to find out the exact network cause (see unbounded.ldap.sdk.LDAPConnectionInternals() #line 142).
- Parameters:
e
- The LDAP SDK exception. Must not benull
.- Returns:
- The matching LDAP connection exception.
-
getCauseType
Gets the cause type.- Returns:
- The cause type.
-