Package org.sensorhub.api.service
Interface IHttpServer<T extends ModuleConfig>
- Type Parameters:
 T- Type of module configuration
- All Superinterfaces:
 IEventProducer,IModule<T>,IModuleBase<T>
Base interface for HTTP server implementations
- Since:
 - Apr 21, 2021
 
- 
Field Summary
Fields inherited from interface org.sensorhub.api.module.IModule
CANNOT_INIT_MSG, CANNOT_LOAD_MSG, CANNOT_START_MSG, CANNOT_STOP_MSG, CANNOT_UPDATE_MSG - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddServletSecurity(String pathSpec, boolean requireAuth) voidaddServletSecurity(String pathSpec, boolean requireAuth, String... roles) voiddeployServlet(javax.servlet.http.HttpServlet servlet, String path) voiddeployServlet(javax.servlet.http.HttpServlet servlet, Map<String, String> initParams, String... paths) getPublicEndpointUrl(String path) booleanCheck if authentication is enabled on the HTTP servervoidundeployServlet(javax.servlet.http.HttpServlet servlet) Methods inherited from interface org.sensorhub.api.module.IModule
cleanup, getCurrentError, getCurrentState, getDescription, getLocalID, getLogger, getParentHub, getStatusMessage, init, isInitialized, isStarted, loadState, registerListener, saveState, setConfiguration, setParentHub, start, stop, unregisterListener, updateConfig, waitForStateMethods inherited from interface org.sensorhub.api.module.IModuleBase
getConfiguration, getName, init 
- 
Method Details
- 
deployServlet
 - 
deployServlet
 - 
undeployServlet
void undeployServlet(javax.servlet.http.HttpServlet servlet)  - 
addServletSecurity
 - 
addServletSecurity
 - 
getServerBaseUrl
String getServerBaseUrl()- Returns:
 - The base URL under which this server is exposed to consumers (i.e it will start with the proxy URL if configured)
 
 - 
getServletsBaseUrl
String getServletsBaseUrl()- Returns:
 - The base URL under which web services and APIs are exposed by this server
 
 - 
getPublicEndpointUrl
- Parameters:
 path- desired URL path- Returns:
 - The full endpoint URL allowing access to the given URL path
 
 - 
isAuthEnabled
boolean isAuthEnabled()Check if authentication is enabled on the HTTP server- Returns:
 - true if at least one authentication method is enabled, false otherwise
 
 
 -