Interface LdapClient.SearchSpec
- Enclosing interface:
LdapClient
public static interface LdapClient.SearchSpec
The specifications for the
LdapClient.search() request.- Since:
- 3.1
-
Method Summary
Modifier and TypeMethodDescriptiondefault <O extends LdapDataEntry>
List<O> list()Retrieve the result as a pre-resolved list of mapped objects, retaining the order from the original database result.default <T> LdapClient.MappedSearchSpec<T> map(AttributesMapper<T> mapper) Map each search result to an object using the givenAttributesMapperstrategy.default <T> LdapClient.MappedSearchSpec<T> map(ContextMapper<T> mapper) Map each search result to an object using the givenContextMapperstrategy.The name to search for.The name to search for.default <O extends LdapDataEntry>
Optional<O> optional()Retrieve a single search result, if available, as anOptionalhandle.query(Consumer<LdapQueryBuilder> consumer) The no-filter query to execute.The query to execute.default <O extends LdapDataEntry>
Osingle()Retrieve a single search result as a requiredLdapDataEntryinstance.default <O extends LdapDataEntry>
Stream<O> stream()Retrieve the result as a lazily resolved stream of mapped objects, retaining the order from the original database result.default <O extends LdapDataEntry>
@Nullable OtoEntry()Deprecated.default <O extends LdapDataEntry>
List<O> Deprecated.default <O extends LdapDataEntry>
Stream<O> Deprecated.<O> List<O> toList(AttributesMapper<O> mapper) Deprecated.<O> List<O> toList(ContextMapper<O> mapper) Deprecated.<O> @Nullable OtoObject(AttributesMapper<O> mapper) Deprecated.<O> @Nullable OtoObject(ContextMapper<O> mapper) Deprecated.<O> Stream<O> toStream(AttributesMapper<O> mapper) Deprecated.<O> Stream<O> toStream(ContextMapper<O> mapper) Deprecated.
-
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
-
single
Retrieve a single search result as a requiredLdapDataEntryinstance.- Returns:
- the single result object (never
null) - Since:
- 4.1
-
optional
Retrieve a single search result, if available, as anOptionalhandle.- Returns:
- an Optional handle with a single
LdapDataEntryresult or none - Since:
- 4.1
-
list
Retrieve the result as a pre-resolved list of mapped objects, retaining the order from the original database result.- Returns:
- the result as a detached List, containing mapped objects
- Since:
- 4.1
-
stream
Retrieve the result as a lazily resolved stream of mapped objects, retaining the order from the original database result.- Returns:
- the result Stream, containing mapped objects, needing to be closed once fully processed (for example, through a try-with-resources clause)
- Since:
- 4.1
-
map
Map each search result to an object using the givenContextMapperstrategy.- Parameters:
mapper- theContextMapperstrategy to use to map each result- Returns:
- a
LdapClient.MappedSearchSpecfor specifying the result cardinality - Since:
- 4.1
-
map
Map each search result to an object using the givenAttributesMapperstrategy.- Parameters:
mapper- theAttributesMapperstrategy to use to map each result- Returns:
- a
LdapClient.MappedSearchSpecfor specifying the result cardinality - Since:
- 4.1
-
toEntry
Deprecated. -
toObject
Deprecated.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
Deprecated.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
Deprecated. -
toList
Deprecated.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
Deprecated.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
Deprecated. -
toStream
Deprecated.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
Deprecated.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
-
map(AttributesMapper)withLdapClient.MappedSearchSpec.list()