public class LdapException extends IOException
Modifier | Constructor and Description |
---|---|
protected |
LdapException(Result result)
Creates a new LDAP exception using the provided result.
|
Modifier and Type | Method and Description |
---|---|
Result |
getResult()
Returns the error result which caused this exception to be thrown.
|
static LdapException |
newLdapException(Result result)
Creates a new LDAP exception using the provided result.
|
static LdapException |
newLdapException(ResultCode resultCode)
Creates a new LDAP exception with the provided result code and an
empty diagnostic message.
|
static LdapException |
newLdapException(ResultCode resultCode,
CharSequence diagnosticMessage)
Creates a new LDAP exception with the provided result code and
diagnostic message.
|
static LdapException |
newLdapException(ResultCode resultCode,
CharSequence diagnosticMessage,
Throwable cause)
Creates a new LDAP exception with the provided result code,
diagnostic message, and cause.
|
static LdapException |
newLdapException(ResultCode resultCode,
Throwable cause)
Creates a new LDAP exception with the provided result code and
cause.
|
static LdapException |
newLdapException(Throwable cause)
Creates a new LDAP exception with the provided cause and a result code depending
on the class cause original
cause . |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
protected LdapException(Result result)
result
- The error result.public static LdapException newLdapException(ResultCode resultCode)
resultCode
- The result code.IllegalArgumentException
- If the provided result code does not represent a failure.NullPointerException
- If resultCode
was null
.public static LdapException newLdapException(ResultCode resultCode, CharSequence diagnosticMessage)
resultCode
- The result code.diagnosticMessage
- The diagnostic message, which may be empty or null
indicating that none was provided.IllegalArgumentException
- If the provided result code does not represent a failure.NullPointerException
- If resultCode
was null
.public static LdapException newLdapException(ResultCode resultCode, Throwable cause)
resultCode
- The result code.cause
- The throwable cause, which may be null
indicating that
none was provided.IllegalArgumentException
- If the provided result code does not represent a failure.NullPointerException
- If resultCode
was null
.public static LdapException newLdapException(ResultCode resultCode, CharSequence diagnosticMessage, Throwable cause)
resultCode
- The result code.diagnosticMessage
- The diagnostic message, which may be empty or null
indicating that none was provided.cause
- The throwable cause, which may be null
indicating that
none was provided.IllegalArgumentException
- If the provided result code does not represent a failure.NullPointerException
- If resultCode
was null
.public static LdapException newLdapException(Throwable cause)
cause
.
If no cause is provided, or there is no specific result code defined for the cause,
ResultCode.OTHER
will be used.cause
- The throwable cause, may be {code null}.public static LdapException newLdapException(Result result)
result
- The result whose result code indicates a failure.IllegalArgumentException
- If the provided result does not represent a failure.NullPointerException
- If result
was null
.public final Result getResult()
Copyright 2010-2020 ForgeRock AS.