Class DefaultLdapSearchService
java.lang.Object
io.micronaut.security.ldap.context.DefaultLdapSearchService
- All Implemented Interfaces:
LdapSearchService
Default implementation of
LdapSearchService
.- Since:
- 1.0
- Author:
- James Kleeh
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected List<LdapSearchResult>
createResults
(NamingEnumeration<SearchResult> results) BuildsLdapSearchResult
from the LDAP results.search
(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.
-
Constructor Details
-
DefaultLdapSearchService
public DefaultLdapSearchService()
-
-
Method Details
-
searchFirst
public Optional<LdapSearchResult> searchFirst(DirContext managerContext, SearchSettings settings) throws NamingException Description copied from interface:LdapSearchService
Searches LDAP with the given settings and returns an optional result.- Specified by:
searchFirst
in interfaceLdapSearchService
- Parameters:
managerContext
- The context to search withsettings
- The settings for searching- Returns:
- An optional search result
- Throws:
NamingException
- If the search fails
-
search
public List<LdapSearchResult> search(DirContext managerContext, SearchSettings settings) throws NamingException Description copied from interface:LdapSearchService
Searches LDAP with th e given settings and returns a list of results.- Specified by:
search
in interfaceLdapSearchService
- 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
-
createResults
protected List<LdapSearchResult> createResults(NamingEnumeration<SearchResult> results) throws NamingException BuildsLdapSearchResult
from the LDAP results.- Parameters:
results
- The LDAP results- Returns:
- The list of
LdapSearchResult
- Throws:
NamingException
- If an error occurs
-