edu.ucsb.adl.middleware
Class CacheControlServlet

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--edu.ucsb.adl.middleware.CacheControlServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public final class CacheControlServlet
extends javax.servlet.http.HttpServlet

Servlet to manage metadata caches. The servlet is invoked by an HTTP GET request containing three URL-encoded parameters: op, the operation to perform, which must be "empty" (empties a cache), "preload" (starts a background thread to preload a cache), or "stop" (stops a preload thread); collection, the name of a collection; and view, the name of a metadata view that is configured to be cached by the collection. If "*" is specified for the view, all of the collection's caches are operated on.

If the URL of this servlet is S, then an example of a complete URL might be:

S?op=preload&collection=adl_catalog&view=adl:bucket
The successful HTTP status code is 200 (OK). Error status codes include 400 (bad request) and 500 (internal server error).

Version:
$Header: /export/home/gjanee/middleware/edu/ucsb/adl/middleware/RCS/CacheControlServlet.java,v 1.1 2006/06/30 07:29:31 gjanee Exp $

$Log: CacheControlServlet.java,v $ Revision 1.1 2006/06/30 07:29:31 gjanee Initial revision

Author:
Greg Janée
Alexandria Digital Library
See Also:
Serialized Form

Constructor Summary
CacheControlServlet()
          Creates a CacheControlServlet.
 
Method Summary
 void destroy()
          Frees all resources held by the servlet.
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Performs the HTTP GET service described above.
 void init(javax.servlet.ServletConfig config)
          Initializes the servlet.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheControlServlet

public CacheControlServlet()
Creates a CacheControlServlet.

Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Initializes the servlet.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
config - Must contain the following initialization parameter: middleware_configuration_file, the filename of an ADL middleware configuration file. If the filename is not absolute, it is interpreted relative to the middleware web application directory.
Throws:
javax.servlet.UnavailableException - If the initialization fails.
javax.servlet.ServletException

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws java.io.IOException
Performs the HTTP GET service described above.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - The HTTP request.
response - The HTTP response.
Throws:
java.io.IOException - On any I/O error.

destroy

public void destroy()
Frees all resources held by the servlet.

Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet