public class Router extends Object
The Router itself has the same granularity as HttpServer: one instance only.
When matching a route, priority is first given to built-in routes, only if none match the first matching instance-specific dynamic route is matched. Dynamic routes often mention ':instance' in their url, which will be expanded upon registration into the actual yamcs instance.
| Modifier and Type | Class and Description |
|---|---|
static class |
Router.RouteConfig
Struct containing all non-path route configuration
|
static class |
Router.RouteMatch
Represents a matched route pattern
|
| Constructor and Description |
|---|
Router() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
dispatch(RestRequest req,
Router.RouteMatch match) |
void |
handleHttpRequest(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.FullHttpRequest req,
AuthenticationToken token,
io.netty.handler.codec.http.QueryStringDecoder qsDecoder) |
protected Router.RouteMatch |
matchURI(io.netty.handler.codec.http.HttpMethod method,
String uri) |
void |
registerRouteHandler(String yamcsInstance,
RouteHandler routeHandler) |
public void registerRouteHandler(String yamcsInstance, RouteHandler routeHandler)
public void handleHttpRequest(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.FullHttpRequest req,
AuthenticationToken token,
io.netty.handler.codec.http.QueryStringDecoder qsDecoder)
protected Router.RouteMatch matchURI(io.netty.handler.codec.http.HttpMethod method, String uri) throws MethodNotAllowedException
MethodNotAllowedExceptionprotected void dispatch(RestRequest req, Router.RouteMatch match)
Copyright © 2017 Space Applications Services. All rights reserved.