@Mutable @ThreadSafety(level=NOT_THREADSAFE) public final class BasicAsyncSearchResultListener extends java.lang.Object implements AsyncSearchResultListener
AsyncSearchResultListener
interface that will merely set the
result object to a local variable that can be accessed through a getter
method. It provides a listener that may be easily used when processing
an asynchronous search operation using the AsyncRequestID
as a
java.util.concurrent.Future
object.
AsyncSearchResultListener
implementation may be needed, or it may be
more appropriate to use an LDAPEntrySource
object for the search.Constructor and Description |
---|
BasicAsyncSearchResultListener()
Creates a new instance of this class for use in processing a single search
operation.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<SearchResultEntry> |
getSearchEntries()
Retrieves a list of the entries returned for the search operation.
|
java.util.List<SearchResultReference> |
getSearchReferences()
Retrieves a list of the references returned for the search operation.
|
SearchResult |
getSearchResult()
Retrieves the result that has been received for the associated asynchronous
search operation, if it has been received.
|
void |
searchEntryReturned(SearchResultEntry searchEntry)
Indicates that the provided search result entry has been returned by the
server and may be processed by this search result listener.
|
void |
searchReferenceReturned(SearchResultReference searchReference)
Indicates that the provided search result reference has been returned by
the server and may be processed by this search result listener.
|
void |
searchResultReceived(AsyncRequestID requestID,
SearchResult searchResult)
Indicates that the provided search result has been received in response to
an asynchronous search operation.
|
public BasicAsyncSearchResultListener()
@InternalUseOnly public void searchEntryReturned(@NotNull SearchResultEntry searchEntry)
searchEntryReturned
in interface SearchResultListener
searchEntry
- The search result entry that has been returned by the
server.@InternalUseOnly public void searchReferenceReturned(@NotNull SearchResultReference searchReference)
searchReferenceReturned
in interface SearchResultListener
searchReference
- The search result reference that has been returned
by the server.@InternalUseOnly public void searchResultReceived(@NotNull AsyncRequestID requestID, @NotNull SearchResult searchResult)
searchResultReceived
in interface AsyncSearchResultListener
requestID
- The async request ID of the request for which the
response was received.searchResult
- The search result that has been received.@Nullable public SearchResult getSearchResult()
null
if no response has been received
yet.@NotNull public java.util.List<SearchResultEntry> getSearchEntries()
null
search result object is available, because it may not be
safe to access the contents of the list if it may be altered while the
search is still in progress.@NotNull public java.util.List<SearchResultReference> getSearchReferences()
null
search result object is available, because it may not be
safe to access the contents of the list if it may be altered while the
search is still in progress.