Package org.gcube.smartgears.extensions
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
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
ConstructorsConstructorDescriptionHttpController(String name, String mapping) Creates an instance with a given name and a given mapping. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResources(ApiResource... resources) Adds one ore moreApiResources to this controller.excludes()Returns the set of request paths that should be excluded from request management.voidinit(ApplicationContext context) Initialises the extensions with the context of the application.final voidservice(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse resp) voidstop()Stops the extension and releases any resources.Methods inherited from class org.gcube.smartgears.extensions.HttpExtension
context, init, mapping, mapping, name, nameMethods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, init, serviceMethods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, logMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.servlet.Servlet
destroy, getServletConfig, getServletInfo, init
-
Constructor Details
-
HttpController
Creates an instance with a given name and a given mapping.- Parameters:
name- the namemapping- the mapping
-
-
Method Details
-
addResources
Adds one ore moreApiResources to this controller.- Parameters:
resources- the resources
-
init
Description copied from interface:ApplicationExtensionInitialises the extensions with the context of the application.- Specified by:
initin interfaceApplicationExtension- Overrides:
initin classHttpExtension- Parameters:
context- the application context- Throws:
Exception- if the extension cannot be initialised
-
stop
public void stop()Description copied from interface:ApplicationExtensionStops the extension and releases any resources.- Specified by:
stopin interfaceApplicationExtension- Overrides:
stopin classHttpExtension
-
excludes
Description copied from interface:ApplicationExtensionReturns the set of request paths that should be excluded from request management.- Specified by:
excludesin interfaceApplicationExtension- Overrides:
excludesin classHttpExtension- 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:
servicein interfacejakarta.servlet.Servlet- Overrides:
servicein classjakarta.servlet.http.HttpServlet- Throws:
jakarta.servlet.ServletExceptionIOException
-