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
NamingException
public boolean hasSingleResult() throws NamingException
NamingException
public String getSingleLdapName() throws NamingException
NamingException
if the search result doesn't contain exactly one entry.NamingException
public List<String> getAllLdapNamesAndAttributes() throws NamingException
NamingException
public void handle(SearchResultHandler.RecordProcessor processor) throws NamingException
processor
- SearchResultHandler.RecordProcessor
implementationNamingException
Copyright © 2017 The Apache Software Foundation. All rights reserved.