Interface WebRoute<A extends ExchangeContext>
- Type Parameters:
A
- the exchange context type
- All Superinterfaces:
BaseWebRoute<A,
WebExchange<A>>
A Web route specifies criteria used to determine the Web exchange handler to execute to handle an exchange.
It basically supports the following criteria:
- the request path which can be parameterized as defined by
URIBuilder
. - the HTTP method of the request
- the content type of the request
- the content type accepted by the request
- the language tag accepted by the request
The request path criteria can be either static or dynamic if a parameterized path is specified as defined by URIBuilder
. When a parameterized path is defined, the
router extracts path parameters from the URIMatcher
used to match the request. For instance, path /books/{id}
defines path parameter id
and
matches paths: /books/1
, /books/2
...
- Since:
- 1.0
- Author:
- Jeremy Kuhn
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the media range defining the content types as defined by RFC 7231 Section 5.3.2 matched by a Web exchange in order to be processed by the route.Returns the Web exchange handler used to handle Web exchanges matching the route criteria.Returns the language tag or language range as defined RFC 7231 Section 5.3.5 matched by a Web exchange in order to be processed by the route.Returns the HTTP method matched by a Web exchange in order to be processed by the route.getPath()
Returns the absolute normalized path matched by a Web exchange in order to be processed by the route.Returns the path pattern matched by a Web exchange in order to be processed by the route.Returns the media type or media range as defined by RFC 7231 Section 3.1.1.5 and RFC 7231 Section 5.3.2 matched by a Web exchange to be processed by the route.Methods inherited from interface io.inverno.mod.web.server.BaseWebRoute
disable, enable, getInterceptors, isDisabled, remove, setInterceptors
-
Method Details
-
getPath
String getPath()Returns the absolute normalized path matched by a Web exchange in order to be processed by the route.
Path and path pattern are exclusive.
- Returns:
- an absolute normalized path or null to match any exchange
-
getPathPattern
URIPattern getPathPattern()Returns the path pattern matched by a Web exchange in order to be processed by the route.
Path and path pattern are exclusive.
- Returns:
- a path pattern or null to match any exchange
-
getMethod
Method getMethod()Returns the HTTP method matched by a Web exchange in order to be processed by the route.
- Returns:
- an HTTP method or null to match any exchange
-
getConsume
String getConsume()Returns the media range defining the content types as defined by RFC 7231 Section 5.3.2 matched by a Web exchange in order to be processed by the route.
- Returns:
- a media range or null
-
getProduce
String getProduce()Returns the media type or media range as defined by RFC 7231 Section 3.1.1.5 and RFC 7231 Section 5.3.2 matched by a Web exchange to be processed by the route.
- Returns:
- a media type, a media range or null to match any exchange
-
getLanguage
String getLanguage()Returns the language tag or language range as defined RFC 7231 Section 5.3.5 matched by a Web exchange in order to be processed by the route.
- Returns:
- a language tag, a language range or null to match any exchange
-
getHandler
ReactiveExchangeHandler<A,WebExchange<A>> getHandler()Returns the Web exchange handler used to handle Web exchanges matching the route criteria.
- Returns:
- a Web exchange handler
-