Package net.officefloor.web.route
Class WebRouter
java.lang.Object
net.officefloor.web.route.WebRouter
Routes
ServerHttpConnection instances to their respective handling
ManagedFunction.- Author:
- Daniel Sagenschneider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetWebServicer(ServerHttpConnection connection, ManagedFunctionContext<?, Indexed> managedFunctionContext) Obtains theWebServicerfor theHttpRequest.static StringtransformToApplicationCanonicalPath(String path, String contextPath) Transforms the path to canonical path for the application.static StringTransforms the input Request URI path to a canonical path.
-
Constructor Details
-
WebRouter
Instantiate.- Parameters:
nodes- RootWebRouteNodeinstances.
-
-
Method Details
-
transformToApplicationCanonicalPath
public static String transformToApplicationCanonicalPath(String path, String contextPath) throws HttpException Transforms the path to canonical path for the application.
Available for routing to call directly to avoid
ManagedObjectcreation.- Parameters:
path- Path to be transformed.contextPath- Context path of the application. May benullif context at root.- Returns:
- Canonical path for the application.
- Throws:
HttpException- If path is invalid.
-
transformToCanonicalPath
Transforms the input Request URI path to a canonical path.- Parameters:
path- Path to transform.- Returns:
- Canonical path.
- Throws:
HttpException- Should the Request URI path be invalid.
-
getWebServicer
public WebServicer getWebServicer(ServerHttpConnection connection, ManagedFunctionContext<?, Indexed> managedFunctionContext) Obtains theWebServicerfor theHttpRequest.- Parameters:
connection-ServerHttpConnection.managedFunctionContext-ManagedFunctionContext.- Returns:
trueifHttpRequestwas routed to aWebRouteHandler.falseindicates not handled.
-