Interface LdapClient.SearchSpec

Enclosing interface:
LdapClient

public static interface LdapClient.SearchSpec
The specifications for the LdapClient.search() request.
  • Method Details

    • name

      The name to search for. This is a convenience method for creating an LdapQuery based only on the name.
      Parameters:
      name - the name to search for
      Returns:
      the LdapClient.SearchSpec for further configuration
    • name

      The name to search for. This is a convenience method for creating an LdapQuery based only on the name.
      Parameters:
      name - the name to search for
      Returns:
      the LdapClient.SearchSpec for further configuration
    • query

      The no-filter query to execute. Or, that is, the filter is (objectclass=*).

      This is helpful when searching by name and needing to customize the SearchControls or the returned attribute set.

      Parameters:
      consumer - the consumer to alter a default query
      Returns:
      the LdapClient.SearchSpec for further configuration
    • query

      The query to execute.
      Parameters:
      query - the query to execute
      Returns:
      the LdapClient.SearchSpec for further configuration
    • toEntry

      default <O extends LdapDataEntry> O toEntry()
    • toObject

      <O> O toObject(ContextMapper<O> mapper)
      Expect at most one search result, mapped by the given strategy.

      Returns null if no result is found.

      Parameters:
      mapper - the ContextMapper strategy to use to map the result
      Returns:
      the single search result, or null if none was found
      Throws:
      org.springframework.dao.IncorrectResultSizeDataAccessException - if the result set contains more than one result
    • toObject

      <O> O toObject(AttributesMapper<O> mapper)
      Expect at most one search result, mapped by the given strategy.
      Parameters:
      mapper - the AttributesMapper strategy to use to map the result
      Returns:
      the single search result, or null if none was found
      Throws:
      org.springframework.dao.IncorrectResultSizeDataAccessException - if the result set contains more than one result
    • toEntryList

      default <O extends LdapDataEntry> List<O> toEntryList()
    • toList

      <O> List<O> toList(ContextMapper<O> mapper)
      Return a list of search results, each mapped by the given strategy.
      Parameters:
      mapper - the ContextMapper strategy to use to map the result
      Returns:
      the single search result, or empty list if none was found
      Throws:
      org.springframework.dao.IncorrectResultSizeDataAccessException - if the result set contains more than one result
    • toList

      <O> List<O> toList(AttributesMapper<O> mapper)
      Return a list of search results, each mapped by the given strategy.
      Parameters:
      mapper - the AttributesMapper strategy to use to map the result
      Returns:
      the single search result, or empty list if none was found
      Throws:
      org.springframework.dao.IncorrectResultSizeDataAccessException - if the result set contains more than one result
    • toEntryStream

      default <O extends LdapDataEntry> Stream<O> toEntryStream()
    • toStream

      <O> Stream<O> toStream(ContextMapper<O> mapper)
      Return a stream of search results, each mapped by the given strategy.
      Parameters:
      mapper - the ContextMapper strategy to use to map the result
      Returns:
      the single search result, or empty stream if none was found
      Throws:
      org.springframework.dao.IncorrectResultSizeDataAccessException - if the result set contains more than one result
    • toStream

      <O> Stream<O> toStream(AttributesMapper<O> mapper)
      Return a stream of search results, each mapped by the given strategy.
      Parameters:
      mapper - the AttributesMapper strategy to use to map the result
      Returns:
      the single search result, or empty stream if none was found
      Throws:
      org.springframework.dao.IncorrectResultSizeDataAccessException - if the result set contains more than one result