edu.vt.middleware.ldap.handler
Class AbstractResultHandler<R,O>

java.lang.Object
  extended by edu.vt.middleware.ldap.handler.AbstractResultHandler<R,O>
Type Parameters:
R - type of result
O - type of output
All Implemented Interfaces:
ResultHandler<R,O>
Direct Known Subclasses:
CopyResultHandler

public abstract class AbstractResultHandler<R,O>
extends Object
implements ResultHandler<R,O>

AbstractResultHandler implements common handler functionality.

Version:
$Revision: 1330 $ $Date: 2010-05-23 18:10:53 -0400 (Sun, 23 May 2010) $
Author:
Middleware Services

Field Summary
protected  org.apache.commons.logging.Log logger
          Log for this class.
 
Constructor Summary
AbstractResultHandler()
           
 
Method Summary
 List<O> process(SearchCriteria sc, List<? extends R> l)
          This will enumerate through the supplied List and return a List of those results.
 List<O> process(SearchCriteria sc, NamingEnumeration<? extends R> en)
          This will enumerate through the supplied NamingEnumeration and return a List of those results.
 List<O> process(SearchCriteria sc, NamingEnumeration<? extends R> en, Class<?>[] ignore)
          This will enumerate through the supplied NamingEnumeration and return a List of those results.
protected abstract  O processResult(SearchCriteria sc, R r)
          Processes the supplied result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Log for this class.

Constructor Detail

AbstractResultHandler

public AbstractResultHandler()
Method Detail

process

public List<O> process(SearchCriteria sc,
                       NamingEnumeration<? extends R> en)
                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.

Specified by:
process in interface ResultHandler<R,O>
Parameters:
sc - SearchCriteria used to find enumeration
en - NamingEnumeration LDAP results
Returns:
List - LDAP results
Throws:
NamingException - if the LDAP returns an error

process

public List<O> process(SearchCriteria sc,
                       NamingEnumeration<? extends R> 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<R,O>
Parameters:
sc - SearchCriteria used to find enumeration
en - NamingEnumeration LDAP results
ignore - Class[] of exception types to ignore
Returns:
List - LDAP results
Throws:
NamingException - if the LDAP returns an error

process

public List<O> process(SearchCriteria sc,
                       List<? extends R> 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<R,O>
Parameters:
sc - SearchCriteria used to find enumeration
l - List LDAP results
Returns:
List - LDAP results
Throws:
NamingException - if the LDAP returns an error

processResult

protected abstract O processResult(SearchCriteria sc,
                                   R r)
                            throws NamingException
Processes the supplied result.

Parameters:
sc - SearchCriteria used to retrieve the result
r - R result to process
Returns:
O processed result
Throws:
NamingException - if the supplied result cannot be read


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