Package org.gcube.smartgears.extensions
Class HttpController
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.gcube.smartgears.extensions.HttpExtension
-
- org.gcube.smartgears.extensions.HttpController
-
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig,ApplicationExtension
- Direct Known Subclasses:
RemoteResource
public class HttpController extends HttpExtension
AnHttpExtensionthat dispatches to one or moreApiResources, handling the generic, HTTP-aspects aspects of their client interactions- Author:
- Fabio Simeoni
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.gcube.smartgears.extensions.HttpExtension
HttpExtension.Method
-
-
Constructor Summary
Constructors Constructor Description HttpController(String name, String mapping)Creates an instance with a given name and a given mapping.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddResources(ApiResource... resources)Adds one ore moreApiResources to this controller.Set<Exclude>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.voidservice(javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp)-
Methods inherited from class org.gcube.smartgears.extensions.HttpExtension
context, init, mapping, mapping, name, name
-
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, log, log
-
-
-
-
Method Detail
-
addResources
public void addResources(ApiResource... resources)
Adds one ore moreApiResources to this controller.- Parameters:
resources- the resources
-
init
public void init(ApplicationContext context) throws Exception
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
-
excludes
public Set<Exclude> 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(javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp) throws javax.servlet.ServletException, IOException- Specified by:
servicein interfacejavax.servlet.Servlet- Overrides:
servicein classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
-