public class LdapException extends IOException implements LocalizableException
Modifier | Constructor and Description |
---|---|
protected |
LdapException(Result result)
Creates a new LDAP exception using the provided result.
|
Modifier and Type | Method and Description |
---|---|
Collection<Control> |
getControls()
Returns controls associated with the result of this LDAP exception.
|
String |
getMatchedDn()
Returns the matched DN associated with this result.
|
String |
getMessage() |
LocalizableMessage |
getMessageObject()
Returns the localizable message that explains the problem that occurred.
|
List<String> |
getReferralUris()
Returns a
List containing the referral URIs included with this
result. |
Result |
getResult()
Returns the error result which caused this exception to be thrown.
|
ResultCode |
getResultCode()
Returns the result code associated with this result.
|
static LdapException |
newLdapClientException(Throwable cause)
Creates a new LDAP client exception with the provided cause and a result code depending
on the class cause original
cause . |
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,
Dn matchedDn,
Throwable cause)
Creates a new LDAP exception with the provided resultCode, diagnosticMessage, matched DN and cause.
|
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 . |
String |
toString() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
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(ResultCode resultCode, CharSequence diagnosticMessage, Dn matchedDn, Throwable cause)
resultCode
- The result code.diagnosticMessage
- The diagnostic message, which may be empty or null
.matchedDn
- The matched DN associated, 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 newLdapClientException(Throwable cause)
cause
.
If no cause is provided, or there is no specific result code defined for the cause,
ResultCode.CLIENT_SIDE_LOCAL_ERROR
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()
public String getMatchedDn()
null
).public List<String> getReferralUris()
List
containing the referral URIs included with this
result. The returned List
may be modified if permitted by this
result.List
containing the referral URIs.public ResultCode getResultCode()
public Collection<Control> getControls()
Control
s associated with the Result
encapsulated in this LdapException
.public LocalizableMessage getMessageObject()
LocalizableException
getMessageObject
in interface LocalizableException
public String getMessage()
getMessage
in class Throwable
Copyright 2010-2022 ForgeRock AS.