@Target(value=METHOD) @Retention(value=RUNTIME) @Repeatable(value=Routes.class) public @interface Route
| Modifier and Type | Required Element and Description |
|---|---|
String |
path
Currently must be an absolute path.
|
| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
dataLoad
Data load routes expect to receive a large body and they receive it piece by piece in HttpContent objects.
|
String[] |
method
HTTP method or methods by which this rule is available.
|
boolean |
priority
Whether this route must be checked before any other route.
|
public abstract String path
public abstract String[] method
Implementation note: can't use netty's HttpMethod because it's not an enum
public abstract boolean priority
When matching the request URI, the first rule with the highest weight that matches is responsible for handling the request.
FYI: The order of java methods is non-deterministic when accessing them through reflection. We implement some tricks to get the desired result. This priority qualifier is one of them, another is that paths are reverse sorted on string length before matching. This to make suffixes of otherwise identical rules stand out.
Try to architect non-overlapping paths such that you don't require this extra parameter, we have it here mostly due to some legacy paths, that may need rework.
public abstract boolean dataLoad
org.yamcs.web.rest.archive.ArchiveTableRestHandler#loadTableData(io.netty.channel.ChannelHandlerContext, io.netty.handler.codec.http.HttpRequest, RouteMatch) for an example on how to implement this.
For the normal routes (where dataLoad=false) the body is limited to Router.MAX_BODY_SIZE bytes provided to the HttpObjectAgregator.Copyright © 2017 Space Applications Services. All rights reserved.