Class D1RestServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
edu.ucsb.nceas.metacat.restservice.D1RestServlet
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
- Direct Known Subclasses:
CNRestServlet
,CNRestServlet
,MNRestServlet
,MNRestServlet
public class D1RestServlet
extends javax.servlet.http.HttpServlet
Metacat implementation of DataONE REST API as a servlet. In each request
REST Servlet initialize a D1ResourceHandler object and then D1ResourceHandler object
handles request and writes appropriate response.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected static boolean
protected static org.apache.commons.logging.Log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkIfConfigured
(javax.servlet.http.HttpServletResponse response) Check if the Metacat instance has been configuredprotected D1ResourceHandler
createHandler
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Subclasses should override this method to provide the appropriate handler subclassprotected void
doDelete
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Handle "DELETE" method requests from HTTP clientsprotected void
doGet
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Handle "GET" method requests from HTTP clientsprotected void
doHead
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Handle "PUT" method requests from HTTP clientsprotected void
doPost
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Handle "POST" method requests from HTTP clientsprotected void
doPut
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Handle "PUT" method requests from HTTP clientsvoid
init
(javax.servlet.ServletConfig config) Initialize servlet by setting QuotaServiceMethods inherited from class javax.servlet.http.HttpServlet
doOptions, doTrace, getLastModified, service, service
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Field Details
-
logMetacat
protected static org.apache.commons.logging.Log logMetacat -
isMetacatConfigured
protected static boolean isMetacatConfigured
-
-
Constructor Details
-
D1RestServlet
public D1RestServlet()
-
-
Method Details
-
createHandler
protected D1ResourceHandler createHandler(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException Subclasses should override this method to provide the appropriate handler subclass- Parameters:
request
-response
-- Returns:
- Throws:
javax.servlet.ServletException
IOException
-
init
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException Initialize servlet by setting QuotaService- Specified by:
init
in interfacejavax.servlet.Servlet
- Overrides:
init
in classjavax.servlet.GenericServlet
- Throws:
javax.servlet.ServletException
-
doGet
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException Handle "GET" method requests from HTTP clients- Overrides:
doGet
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
-
doPost
protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException Handle "POST" method requests from HTTP clients- Overrides:
doPost
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
-
doDelete
protected void doDelete(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException Handle "DELETE" method requests from HTTP clients- Overrides:
doDelete
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
-
doPut
protected void doPut(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException Handle "PUT" method requests from HTTP clients- Overrides:
doPut
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
-
doHead
protected void doHead(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException Handle "PUT" method requests from HTTP clients- Overrides:
doHead
in classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
-
checkIfConfigured
protected void checkIfConfigured(javax.servlet.http.HttpServletResponse response) Check if the Metacat instance has been configured- Throws:
javax.servlet.ServletException
-