Package edu.vt.middleware.ldap.handler
Class MergeSearchResultHandler
- java.lang.Object
-
- edu.vt.middleware.ldap.handler.AbstractResultHandler<T,T>
-
- edu.vt.middleware.ldap.handler.CopyResultHandler<javax.naming.directory.SearchResult>
-
- edu.vt.middleware.ldap.handler.CopySearchResultHandler
-
- edu.vt.middleware.ldap.handler.MergeSearchResultHandler
-
- All Implemented Interfaces:
ResultHandler<javax.naming.directory.SearchResult,javax.naming.directory.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-24 00:10:53 +0200 (Mon, 24 May 2010) $
- Author:
- Middleware Services
-
-
Field Summary
-
Fields inherited from class edu.vt.middleware.ldap.handler.AbstractResultHandler
logger
-
-
Constructor Summary
Constructors Constructor Description MergeSearchResultHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getAllowDuplicates()
Returns whether to allow duplicate attribute values.protected java.util.List<javax.naming.directory.SearchResult>
mergeResults(java.util.List<javax.naming.directory.SearchResult> results)
Merges the search results in the supplied list into a single search result.java.util.List<javax.naming.directory.SearchResult>
process(SearchCriteria sc, java.util.List<? extends javax.naming.directory.SearchResult> l)
This will enumerate through the suppliedList
and return a List of those results.java.util.List<javax.naming.directory.SearchResult>
process(SearchCriteria sc, javax.naming.NamingEnumeration<? extends javax.naming.directory.SearchResult> en, java.lang.Class<?>[] ignore)
This will enumerate through the suppliedNamingEnumeration
and return a List of those results.void
setAllowDuplicates(boolean b)
Sets whether to allow duplicate attribute values.-
Methods inherited from class edu.vt.middleware.ldap.handler.CopySearchResultHandler
getAttributeHandler, processAttributes, processDn, processResult, setAttributeHandler
-
Methods inherited from class edu.vt.middleware.ldap.handler.AbstractResultHandler
process
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.vt.middleware.ldap.handler.ResultHandler
process
-
-
-
-
Method Detail
-
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 java.util.List<javax.naming.directory.SearchResult> process(SearchCriteria sc, javax.naming.NamingEnumeration<? extends javax.naming.directory.SearchResult> en, java.lang.Class<?>[] ignore) throws javax.naming.NamingException
This will enumerate through the suppliedNamingEnumeration
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 interfaceResultHandler<javax.naming.directory.SearchResult,javax.naming.directory.SearchResult>
- Overrides:
process
in classAbstractResultHandler<javax.naming.directory.SearchResult,javax.naming.directory.SearchResult>
- Parameters:
sc
-SearchCriteria
used to find enumerationen
-NamingEnumeration
LDAP resultsignore
-Class[]
of exception types to ignore- Returns:
List
- LDAP results- Throws:
javax.naming.NamingException
- if the LDAP returns an error
-
process
public java.util.List<javax.naming.directory.SearchResult> process(SearchCriteria sc, java.util.List<? extends javax.naming.directory.SearchResult> l) throws javax.naming.NamingException
This will enumerate through the suppliedList
and return a List of those results. The results are unaltered and the dn is ignored.- Specified by:
process
in interfaceResultHandler<javax.naming.directory.SearchResult,javax.naming.directory.SearchResult>
- Overrides:
process
in classAbstractResultHandler<javax.naming.directory.SearchResult,javax.naming.directory.SearchResult>
- Parameters:
sc
-SearchCriteria
used to find enumerationl
-List
LDAP results- Returns:
List
- LDAP results- Throws:
javax.naming.NamingException
- if the LDAP returns an error
-
mergeResults
protected java.util.List<javax.naming.directory.SearchResult> mergeResults(java.util.List<javax.naming.directory.SearchResult> results) throws javax.naming.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:
javax.naming.NamingException
- if an error occurs reading attribute values
-
-