public final class SearchResultHandler extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
SearchResultHandler.RecordProcessor
An interface used by
SearchResultHandler for processing records of
a SearchResult on a per-record basis. |
| Constructor and Description |
|---|
SearchResultHandler(Collection<NamingEnumeration<SearchResult>> searchResults)
Constructs a search result handler object for the provided search results.
|
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getAllLdapNames()
Returns all entries from the search result.
|
List<String> |
getAllLdapNamesAndAttributes()
Returns all entries and all attributes for these entries.
|
String |
getSingleLdapName()
Returns a single entry from the search result.
|
void |
handle(SearchResultHandler.RecordProcessor processor)
Allows for custom processing of the search results.
|
boolean |
hasSingleResult()
Checks whether search result contains exactly one entry.
|
public SearchResultHandler(Collection<NamingEnumeration<SearchResult>> searchResults)
searchResults - directory service search resultspublic List<String> getAllLdapNames() throws NamingException
NamingExceptionpublic boolean hasSingleResult()
throws NamingException
NamingExceptionpublic String getSingleLdapName() throws NamingException
NamingException if the search result doesn't contain exactly one entry.NamingExceptionpublic List<String> getAllLdapNamesAndAttributes() throws NamingException
NamingExceptionpublic void handle(SearchResultHandler.RecordProcessor processor) throws NamingException
processor - SearchResultHandler.RecordProcessor implementationNamingExceptionCopyright © 2019 The Apache Software Foundation. All Rights Reserved.