@NotExtensible @NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public class LDAPException extends LDAPSDKException
LDAPResult
, so that all of the response elements
will be available.Modifier and Type | Field and Description |
---|---|
protected static Control[] |
NO_CONTROLS
An empty array that will be used when no controls were provided.
|
protected static java.lang.String[] |
NO_REFERRALS
An empty array that will be used when no referrals were provided.
|
Constructor and Description |
---|
LDAPException(LDAPException e)
Creates a new LDAP exception using the information contained in the
provided LDAP exception.
|
LDAPException(LDAPResult ldapResult)
Creates a new LDAP exception using the information contained in the
provided LDAP result object.
|
LDAPException(LDAPResult ldapResult,
java.lang.Throwable cause)
Creates a new LDAP exception using the information contained in the
provided LDAP result object.
|
LDAPException(ResultCode resultCode)
Creates a new LDAP exception with the provided result code.
|
LDAPException(ResultCode resultCode,
java.lang.String errorMessage)
Creates a new LDAP exception with the provided result code and message.
|
LDAPException(ResultCode resultCode,
java.lang.String errorMessage,
java.lang.String matchedDN,
java.lang.String[] referralURLs)
Creates a new LDAP exception with the provided information.
|
LDAPException(ResultCode resultCode,
java.lang.String errorMessage,
java.lang.String matchedDN,
java.lang.String[] referralURLs,
Control[] controls)
Creates a new LDAP exception with the provided information.
|
LDAPException(ResultCode resultCode,
java.lang.String errorMessage,
java.lang.String matchedDN,
java.lang.String[] referralURLs,
Control[] controls,
java.lang.Throwable cause)
Creates a new LDAP exception with the provided information.
|
LDAPException(ResultCode resultCode,
java.lang.String errorMessage,
java.lang.String matchedDN,
java.lang.String[] referralURLs,
java.lang.Throwable cause)
Creates a new LDAP exception with the provided information.
|
LDAPException(ResultCode resultCode,
java.lang.String errorMessage,
java.lang.Throwable cause)
Creates a new LDAP exception with the provided result code and message.
|
LDAPException(ResultCode resultCode,
java.lang.Throwable cause)
Creates a new LDAP exception with the provided result code.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDiagnosticMessage()
Retrieves the diagnostic message returned by the directory server.
|
java.lang.String |
getExceptionMessage()
Retrieves a string representation of this exception suitable for use in
messages.
|
java.lang.String |
getMatchedDN()
Retrieves the matched DN for this LDAP exception.
|
java.lang.String[] |
getReferralURLs()
Retrieves the set of referral URLs for this LDAP exception.
|
Control |
getResponseControl(java.lang.String oid)
Retrieves the response control with the specified OID.
|
Control[] |
getResponseControls()
Retrieves the set of response controls for this LDAP exception.
|
ResultCode |
getResultCode()
Retrieves the result code for this LDAP exception.
|
java.lang.String |
getResultString()
Retrieves a string representation of this LDAP result, consisting of
the result code, diagnostic message (if present), matched DN (if present),
and referral URLs (if present).
|
boolean |
hasResponseControl()
Indicates whether this result contains at least one control.
|
boolean |
hasResponseControl(java.lang.String oid)
Indicates whether this result contains at least one control with the
specified OID.
|
LDAPResult |
toLDAPResult()
Creates a new
LDAPResult object from this exception. |
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this exception to the provided buffer.
|
toString
protected static final Control[] NO_CONTROLS
protected static final java.lang.String[] NO_REFERRALS
public LDAPException(ResultCode resultCode)
resultCode
- The result code for this LDAP exception.public LDAPException(ResultCode resultCode, java.lang.Throwable cause)
resultCode
- The result code for this LDAP exception.cause
- The underlying exception that triggered this exception.public LDAPException(ResultCode resultCode, java.lang.String errorMessage)
resultCode
- The result code for this LDAP exception.errorMessage
- The error message for this LDAP exception.public LDAPException(ResultCode resultCode, java.lang.String errorMessage, java.lang.Throwable cause)
resultCode
- The result code for this LDAP exception.errorMessage
- The error message for this LDAP exception.cause
- The underlying exception that triggered this
exception.public LDAPException(ResultCode resultCode, java.lang.String errorMessage, java.lang.String matchedDN, java.lang.String[] referralURLs)
resultCode
- The result code for this LDAP exception.errorMessage
- The error message for this LDAP exception.matchedDN
- The matched DN for this LDAP exception.referralURLs
- The set of referral URLs for this LDAP exception.public LDAPException(ResultCode resultCode, java.lang.String errorMessage, java.lang.String matchedDN, java.lang.String[] referralURLs, java.lang.Throwable cause)
resultCode
- The result code for this LDAP exception.errorMessage
- The error message for this LDAP exception.matchedDN
- The matched DN for this LDAP exception.referralURLs
- The set of referral URLs for this LDAP exception.cause
- The underlying exception that triggered this
exception.public LDAPException(ResultCode resultCode, java.lang.String errorMessage, java.lang.String matchedDN, java.lang.String[] referralURLs, Control[] controls)
resultCode
- The result code for this LDAP exception.errorMessage
- The error message for this LDAP exception.matchedDN
- The matched DN for this LDAP exception.referralURLs
- The set of referral URLs for this LDAP exception.controls
- The set of response controls for this LDAP exception.public LDAPException(ResultCode resultCode, java.lang.String errorMessage, java.lang.String matchedDN, java.lang.String[] referralURLs, Control[] controls, java.lang.Throwable cause)
resultCode
- The result code for this LDAP exception.errorMessage
- The error message for this LDAP exception.matchedDN
- The matched DN for this LDAP exception.referralURLs
- The set of referral URLs for this LDAP exception.controls
- The set of response controls for this LDAP exception.cause
- The underlying exception that triggered this
exception.public LDAPException(LDAPResult ldapResult)
ldapResult
- The LDAP result object containing the information to
use for this LDAP exception.public LDAPException(LDAPResult ldapResult, java.lang.Throwable cause)
ldapResult
- The LDAP result object containing the information to
use for this LDAP exception.cause
- The underlying exception that triggered this exception.public LDAPException(LDAPException e)
e
- The LDAP exception to use to create this exception.public final ResultCode getResultCode()
public final java.lang.String getMatchedDN()
null
if there
is none.public final java.lang.String getDiagnosticMessage()
null
if there is none.public final java.lang.String[] getReferralURLs()
public final boolean hasResponseControl()
true
if this result contains at least one control, or
false
if not.public final boolean hasResponseControl(java.lang.String oid)
oid
- The object identifier for which to make the determination. It
must not be null
.true
if this result contains at least one control with
the specified OID, or false
if not.public final Control[] getResponseControls()
get
method in the response control class, using
the toLDAPResult()
method to convert this exception to an
LDAPResult
.public final Control getResponseControl(java.lang.String oid)
oid
- The OID of the control to retrieve.null
if
there is no such control.public LDAPResult toLDAPResult()
LDAPResult
object from this exception.LDAPResult
object created from this exception.public java.lang.String getResultString()
public void toString(java.lang.StringBuilder buffer)
toString
in class LDAPSDKException
buffer
- The buffer to which the string representation of this
exception is to be appended.public final java.lang.String getExceptionMessage()
getExceptionMessage
in class LDAPSDKException