Class HttpController

java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.gcube.smartgears.extensions.HttpExtension
org.gcube.smartgears.extensions.HttpController
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable, ApplicationExtension
Direct Known Subclasses:
RemoteResource

public class HttpController extends HttpExtension
An HttpExtension that dispatches to one or more ApiResources, handling the generic, HTTP-aspects aspects of their client interactions
Author:
Fabio Simeoni
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.gcube.smartgears.extensions.HttpExtension

    HttpExtension.Method
  • Field Summary

    Fields inherited from class jakarta.servlet.http.HttpServlet

    LEGACY_DO_HEAD
  • Constructor Summary

    Constructors
    Constructor
    Description
    HttpController(String name, String mapping)
    Creates an instance with a given name and a given mapping.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addResources(ApiResource... resources)
    Adds one ore more ApiResources to this controller.
    Returns the set of request paths that should be excluded from request management.
    void
    Initialises the extensions with the context of the application.
    final void
    service(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse resp)
     
    void
    Stops the extension and releases any resources.

    Methods inherited from class org.gcube.smartgears.extensions.HttpExtension

    context, init, mapping, mapping, name, name

    Methods inherited from class jakarta.servlet.http.HttpServlet

    doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, init, service

    Methods inherited from class jakarta.servlet.GenericServlet

    destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface jakarta.servlet.Servlet

    destroy, getServletConfig, getServletInfo, init
  • Constructor Details

    • HttpController

      public HttpController(String name, String mapping)
      Creates an instance with a given name and a given mapping.
      Parameters:
      name - the name
      mapping - the mapping
  • Method Details

    • addResources

      public void addResources(ApiResource... resources)
      Adds one ore more ApiResources to this controller.
      Parameters:
      resources - the resources
    • init

      public void init(ApplicationContext context) throws Exception
      Description copied from interface: ApplicationExtension
      Initialises the extensions with the context of the application.
      Specified by:
      init in interface ApplicationExtension
      Overrides:
      init in class HttpExtension
      Parameters:
      context - the application context
      Throws:
      Exception - if the extension cannot be initialised
    • stop

      public void stop()
      Description copied from interface: ApplicationExtension
      Stops the extension and releases any resources.
      Specified by:
      stop in interface ApplicationExtension
      Overrides:
      stop in class HttpExtension
    • excludes

      public Set<GCubeExclude> excludes()
      Description copied from interface: ApplicationExtension
      Returns the set of request paths that should be excluded from request management.
      Specified by:
      excludes in interface ApplicationExtension
      Overrides:
      excludes in class HttpExtension
      Returns:
      the set of request paths that should be excluded from request management
    • service

      public final void service(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse resp) throws jakarta.servlet.ServletException, IOException
      Specified by:
      service in interface jakarta.servlet.Servlet
      Overrides:
      service in class jakarta.servlet.http.HttpServlet
      Throws:
      jakarta.servlet.ServletException
      IOException