Class AbstractRestServlet

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

    public abstract class AbstractRestServlet
    extends javax.servlet.http.HttpServlet
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract void create​(RestRequest request, javax.servlet.http.HttpServletResponse response)
      Dispatches client requests to the protected create method if it is a creation.
      protected abstract void delete​(RestRequest request, javax.servlet.http.HttpServletResponse response)
      Dispatches client requests to the protected delete method if it is a deletion.
      protected abstract void find​(RestRequest request, javax.servlet.http.HttpServletResponse response)
      Dispatches client requests to the protected find method if it is a search.
      protected String getServletRequestPath()
      The path element in the request used to call the servlet.This method might be overriden for each instance - otherwise it returns the initialization parameter "request_path".
      protected void service​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      protected abstract void update​(RestRequest request, javax.servlet.http.HttpServletResponse response)
      Dispatches client requests to the protected update method if it is an update.
      • Methods inherited from class javax.servlet.http.HttpServlet

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

        destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
    • Constructor Detail

      • AbstractRestServlet

        public AbstractRestServlet()
    • Method Detail

      • getServletRequestPath

        protected String getServletRequestPath()
        The path element in the request used to call the servlet.This method might be overriden for each instance - otherwise it returns the initialization parameter "request_path".
        Returns:
        the path element in the request used to call the servlet.
      • service

        protected void service​(javax.servlet.http.HttpServletRequest request,
                               javax.servlet.http.HttpServletResponse response)
        Overrides:
        service in class javax.servlet.http.HttpServlet
      • delete

        protected abstract void delete​(RestRequest request,
                                       javax.servlet.http.HttpServletResponse response)
        Dispatches client requests to the protected delete method if it is a deletion. This method must be to overriden.
        Parameters:
        request - the rest request.
        response - - the HttpServletResponse object that contains the response the servlet returns to the client
      • create

        protected abstract void create​(RestRequest request,
                                       javax.servlet.http.HttpServletResponse response)
        Dispatches client requests to the protected create method if it is a creation. This method must be to overriden.
        Parameters:
        request - the rest request.
        response - - the HttpServletResponse object that contains the response the servlet returns to the client
      • update

        protected abstract void update​(RestRequest request,
                                       javax.servlet.http.HttpServletResponse response)
        Dispatches client requests to the protected update method if it is an update. This method must be to overriden.
        Parameters:
        request - the rest request.
        response - - the HttpServletResponse object that contains the response the servlet returns to the client
      • find

        protected abstract void find​(RestRequest request,
                                     javax.servlet.http.HttpServletResponse response)
        Dispatches client requests to the protected find method if it is a search. This method must be to overriden.
        Parameters:
        request - the rest request.
        response - - the HttpServletResponse object that contains the response the servlet returns to the client