Package com.unboundid.ldap.sdk
Class LDAPSearchException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.unboundid.util.LDAPSDKException
com.unboundid.ldap.sdk.LDAPException
com.unboundid.ldap.sdk.LDAPSearchException
- All Implemented Interfaces:
Serializable
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class LDAPSearchException
extends LDAPException
This class defines an exception that can be thrown if a problem occurs while
performing LDAP-related processing. It includes all of the elements of the
SearchResult object, potentially including entries and references
returned before the failure result.- See Also:
-
Field Summary
Fields inherited from class com.unboundid.ldap.sdk.LDAPException
NO_CONTROLS, NO_REFERRALS -
Constructor Summary
ConstructorsConstructorDescriptionLDAPSearchException(LDAPException ldapException) Creates a new LDAP search exception from the provided exception.LDAPSearchException(ResultCode resultCode, String errorMessage) Creates a new LDAP search exception with the provided information.LDAPSearchException(ResultCode resultCode, String errorMessage, Throwable cause) Creates a new LDAP search exception with the provided information.LDAPSearchException(SearchResult searchResult) Creates a new LDAP search exception with the provided result. -
Method Summary
Modifier and TypeMethodDescriptionintRetrieves the number of matching entries returned for the search operation before this exception was thrown.intRetrieves the number of search references returned for the search operation before this exception was thrown.Retrieves a list containing the matching entries returned from the search operation before this exception was thrown.Retrieves a list containing the search references returned from the search operation before this exception was thrown.Retrieves the search result object associated with this LDAP search exception.Creates a newSearchResultobject from this exception.voidtoString(StringBuilder buffer) Appends a string representation of this LDAP exception to the provided buffer.voidtoString(StringBuilder buffer, boolean includeCause, boolean includeStackTrace) Appends a string representation of thisLDAPExceptionto the provided buffer.Methods inherited from class com.unboundid.ldap.sdk.LDAPException
getDiagnosticMessage, getExceptionMessage, getExceptionMessage, getMatchedDN, getReferralURLs, getResponseControl, getResponseControls, getResultCode, getResultString, hasResponseControl, hasResponseControlMethods inherited from class com.unboundid.util.LDAPSDKException
toStringMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
LDAPSearchException
Creates a new LDAP search exception with the provided information.- Parameters:
resultCode- The result code for this LDAP search exception.errorMessage- The error message for this LDAP search exception.
-
LDAPSearchException
public LDAPSearchException(@NotNull ResultCode resultCode, @NotNull String errorMessage, @Nullable Throwable cause) Creates a new LDAP search exception with the provided information.- Parameters:
resultCode- The result code for this LDAP search exception.errorMessage- The error message for this LDAP search exception.cause- The underlying exception that triggered this LDAP search exception.
-
LDAPSearchException
Creates a new LDAP search exception from the provided exception.- Parameters:
ldapException- The LDAP exception with the information to include in this LDAP search exception.
-
LDAPSearchException
Creates a new LDAP search exception with the provided result.- Parameters:
searchResult- The search result to use to create this LDAP search exception.
-
-
Method Details
-
getSearchResult
Retrieves the search result object associated with this LDAP search exception.- Returns:
- The search result object associated with this LDAP search exception.
-
getEntryCount
Retrieves the number of matching entries returned for the search operation before this exception was thrown.- Returns:
- The number of matching entries returned for the search operation before this exception was thrown.
-
getReferenceCount
Retrieves the number of search references returned for the search operation before this exception was thrown.- Returns:
- The number of search references returned for the search operation before this exception was thrown.
-
getSearchEntries
Retrieves a list containing the matching entries returned from the search operation before this exception was thrown. This will only be available if aSearchResultListenerwas not used during the search.- Returns:
- A list containing the matching entries returned from the search
operation before this exception was thrown, or
nullif aSearchResultListenerwas used during the search.
-
getSearchReferences
Retrieves a list containing the search references returned from the search operation before this exception was thrown. This will only be available if aSearchResultListenerwas not used during the search.- Returns:
- A list containing the search references returned from the search
operation before this exception was thrown, or
nullif aSearchResultListenerwas used during the search.
-
toLDAPResult
Creates a newSearchResultobject from this exception.- Overrides:
toLDAPResultin classLDAPException- Returns:
- The
SearchResultobject created from this exception.
-
toString
Appends a string representation of this LDAP exception to the provided buffer.- Overrides:
toStringin classLDAPException- Parameters:
buffer- The buffer to which to append a string representation of this LDAP exception.
-
toString
public void toString(@NotNull StringBuilder buffer, boolean includeCause, boolean includeStackTrace) Appends a string representation of thisLDAPExceptionto the provided buffer.- Overrides:
toStringin classLDAPException- Parameters:
buffer- The buffer to which the information should be appended. This must not benull.includeCause- Indicates whether to include information about the cause (if any) in the exception message.includeStackTrace- Indicates whether to include a condensed representation of the stack trace in the exception message. If a stack trace is included, then the cause (if any) will automatically be included, regardless of the value of theincludeCauseargument.
-