Class ApiResource

    • Field Summary

      • Fields inherited from class jakarta.servlet.http.HttpServlet

        LEGACY_DO_HEAD
    • Constructor Summary

      Constructors 
      Constructor Description
      ApiResource​(ApiSignature signature)
      Creates an instance with a given signature.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean accepts​(HttpExtension.Method method, String type)
      Returns true if this resource accepts a given media type for a given method.
      void doDelete​(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)  
      void doGet​(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)  
      void doHead​(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)  
      void doOptions​(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)  
      void doPost​(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)  
      void doPut​(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)  
      void doTrace​(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)  
      Set<GCubeExclude> excludes()
      Returns the set of request paths that should be excluded from request management.
      static ApiSignature handles​(String mapping)
      Returns a ApiSignature that declares the method and media types handled by an ApiResource for a given mapping.
      static ApiMethodSignature method​(HttpExtension.Method method)
      Returns an ApiMethodSignature that declares the media types handled by an ApiResource for a given method.
      boolean produces​(HttpExtension.Method method, String type)
      Returns true if this resource produces a given media type for a given method.
      ApiSignature signature()
      Return the signature of this resource.
      boolean supports​(HttpExtension.Method method)
      Returns true if this resource supports a given method.
      • Methods inherited from class jakarta.servlet.http.HttpServlet

        getLastModified, init, service, service
      • Methods inherited from class jakarta.servlet.GenericServlet

        destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log
      • Methods inherited from interface jakarta.servlet.Servlet

        destroy, getServletConfig, getServletInfo, init, service
    • Constructor Detail

      • ApiResource

        public ApiResource​(ApiSignature signature)
        Creates an instance with a given signature.
        Parameters:
        signature - the signature
    • Method Detail

      • handles

        public static ApiSignature handles​(String mapping)
        Returns a ApiSignature that declares the method and media types handled by an ApiResource for a given mapping.
        Parameters:
        mapping - the mapping
        Returns:
        the signature
      • supports

        public boolean supports​(HttpExtension.Method method)
        Returns true if this resource supports a given method.
        Parameters:
        method - the method
        Returns:
        true if this resource supports the given method
      • accepts

        public boolean accepts​(HttpExtension.Method method,
                               String type)
        Returns true if this resource accepts a given media type for a given method.
        Parameters:
        method - the method
        type - the media type
        Returns:
        true if this resource accepts the given media type for the given method
      • produces

        public boolean produces​(HttpExtension.Method method,
                                String type)
        Returns true if this resource produces a given media type for a given method.
        Parameters:
        method - the method
        type - the media type
        Returns:
        true if this resource produces the given media type for the given method
      • signature

        public ApiSignature signature()
        Return the signature of this resource.
        Returns:
        the signature
      • doHead

        public void doHead​(jakarta.servlet.http.HttpServletRequest req,
                           jakarta.servlet.http.HttpServletResponse resp)
                    throws jakarta.servlet.ServletException,
                           IOException
        Overrides:
        doHead in class jakarta.servlet.http.HttpServlet
        Throws:
        jakarta.servlet.ServletException
        IOException
      • doGet

        public void doGet​(jakarta.servlet.http.HttpServletRequest req,
                          jakarta.servlet.http.HttpServletResponse resp)
                   throws jakarta.servlet.ServletException,
                          IOException
        Overrides:
        doGet in class jakarta.servlet.http.HttpServlet
        Throws:
        jakarta.servlet.ServletException
        IOException
      • doPost

        public void doPost​(jakarta.servlet.http.HttpServletRequest req,
                           jakarta.servlet.http.HttpServletResponse resp)
                    throws jakarta.servlet.ServletException,
                           IOException
        Overrides:
        doPost in class jakarta.servlet.http.HttpServlet
        Throws:
        jakarta.servlet.ServletException
        IOException
      • doPut

        public void doPut​(jakarta.servlet.http.HttpServletRequest req,
                          jakarta.servlet.http.HttpServletResponse resp)
                   throws jakarta.servlet.ServletException,
                          IOException
        Overrides:
        doPut in class jakarta.servlet.http.HttpServlet
        Throws:
        jakarta.servlet.ServletException
        IOException
      • doDelete

        public void doDelete​(jakarta.servlet.http.HttpServletRequest req,
                             jakarta.servlet.http.HttpServletResponse resp)
                      throws jakarta.servlet.ServletException,
                             IOException
        Overrides:
        doDelete in class jakarta.servlet.http.HttpServlet
        Throws:
        jakarta.servlet.ServletException
        IOException
      • doOptions

        public void doOptions​(jakarta.servlet.http.HttpServletRequest req,
                              jakarta.servlet.http.HttpServletResponse resp)
                       throws jakarta.servlet.ServletException,
                              IOException
        Overrides:
        doOptions in class jakarta.servlet.http.HttpServlet
        Throws:
        jakarta.servlet.ServletException
        IOException
      • doTrace

        public void doTrace​(jakarta.servlet.http.HttpServletRequest req,
                            jakarta.servlet.http.HttpServletResponse resp)
                     throws jakarta.servlet.ServletException,
                            IOException
        Overrides:
        doTrace in class jakarta.servlet.http.HttpServlet
        Throws:
        jakarta.servlet.ServletException
        IOException