Skip to content

Add support to return a Java 8 Stream from LdapTemplate #586

@mp911de

Description

@mp911de

It would be great if LdapTemplate could bridge NamingEnumeration into a Java 8 Stream exposing the following methods:

Stream<T> find(LdapQuery query, Class<T> clazz);

Stream<T> find(LdapQuery query, ContextMapper<T> mapper);

This would be useful in the context of Spring Data to natively expose the LDAP result as stream without collecting results into a Collection. Since NamingEnumeration is closeable, the Stream needs to be closed after consumption but that is a regular requirement when used in other modules such as JdbcTemplate.queryForStream(…) or JPA stream queries.

#501 seems a related ticket.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions