Package com.unboundid.ldap.sdk
Class LDAPRuntimeException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- com.unboundid.util.LDAPSDKRuntimeException
-
- com.unboundid.ldap.sdk.LDAPRuntimeException
-
- All Implemented Interfaces:
java.io.Serializable
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class LDAPRuntimeException extends LDAPSDKRuntimeException
This class defines a version of theLDAPExceptionclass that may be thrown as aRuntimeExceptionwithout the need for it to have been explicitly declared in the method's throws list.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LDAPRuntimeException(LDAPException ldapException)Creates a new instance of thisLDAPRuntimeExceptionusing the providedLDAPException.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDiagnosticMessage()Retrieves the diagnostic message returned by the directory server.java.lang.StringgetExceptionMessage()Retrieves a string representation of this exception suitable for use in messages.java.lang.StringgetExceptionMessage(boolean includeStackTrace, boolean includeCause)Retrieves a string representation of this exception suitable for use in messages.LDAPExceptiongetLDAPException()Retrieves theLDAPExceptionobject wrapped by this runtime exception.java.lang.StringgetMatchedDN()Retrieves the matched DN for this LDAP exception.java.lang.String[]getReferralURLs()Retrieves the set of referral URLs for this LDAP exception.ControlgetResponseControl(java.lang.String oid)Retrieves the response control with the specified OID.Control[]getResponseControls()Retrieves the set of response controls for this LDAP exception.ResultCodegetResultCode()Retrieves the result code for this LDAP exception.booleanhasResponseControl()Indicates whether this result contains at least one control.booleanhasResponseControl(java.lang.String oid)Indicates whether this result contains at least one control with the specified OID.voidthrowLDAPException()Throws the wrappedLDAPExceptionobject.LDAPResulttoLDAPResult()Creates a newLDAPResultobject from this exception.voidtoString(java.lang.StringBuilder buffer)Appends a string representation of this exception to the provided buffer.-
Methods inherited from class com.unboundid.util.LDAPSDKRuntimeException
toString
-
-
-
-
Constructor Detail
-
LDAPRuntimeException
public LDAPRuntimeException(@NotNull LDAPException ldapException)
Creates a new instance of thisLDAPRuntimeExceptionusing the providedLDAPException.- Parameters:
ldapException- TheLDAPExceptionobject wrapped by this runtime exception.
-
-
Method Detail
-
getLDAPException
@NotNull public LDAPException getLDAPException()
Retrieves theLDAPExceptionobject wrapped by this runtime exception.- Returns:
- The
LDAPExceptionobject wrapped by this runtime exception.
-
throwLDAPException
public void throwLDAPException() throws LDAPException
Throws the wrappedLDAPExceptionobject.- Throws:
LDAPException- The wrappedLDAPExceptionobject.
-
getResultCode
@NotNull public ResultCode getResultCode()
Retrieves the result code for this LDAP exception.- Returns:
- The result code for this LDAP exception.
-
getMatchedDN
@Nullable public java.lang.String getMatchedDN()
Retrieves the matched DN for this LDAP exception.- Returns:
- The matched DN for this LDAP exception, or
nullif there is none.
-
getDiagnosticMessage
@Nullable public java.lang.String getDiagnosticMessage()
Retrieves the diagnostic message returned by the directory server.- Returns:
- The diagnostic message returned by the directory server, or
nullif there is none.
-
getReferralURLs
@NotNull public java.lang.String[] getReferralURLs()
Retrieves the set of referral URLs for this LDAP exception.- Returns:
- The set of referral URLs for this LDAP exception, or an empty array if there are none.
-
hasResponseControl
public boolean hasResponseControl()
Indicates whether this result contains at least one control.- Returns:
trueif this result contains at least one control, orfalseif not.
-
hasResponseControl
public boolean hasResponseControl(@NotNull java.lang.String oid)
Indicates whether this result contains at least one control with the specified OID.- Parameters:
oid- The object identifier for which to make the determination. It must not benull.- Returns:
trueif this result contains at least one control with the specified OID, orfalseif not.
-
getResponseControls
@NotNull public Control[] getResponseControls()
Retrieves the set of response controls for this LDAP exception.- Returns:
- The set of response controls for this LDAP exception, or an empty array if there are none.
-
getResponseControl
@Nullable public Control getResponseControl(@NotNull java.lang.String oid)
Retrieves the response control with the specified OID.- Parameters:
oid- The OID of the control to retrieve.- Returns:
- The response control with the specified OID, or
nullif there is no such control.
-
toLDAPResult
@NotNull public LDAPResult toLDAPResult()
Creates a newLDAPResultobject from this exception.- Returns:
- The
LDAPResultobject created from this exception.
-
toString
public void toString(@NotNull java.lang.StringBuilder buffer)
Appends a string representation of this exception to the provided buffer.- Overrides:
toStringin classLDAPSDKRuntimeException- Parameters:
buffer- The buffer to which the string representation of this exception is to be appended.
-
getExceptionMessage
@NotNull public java.lang.String getExceptionMessage()
Retrieves a string representation of this exception suitable for use in messages.- Overrides:
getExceptionMessagein classLDAPSDKRuntimeException- Returns:
- A string representation of this exception suitable for use in messages.
-
getExceptionMessage
@NotNull public java.lang.String getExceptionMessage(boolean includeStackTrace, boolean includeCause)
Retrieves a string representation of this exception suitable for use in messages.- Overrides:
getExceptionMessagein classLDAPSDKRuntimeException- Parameters:
includeStackTrace- Indicates whether to include information about the cause (if any) in the exception message.includeCause- Indicates whether to include a condensed representation of the stack trace in the exception message.- Returns:
- A string representation of this exception suitable for use in messages.
-
-