Package edu.vt.middleware.ldap.handler
Class CopySearchResultHandler
- 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
-
- All Implemented Interfaces:
ResultHandler<javax.naming.directory.SearchResult,javax.naming.directory.SearchResult>
,SearchResultHandler
- Direct Known Subclasses:
BinarySearchResultHandler
,CaseChangeSearchResultHandler
,EntryDnSearchResultHandler
,FqdnSearchResultHandler
,MergeSearchResultHandler
,RecursiveSearchResultHandler
public class CopySearchResultHandler extends CopyResultHandler<javax.naming.directory.SearchResult> implements SearchResultHandler
CopySearchResultHandler
converts a NamingEnumeration of search results into a List of search results.- Version:
- $Revision: 1786 $ $Date: 2011-01-05 15:45:07 +0100 (Wed, 05 Jan 2011) $
- Author:
- Middleware Services
-
-
Field Summary
-
Fields inherited from class edu.vt.middleware.ldap.handler.AbstractResultHandler
logger
-
-
Constructor Summary
Constructors Constructor Description CopySearchResultHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AttributeHandler[]
getAttributeHandler()
Gets the attribute handlers.protected javax.naming.directory.Attributes
processAttributes(SearchCriteria sc, javax.naming.directory.SearchResult sr)
Process the attributes of an ldap search.protected java.lang.String
processDn(SearchCriteria sc, javax.naming.directory.SearchResult sr)
Process the dn of an ldap search result.protected javax.naming.directory.SearchResult
processResult(SearchCriteria sc, javax.naming.directory.SearchResult sr)
This will return a deep copy of the suppliedSearchResult
.void
setAttributeHandler(AttributeHandler[] ah)
Sets the attribute handlers.-
Methods inherited from class edu.vt.middleware.ldap.handler.AbstractResultHandler
process, process, 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, process, process
-
-
-
-
Method Detail
-
getAttributeHandler
public AttributeHandler[] getAttributeHandler()
Gets the attribute handlers.- Specified by:
getAttributeHandler
in interfaceSearchResultHandler
- Returns:
AttributeHandler[]
-
setAttributeHandler
public void setAttributeHandler(AttributeHandler[] ah)
Sets the attribute handlers.- Specified by:
setAttributeHandler
in interfaceSearchResultHandler
- Parameters:
ah
-AttributeHandler[]
-
processResult
protected javax.naming.directory.SearchResult processResult(SearchCriteria sc, javax.naming.directory.SearchResult sr) throws javax.naming.NamingException
This will return a deep copy of the suppliedSearchResult
.- Overrides:
processResult
in classCopyResultHandler<javax.naming.directory.SearchResult>
- Parameters:
sc
-SearchCriteria
used to find enumerationsr
-SearchResult
to copy- Returns:
SearchResult
- Throws:
javax.naming.NamingException
- if the result cannot be read
-
processDn
protected java.lang.String processDn(SearchCriteria sc, javax.naming.directory.SearchResult sr)
Process the dn of an ldap search result.- Parameters:
sc
-SearchCriteria
used to find search resultsr
-SearchResult
to extract the dn from- Returns:
String
processed dn
-
processAttributes
protected javax.naming.directory.Attributes processAttributes(SearchCriteria sc, javax.naming.directory.SearchResult sr) throws javax.naming.NamingException
Process the attributes of an ldap search.- Parameters:
sc
-SearchCriteria
used to find search resultsr
-SearchResult
to extract the attributes from- Returns:
Attributes
processed attributes- Throws:
javax.naming.NamingException
- if the LDAP returns an error
-
-