Interface LdapSearchService
- All Known Implementing Classes:
DefaultLdapSearchService
public interface LdapSearchService
Contract for searching LDAP using an existing context.
- Since:
- 1.0
- Author:
- James Kleeh
-
Method Summary
Modifier and TypeMethodDescriptionsearch
(DirContext managerContext, SearchSettings settings) Searches LDAP with th e given settings and returns a list of results.searchFirst
(DirContext managerContext, SearchSettings settings) Searches LDAP with the given settings and returns an optional result.
-
Method Details
-
searchFirst
Optional<LdapSearchResult> searchFirst(DirContext managerContext, SearchSettings settings) throws NamingException Searches LDAP with the given settings and returns an optional result.- Parameters:
managerContext
- The context to search withsettings
- The settings for searching- Returns:
- An optional search result
- Throws:
NamingException
- If the search fails
-
search
List<LdapSearchResult> search(DirContext managerContext, SearchSettings settings) throws NamingException Searches LDAP with th e given settings and returns a list of results.- Parameters:
managerContext
- The context to search withsettings
- The settings for searching- Returns:
- A list of results, empty if none found
- Throws:
NamingException
- If the search fails
-