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 Detail

      • searchFirst

        java.util.Optional<LdapSearchResult> searchFirst​(javax.naming.directory.DirContext managerContext,
                                                         SearchSettings settings)
                                                  throws javax.naming.NamingException
        Searches LDAP with the given settings and returns an optional result.
        Parameters:
        managerContext - The context to search with
        settings - The settings for searching
        Returns:
        An optional search result
        Throws:
        javax.naming.NamingException - If the search fails
      • search

        java.util.List<LdapSearchResult> search​(javax.naming.directory.DirContext managerContext,
                                                SearchSettings settings)
                                         throws javax.naming.NamingException
        Searches LDAP with th e given settings and returns a list of results.
        Parameters:
        managerContext - The context to search with
        settings - The settings for searching
        Returns:
        A list of results, empty if none found
        Throws:
        javax.naming.NamingException - If the search fails