public interface LDAPSearchResult
Modifier and Type | Method and Description |
---|---|
Iterator<LDAPEntry> |
entriesIterator()
Returns an iterator over the set of the matching entries for the search operation.
|
int |
getCount()
Returns the number of matching entries for the search operation.
|
LDAPEntry |
getEntry()
Returns the single matching entry returned for the search operation.
|
LDAPEntry |
getEntry(String dn)
Returns the matching entry with the specified DN from the set of entries for
the search operation.
|
LDAPEntry |
getFirstEntry()
Returns the first entry from the set of entries for the search operation.
|
int getCount()
LDAPEntry getEntry() throws LDAPException
Note that if the search result contains more than one entry, an LDAPException will be thrown. It is recommended to check the result count before making calls of this method. In case there will be more than one entry returned for the search operation, use entries iterator instead.
LDAPException
- if more than one entry returned for the search operation.LDAPEntry getEntry(String dn) throws LDAPException
dn
- the DN of the entry to retrieve from the set of matching entries
returned for the search operation. It must not be null.LDAPException
- if failed to parse the provided DN or a search entry DN.LDAPEntry getFirstEntry()
Note that this method was added for convenience and should be used with care,
only when the number / order of matching entries for the search operation is
irrelevant.
In other cases, use either getEntry()
for expected single matching
entry result or entriesIterator()
if more than one entry result expected.
getEntry()
,
entriesIterator()