Class JSONRPC2Servlet

  • All Implemented Interfaces:
    Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    public abstract class JSONRPC2Servlet
    extends javax.servlet.http.HttpServlet
    Base abstract JSON-RPC 2.0 request servlet for Connect2id services. Requests are received at the HTTP POST endpoint and passed to service for processing. The HTTP GET endpoint prints out a banner text message that identifies the web service name and version and lists the supported JSON-RPC 2.0 requests.

    Inheriting servlets must initialise all protected members in their init(...) method.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      JSONRPC2Servlet()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void destroy()
      Called at servlet shutdown.
      void doGet​(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse)
      Outputs a simple text/plain banner message that identifies the Connect2id web service name/version and lists the supported JSON-RPC 2.0 requests.
      void doPost​(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse)
      Receives JSON-RPC 2.0 requests for the Connect2id service by means of HTTP POST.
      • Methods inherited from class javax.servlet.http.HttpServlet

        doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
      • Methods inherited from class javax.servlet.GenericServlet

        getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
    • Method Detail

      • doPost

        public void doPost​(javax.servlet.http.HttpServletRequest httpRequest,
                           javax.servlet.http.HttpServletResponse httpResponse)
                    throws javax.servlet.ServletException
        Receives JSON-RPC 2.0 requests for the Connect2id service by means of HTTP POST.
        Overrides:
        doPost in class javax.servlet.http.HttpServlet
        Parameters:
        httpRequest - The HTTP request.
        httpResponse - The output HTTP response.
        Throws:
        javax.servlet.ServletException - On a request handling exception.
      • doGet

        public void doGet​(javax.servlet.http.HttpServletRequest httpRequest,
                          javax.servlet.http.HttpServletResponse httpResponse)
                   throws javax.servlet.ServletException
        Outputs a simple text/plain banner message that identifies the Connect2id web service name/version and lists the supported JSON-RPC 2.0 requests.
        Overrides:
        doGet in class javax.servlet.http.HttpServlet
        Parameters:
        httpRequest - The HTTP request.
        httpResponse - The output HTTP response.
        Throws:
        javax.servlet.ServletException - On a request handling exception.
      • destroy

        public void destroy()
        Called at servlet shutdown. Stops the Connect2id web service, exceptions are logged at WARN level.
        Specified by:
        destroy in interface javax.servlet.Servlet
        Overrides:
        destroy in class javax.servlet.GenericServlet