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
public class LDAPConnectionException extends Exception
LDAP connection exception.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LDAPConnectionException.CauseType
Enumeration of LDAP connection exception cause types.
-
Constructor Summary
Constructors Constructor Description LDAPConnectionException(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LDAPConnectionException.CauseType
getCauseType()
Gets 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 Detail
-
LDAPConnectionException
public LDAPConnectionException(String message)
Creates a new LDAP connection exception, with no specific cause type.- Parameters:
message
- The exception message. Should not benull
.
-
LDAPConnectionException
public LDAPConnectionException(String message, LDAPConnectionException.CauseType causeType)
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 Detail
-
parse
public static LDAPConnectionException parse(com.unboundid.ldap.sdk.LDAPException e)
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
public LDAPConnectionException.CauseType getCauseType()
Gets the cause type.- Returns:
- The cause type.
-
-