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
FieldsModifier and TypeFieldDescriptionprotected static booleanprotected static org.apache.commons.logging.Log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckIfConfigured(javax.servlet.http.HttpServletResponse response) Check if the Metacat instance has been configuredprotected D1ResourceHandlercreateHandler(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Subclasses should override this method to provide the appropriate handler subclassprotected voiddoDelete(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Handle "DELETE" method requests from HTTP clientsprotected voiddoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Handle "GET" method requests from HTTP clientsprotected voiddoHead(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Handle "PUT" method requests from HTTP clientsprotected voiddoPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Handle "POST" method requests from HTTP clientsprotected voiddoPut(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Handle "PUT" method requests from HTTP clientsvoidinit(javax.servlet.ServletConfig config) Initialize servlet by setting QuotaServiceMethods inherited from class javax.servlet.http.HttpServlet
doOptions, doTrace, getLastModified, service, serviceMethods 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.ServletExceptionIOException
-
init
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException Initialize servlet by setting QuotaService- Specified by:
initin interfacejavax.servlet.Servlet- Overrides:
initin 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:
doGetin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
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:
doPostin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
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:
doDeletein classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
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:
doPutin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
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:
doHeadin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
checkIfConfigured
protected void checkIfConfigured(javax.servlet.http.HttpServletResponse response) Check if the Metacat instance has been configured- Throws:
javax.servlet.ServletException
-