@Singleton public class DefaultLdapSearchService extends java.lang.Object implements LdapSearchService
LdapSearchService
.Constructor and Description |
---|
DefaultLdapSearchService() |
Modifier and Type | Method and Description |
---|---|
protected java.util.List<LdapSearchResult> |
createResults(javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> results)
Builds
LdapSearchResult from the LDAP results. |
java.util.List<LdapSearchResult> |
search(javax.naming.directory.DirContext managerContext,
SearchSettings settings)
Searches LDAP with th e given settings and returns a list of results.
|
java.util.Optional<LdapSearchResult> |
searchFirst(javax.naming.directory.DirContext managerContext,
SearchSettings settings)
Searches LDAP with the given settings and returns an optional result.
|
public java.util.Optional<LdapSearchResult> searchFirst(javax.naming.directory.DirContext managerContext, SearchSettings settings) throws javax.naming.NamingException
LdapSearchService
searchFirst
in interface LdapSearchService
managerContext
- The context to search withsettings
- The settings for searchingjavax.naming.NamingException
- If the search failspublic java.util.List<LdapSearchResult> search(javax.naming.directory.DirContext managerContext, SearchSettings settings) throws javax.naming.NamingException
LdapSearchService
search
in interface LdapSearchService
managerContext
- The context to search withsettings
- The settings for searchingjavax.naming.NamingException
- If the search failsprotected java.util.List<LdapSearchResult> createResults(javax.naming.NamingEnumeration<javax.naming.directory.SearchResult> results) throws javax.naming.NamingException
LdapSearchResult
from the LDAP results.results
- The LDAP resultsLdapSearchResult
javax.naming.NamingException
- If an error occurs