edu.vt.middleware.ldap.handler
Class CopySearchResultHandler

java.lang.Object
  extended by edu.vt.middleware.ldap.handler.AbstractResultHandler<T,T>
      extended by edu.vt.middleware.ldap.handler.CopyResultHandler<SearchResult>
          extended by edu.vt.middleware.ldap.handler.CopySearchResultHandler
All Implemented Interfaces:
ResultHandler<SearchResult,SearchResult>, SearchResultHandler
Direct Known Subclasses:
BinarySearchResultHandler, CaseChangeSearchResultHandler, EntryDnSearchResultHandler, FqdnSearchResultHandler, MergeSearchResultHandler, RecursiveSearchResultHandler

public class CopySearchResultHandler
extends CopyResultHandler<SearchResult>
implements SearchResultHandler

CopySearchResultHandler converts a NamingEnumeration of search results into a List of search results.

Version:
$Revision: 1786 $ $Date: 2011-01-05 09:45:07 -0500 (Wed, 05 Jan 2011) $
Author:
Middleware Services

Field Summary
 
Fields inherited from class edu.vt.middleware.ldap.handler.AbstractResultHandler
logger
 
Constructor Summary
CopySearchResultHandler()
           
 
Method Summary
 AttributeHandler[] getAttributeHandler()
          Gets the attribute handlers.
protected  Attributes processAttributes(SearchCriteria sc, SearchResult sr)
          Process the attributes of an ldap search.
protected  String processDn(SearchCriteria sc, SearchResult sr)
          Process the dn of an ldap search result.
protected  SearchResult processResult(SearchCriteria sc, SearchResult sr)
          This will return a deep copy of the supplied SearchResult.
 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
 

Constructor Detail

CopySearchResultHandler

public CopySearchResultHandler()
Method Detail

getAttributeHandler

public AttributeHandler[] getAttributeHandler()
Gets the attribute handlers.

Specified by:
getAttributeHandler in interface SearchResultHandler
Returns:
AttributeHandler[]

setAttributeHandler

public void setAttributeHandler(AttributeHandler[] ah)
Sets the attribute handlers.

Specified by:
setAttributeHandler in interface SearchResultHandler
Parameters:
ah - AttributeHandler[]

processResult

protected SearchResult processResult(SearchCriteria sc,
                                     SearchResult sr)
                              throws NamingException
This will return a deep copy of the supplied SearchResult.

Overrides:
processResult in class CopyResultHandler<SearchResult>
Parameters:
sc - SearchCriteria used to find enumeration
sr - SearchResult to copy
Returns:
SearchResult
Throws:
NamingException - if the result cannot be read

processDn

protected String processDn(SearchCriteria sc,
                           SearchResult sr)
Process the dn of an ldap search result.

Parameters:
sc - SearchCriteria used to find search result
sr - SearchResult to extract the dn from
Returns:
String processed dn

processAttributes

protected Attributes processAttributes(SearchCriteria sc,
                                       SearchResult sr)
                                throws NamingException
Process the attributes of an ldap search.

Parameters:
sc - SearchCriteria used to find search result
sr - SearchResult to extract the attributes from
Returns:
Attributes processed attributes
Throws:
NamingException - if the LDAP returns an error


Copyright © 2003-2010 Virginia Tech. All Rights Reserved.