To be able to sustain (very) large LDAP trees for security mapping and synchronisation the LDAP searches need to be possibly paged and processed from a callback handler instead of of loading (and mapping) all results upfront.
Spring LDAP (1.3.0) does provide basic support for using a LDAP PagedResultsControl and callback handlers, which is what we will leverage here through a new PagedSearchExecutor component.
The standard Spring LDAP callback handling though does not support "aborting" or stopping search processing, nor does it provide access to the current search/paging processing state.
A more specialised (and Generics supporting) SearchResultHandler interface and default (base) implementations will be provided instead which also is LDAP independent, e.g. also usable for other type of (mapping) back-ends like JCR.
Note: to be able to use/set LDAP DirContext PagedResultsControl a Spring MutablePoolingContextSource is now required instead of plain PoolingContextSource.