Package org.springframework.ldap.core
Interface LdapClient.SearchSpec
- Enclosing interface:
- LdapClient
public static interface LdapClient.SearchSpec
The specifications for the
LdapClient.search() request.-
Method Summary
Modifier and TypeMethodDescriptionThe name to search for.The name to search for.query(Consumer<LdapQueryBuilder> consumer) The no-filter query to execute.The query to execute.default <O extends LdapDataEntry>
OtoEntry()default <O extends LdapDataEntry>
List<O>default <O extends LdapDataEntry>
Stream<O><O> List<O>toList(AttributesMapper<O> mapper) Return a list of search results, each mapped by the given strategy.<O> List<O>toList(ContextMapper<O> mapper) Return a list of search results, each mapped by the given strategy.<O> OtoObject(AttributesMapper<O> mapper) Expect at most one search result, mapped by the given strategy.<O> OtoObject(ContextMapper<O> mapper) Expect at most one search result, mapped by the given strategy.<O> Stream<O>toStream(AttributesMapper<O> mapper) Return a stream of search results, each mapped by the given strategy.<O> Stream<O>toStream(ContextMapper<O> mapper) Return a stream of search results, each mapped by the given strategy.
-
Method Details
-
name
The name to search for. This is a convenience method for creating anLdapQuerybased only on thename.- Parameters:
name- the name to search for- Returns:
- the
LdapClient.SearchSpecfor further configuration
-
name
The name to search for. This is a convenience method for creating anLdapQuerybased only on thename.- Parameters:
name- the name to search for- Returns:
- the
LdapClient.SearchSpecfor 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
SearchControlsor the returned attribute set.- Parameters:
consumer- the consumer to alter a default query- Returns:
- the
LdapClient.SearchSpecfor further configuration
-
query
The query to execute.- Parameters:
query- the query to execute- Returns:
- the
LdapClient.SearchSpecfor further configuration
-
toEntry
-
toObject
Expect at most one search result, mapped by the given strategy.Returns
nullif no result is found.- Parameters:
mapper- theContextMapperstrategy to use to map the result- Returns:
- the single search result, or
nullif none was found - Throws:
org.springframework.dao.IncorrectResultSizeDataAccessException- if the result set contains more than one result
-
toObject
Expect at most one search result, mapped by the given strategy.- Parameters:
mapper- theAttributesMapperstrategy to use to map the result- Returns:
- the single search result, or
nullif none was found - Throws:
org.springframework.dao.IncorrectResultSizeDataAccessException- if the result set contains more than one result
-
toEntryList
-
toList
Return a list of search results, each mapped by the given strategy.- Parameters:
mapper- theContextMapperstrategy 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
Return a list of search results, each mapped by the given strategy.- Parameters:
mapper- theAttributesMapperstrategy 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
-
toStream
Return a stream of search results, each mapped by the given strategy.- Parameters:
mapper- theContextMapperstrategy 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
Return a stream of search results, each mapped by the given strategy.- Parameters:
mapper- theAttributesMapperstrategy 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
-