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

    Fields
    Modifier and Type
    Field
    Description
    protected static boolean
     
    protected static org.apache.commons.logging.Log
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    checkIfConfigured(javax.servlet.http.HttpServletResponse response)
    Check if the Metacat instance has been configured
    createHandler(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    Subclasses should override this method to provide the appropriate handler subclass
    protected void
    doDelete(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    Handle "DELETE" method requests from HTTP clients
    protected void
    doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    Handle "GET" method requests from HTTP clients
    protected void
    doHead(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    Handle "PUT" method requests from HTTP clients
    protected void
    doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    Handle "POST" method requests from HTTP clients
    protected void
    doPut(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
    Handle "PUT" method requests from HTTP clients
    void
    init(javax.servlet.ServletConfig config)
    Initialize servlet by setting QuotaService

    Methods 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 interface javax.servlet.Servlet
      Overrides:
      init in class javax.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 class javax.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 class javax.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 class javax.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 class javax.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 class javax.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