Package net.targetr.rc
Class RootResponder
java.lang.Object
net.targetr.rc.RootResponder
- All Implemented Interfaces:
HttpInterception,ResponseGenerator
Routes HTTP requests to app resources, browser connections and server endpoints.
- Author:
- Dr Michael Gardiner
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs the RootResponder, initializing supplementary handlers. -
Method Summary
Modifier and TypeMethodDescriptiongenerate(HttpRequest httpReq) Dispatches the incoming HTTP request and returns an appropriate response.static StringgetAppIndexPage(String app) Returns the location of an apps index page.static HttpRequestMonitorReturns the HTTP request monitor.Called byHttpHandlerbefore reading each request, including on reused connections.static WebSocketFrameMonitorReturns the WebSocket frame monitor.booleanisValidApp(String app) Verifies whether the specified app is recognized.
-
Field Details
-
VERSION
Current version string for RCWeb.- See Also:
-
-
Constructor Details
-
RootResponder
public RootResponder()Constructs the RootResponder, initializing supplementary handlers.
-
-
Method Details
-
generate
Dispatches the incoming HTTP request and returns an appropriate response. Performs top-level routing based primarily on path semantics.- Specified by:
generatein interfaceResponseGenerator- Parameters:
httpReq- the incoming request- Returns:
- the generated web response
- Throws:
Exception- if response processing encounters an error
-
isValidApp
Verifies whether the specified app is recognized.- Parameters:
app- the app name to test- Returns:
- true if the app index.html file exists
-
getAppIndexPage
Returns the location of an apps index page.- Parameters:
app- the app name to search for- Returns:
- location of index page
-
getInterceptor
Description copied from interface:HttpInterceptionCalled byHttpHandlerbefore reading each request, including on reused connections.- Specified by:
getInterceptorin interfaceHttpInterception- Returns:
- a non-null interceptor for this request
-
getHttpRequestMonitor
Returns the HTTP request monitor.- Returns:
- the HTTP request monitor
-
getWebSocketFrameMonitor
Returns the WebSocket frame monitor.- Returns:
- the WebSocket frame monitor
-