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> O
toObject
(AttributesMapper<O> mapper) Expect at most one search result, mapped by the given strategy.<O> O
toObject
(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 anLdapQuery
based only on thename
.- 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 anLdapQuery
based only on thename
.- 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
-
toObject
Expect at most one search result, mapped by the given strategy.Returns
null
if no result is found.- Parameters:
mapper
- theContextMapper
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
Expect at most one search result, mapped by the given strategy.- Parameters:
mapper
- theAttributesMapper
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
-
toList
Return a list of search results, each mapped by the given strategy.- Parameters:
mapper
- theContextMapper
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
Return a list of search results, each mapped by the given strategy.- Parameters:
mapper
- theAttributesMapper
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
-
toStream
Return a stream of search results, each mapped by the given strategy.- Parameters:
mapper
- theContextMapper
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
Return a stream of search results, each mapped by the given strategy.- Parameters:
mapper
- theAttributesMapper
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
-