org.ldaptive.servlets
Class AbstractServletSearchExecutor

java.lang.Object
  extended by org.ldaptive.servlets.AbstractServletSearchExecutor
All Implemented Interfaces:
ServletSearchExecutor
Direct Known Subclasses:
AttributeValueServletSearchExecutor, Dsmlv1ServletSearchExecutor, LdifServletSearchExecutor

public abstract class AbstractServletSearchExecutor
extends Object
implements ServletSearchExecutor

Uses PooledConnectionFactory and SearchExecutor to perform search operations. These objects are configured from properties found in the servlet configuration.

Version:
$Revision: 2885 $ $Date: 2014-02-05 16:28:49 -0500 (Wed, 05 Feb 2014) $
Author:
Middleware Services

Field Summary
protected  org.slf4j.Logger logger
          Logger for this class.
 
Constructor Summary
AbstractServletSearchExecutor()
           
 
Method Summary
 void close()
          Closes any resources associated with this servlet search executor.
protected static Properties createProperties(javax.servlet.ServletConfig config)
          Returns context specific properties based on the supplied JAAS options.
 void initialize(javax.servlet.ServletConfig config)
          Prepares this servlet search executor for use.
 void search(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Reads parameters from the request, performs an ldap search, and writes the result to the response.
protected abstract  void writeResponse(SearchResult result, javax.servlet.http.HttpServletResponse response)
          Writes the supplied search result to the servlet response output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger
Logger for this class.

Constructor Detail

AbstractServletSearchExecutor

public AbstractServletSearchExecutor()
Method Detail

initialize

public void initialize(javax.servlet.ServletConfig config)
Prepares this servlet search executor for use.

Specified by:
initialize in interface ServletSearchExecutor
Parameters:
config - to initialize this object with

createProperties

protected static Properties createProperties(javax.servlet.ServletConfig config)
Returns context specific properties based on the supplied JAAS options.

Parameters:
config - to read properties from
Returns:
properties

search

public void search(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws LdapException,
                   IOException
Reads parameters from the request, performs an ldap search, and writes the result to the response.

Specified by:
search in interface ServletSearchExecutor
Parameters:
request - servlet request to read search parameters from
response - servlet response to write ldap search result to
Throws:
LdapException - if an error occurs performing the search
IOException - if an error occurs writing to the response

writeResponse

protected abstract void writeResponse(SearchResult result,
                                      javax.servlet.http.HttpServletResponse response)
                               throws IOException
Writes the supplied search result to the servlet response output stream.

Parameters:
result - search result to write
response - to write to
Throws:
IOException - if an error occurs writing to the response

close

public void close()
Closes any resources associated with this servlet search executor.

Specified by:
close in interface ServletSearchExecutor


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