net.sf.ldaptemplate
Class CollectingSearchResultCallbackHandler

java.lang.Object
  extended bynet.sf.ldaptemplate.CollectingSearchResultCallbackHandler
All Implemented Interfaces:
SearchResultCallbackHandler
Direct Known Subclasses:
LdapTemplate.AttributesMapperCallbackHandler, LdapTemplate.ContextMapperCallbackHandler

public abstract class CollectingSearchResultCallbackHandler
extends java.lang.Object
implements SearchResultCallbackHandler

A SearchResultCallbackHandler to collect all results in an internal List. Useful in combination with e.g. an AttributesMapper or ContextMapper.

Author:
Mattias Arthursson
See Also:
LdapTemplate, LdapTemplate.AttributesMapperCallbackHandler, LdapTemplate.ContextMapperCallbackHandler

Constructor Summary
CollectingSearchResultCallbackHandler()
           
 
Method Summary
 java.util.List getList()
          Get the assembled list.
protected abstract  java.lang.Object getObjectFromResult(javax.naming.directory.SearchResult searchResult)
          Handle a single search result and transform it to an Object.
 void handleSearchResult(javax.naming.directory.SearchResult searchResult)
          Handle this entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectingSearchResultCallbackHandler

public CollectingSearchResultCallbackHandler()
Method Detail

handleSearchResult

public void handleSearchResult(javax.naming.directory.SearchResult searchResult)
Description copied from interface: SearchResultCallbackHandler
Handle this entry. This method will be called once for each entry returned by a search or list.

Specified by:
handleSearchResult in interface SearchResultCallbackHandler
Parameters:
searchResult - the searchResult.

getObjectFromResult

protected abstract java.lang.Object getObjectFromResult(javax.naming.directory.SearchResult searchResult)
Handle a single search result and transform it to an Object.

Parameters:
searchResult - a SearchResult from a search operation.
Returns:
an object constructed from the data in the SearchResult.

getList

public java.util.List getList()
Get the assembled list.

Returns:
the list of all assembled objects.


Copyright © 2006 Jayway AB. All Rights Reserved.