edu.vt.middleware.ldap.handler
Class MergeSearchResultHandler
java.lang.Object
edu.vt.middleware.ldap.handler.AbstractResultHandler<T,T>
edu.vt.middleware.ldap.handler.CopyResultHandler<SearchResult>
edu.vt.middleware.ldap.handler.CopySearchResultHandler
edu.vt.middleware.ldap.handler.MergeSearchResultHandler
- All Implemented Interfaces:
- ResultHandler<SearchResult,SearchResult>, SearchResultHandler
public class MergeSearchResultHandler
- extends CopySearchResultHandler
MergeSearchResultHandler merges the attributes found in each
search result into the first search result.
- Version:
- $Revision: 1330 $ $Date: 2010-05-23 18:10:53 -0400 (Sun, 23 May 2010) $
- Author:
- Middleware Services
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MergeSearchResultHandler
public MergeSearchResultHandler()
getAllowDuplicates
public boolean getAllowDuplicates()
- Returns whether to allow duplicate attribute values.
- Returns:
boolean
setAllowDuplicates
public void setAllowDuplicates(boolean b)
- Sets whether to allow duplicate attribute values.
- Parameters:
b - boolean
process
public List<SearchResult> process(SearchCriteria sc,
NamingEnumeration<? extends SearchResult> en,
Class<?>[] ignore)
throws NamingException
- This will enumerate through the supplied
NamingEnumeration and
return a List of those results. The results are unaltered and the dn is
ignored. Any exceptions passed into this method will be ignored and results
will be returned as if no exception occurred.
- Specified by:
process in interface ResultHandler<SearchResult,SearchResult>- Overrides:
process in class AbstractResultHandler<SearchResult,SearchResult>
- Parameters:
sc - SearchCriteria used to find enumerationen - NamingEnumeration LDAP resultsignore - Class[] of exception types to ignore
- Returns:
List - LDAP results
- Throws:
NamingException - if the LDAP returns an error
process
public List<SearchResult> process(SearchCriteria sc,
List<? extends SearchResult> l)
throws NamingException
- This will enumerate through the supplied
List and return a
List of those results. The results are unaltered and the dn is ignored.
- Specified by:
process in interface ResultHandler<SearchResult,SearchResult>- Overrides:
process in class AbstractResultHandler<SearchResult,SearchResult>
- Parameters:
sc - SearchCriteria used to find enumerationl - List LDAP results
- Returns:
List - LDAP results
- Throws:
NamingException - if the LDAP returns an error
mergeResults
protected List<SearchResult> mergeResults(List<SearchResult> results)
throws NamingException
- Merges the search results in the supplied list into a single search result.
This method always returns a list of size zero or one.
- Parameters:
results - List of search results to merge
- Returns:
List of merged search results
- Throws:
NamingException - if an error occurs reading attribute values
Copyright © 2003-2010 Virginia Tech. All Rights Reserved.