Class 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 java.lang.Object
    implements ResultHandler<R,​O>
    AbstractResultHandler implements common handler functionality.
    Version:
    $Revision: 1330 $ $Date: 2010-05-24 00:10:53 +0200 (Mon, 24 May 2010) $
    Author:
    Middleware Services
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.apache.commons.logging.Log logger
      Log for this class.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<O> process​(SearchCriteria sc, java.util.List<? extends R> l)
      This will enumerate through the supplied List and return a List of those results.
      java.util.List<O> process​(SearchCriteria sc, javax.naming.NamingEnumeration<? extends R> en)
      This will enumerate through the supplied NamingEnumeration and return a List of those results.
      java.util.List<O> process​(SearchCriteria sc, javax.naming.NamingEnumeration<? extends R> en, java.lang.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 java.util.List<O> process​(SearchCriteria sc,
                                         javax.naming.NamingEnumeration<? extends R> en)
                                  throws javax.naming.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:
        javax.naming.NamingException - if the LDAP returns an error
      • process

        public java.util.List<O> process​(SearchCriteria sc,
                                         javax.naming.NamingEnumeration<? extends R> en,
                                         java.lang.Class<?>[] ignore)
                                  throws javax.naming.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:
        javax.naming.NamingException - if the LDAP returns an error
      • process

        public java.util.List<O> process​(SearchCriteria sc,
                                         java.util.List<? extends R> l)
                                  throws javax.naming.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:
        javax.naming.NamingException - if the LDAP returns an error
      • processResult

        protected abstract O processResult​(SearchCriteria sc,
                                           R r)
                                    throws javax.naming.NamingException
        Processes the supplied result.
        Parameters:
        sc - SearchCriteria used to retrieve the result
        r - R result to process
        Returns:
        O processed result
        Throws:
        javax.naming.NamingException - if the supplied result cannot be read