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.