Class OAIHandler
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
edu.ucsb.nceas.metacat.oaipmh.provider.server.OAIHandler
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public class OAIHandler
extends javax.servlet.http.HttpServlet
OAIHandler is the primary Servlet for OAICat.
- Author:
- Jeffrey A. Young, OCLC Online Computer Library Center
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
doGet
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Peform the http GET action.void
doPost
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Perform a POST action.protected boolean
filterRequest
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Override to do any pre-qualification; return false if the response should be returned immediately, without further action.getAttributes
(String pathInfo) getAttributes
(Properties properties) static String
getResult
(HashMap attributes, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Transformer serverTransformer, HashMap serverVerbs) static String
Get the VERSION numberstatic Writer
getWriter
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Get a response Writer depending on acceptable encodingsvoid
init
(javax.servlet.ServletConfig config) init is called one time when the Servlet is loaded.static boolean
Boolean to determine whether the Data Provider code is executing in a Metacat application.protected boolean
isServiceUnavailable
(Properties properties) Should the server report itself down for maintenance? Override this method if you want to do this check another way.Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Field Details
-
attributesMap
-
-
Constructor Details
-
OAIHandler
public OAIHandler()
-
-
Method Details
-
getVERSION
Get the VERSION number -
isIntegratedWithMetacat
public static boolean isIntegratedWithMetacat()Boolean to determine whether the Data Provider code is executing in a Metacat application. This is normally true, but the 'integratedWithMetacat' value can be set to false by a developer when testing the code outside of Metacat. This eliminates dependencies on Metacat property settings.- Returns:
-
doGet
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException Peform the http GET action. Note that POST is shunted to here as well. The verb widget is taken from the request and used to invoke an OAIVerb object of the corresponding kind to do the actual work of the verb.- Overrides:
doGet
in classjavax.servlet.http.HttpServlet
- Parameters:
request
- the servlet's request informationresponse
- the servlet's response information- Throws:
IOException
- an I/O error occurredjavax.servlet.ServletException
-
doPost
public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException Perform a POST action. Actually this gets shunted to GET.- Overrides:
doPost
in classjavax.servlet.http.HttpServlet
- Parameters:
request
- the servlet's request informationresponse
- the servlet's response information- Throws:
IOException
- an I/O error occurredjavax.servlet.ServletException
-
filterRequest
protected boolean filterRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Override to do any pre-qualification; return false if the response should be returned immediately, without further action.- Parameters:
request
-response
-- Returns:
- false=return immediately, true=continue
-
getAttributes
- Throws:
Throwable
-
getAttributes
-
getResult
public static String getResult(HashMap attributes, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Transformer serverTransformer, HashMap serverVerbs) throws Throwable - Throws:
Throwable
-
getWriter
public static Writer getWriter(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException Get a response Writer depending on acceptable encodings- Parameters:
request
- the servlet's request informationresponse
- the servlet's response information- Throws:
IOException
- an I/O error occurred
-
init
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException init is called one time when the Servlet is loaded. This is the place where one-time initialization is done. Specifically, we load the properties file for this application, and create the AbstractCatalog object for subsequent use.- Specified by:
init
in interfacejavax.servlet.Servlet
- Overrides:
init
in classjavax.servlet.GenericServlet
- Parameters:
config
- servlet configuration information- Throws:
javax.servlet.ServletException
- there was a problem with initialization
-