public class RouteImpl extends Object implements Route, Route.Filter
Route.Chain, Route.Definition, Route.Filter, Route.Forwarding, Route.Handler, Route.OneArgHandler, Route.ZeroArgHandler
Constructor and Description |
---|
RouteImpl(Route.Filter filter,
Verb verb,
String path,
String pattern,
String name,
Map<String,String> vars,
List<MediaType> consumes,
List<MediaType> produces) |
Modifier and Type | Method and Description |
---|---|
List<MediaType> |
consumes() |
static RouteImpl |
fromStatus(Route.Filter filter,
Verb verb,
String path,
Status status,
List<MediaType> produces) |
void |
handle(Request request,
Response response,
Route.Chain chain)
The
handle method of the Filter is called by the server each time a
request/response pair is passed through the chain due to a client request for a resource at
the end of the chain. |
String |
name() |
static RouteImpl |
notFound(Verb verb,
String path,
List<MediaType> produces) |
String |
path() |
String |
pattern() |
List<MediaType> |
produces() |
String |
toString() |
Map<String,String> |
vars() |
Verb |
verb() |
public static RouteImpl fromStatus(Route.Filter filter, Verb verb, String path, Status status, List<MediaType> produces)
public void handle(Request request, Response response, Route.Chain chain) throws Exception
Route.Filter
handle
method of the Filter is called by the server each time a
request/response pair is passed through the chain due to a client request for a resource at
the end of the chain.
The Route.Chain
passed in to this method allows the Filter to pass on the request and
response to the next entity in the chain.
A typical implementation of this method would follow the following pattern:
Route.Chain
object (chain.next(req, rsp)
),handle
in interface Route.Filter
request
- A HTTP request.response
- A HTTP response.chain
- A route chain.Exception
- If something goes wrong.public String pattern()
public String name()
Copyright © 2014. All rights reserved.