java.lang.Object
io.helidon.reactive.webserver.Http1Route
- All Implemented Interfaces:
HttpRoute,ServerLifecycle
- Direct Known Subclasses:
Http2Route
A route for HTTP/1.1 only.
To create a route valid for any version of HTTP, please use
HttpRoute.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PathMatcherPath matcher for routing which doesn't specify any other path matcher. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHttp1Route(Http.Method method, String path, Handler handler) Create a new route.protectedHttp1Route(PathMatcher pathMatcher, Handler handler, Http.Method... methods) Create a new route. -
Method Summary
Modifier and TypeMethodDescriptiondefault Set<Http.Method>Gets all acceptedHTTP methodsor empty set if accepts ANY method ornullif no method (not a method based route).booleanaccepts(Http.Method method) default booleanaccepts(Http.Method method) Returnstrueif this record accepts provided method.handler()Returns an effectiveHandler.booleanmatchVersion(Http.Version version) HTTP protocol version supported by the route.static Http1Routeroute(Http.Method method, String path, Handler handler) Create an HTTP/1 specific route.static Http1Routeroute(PathMatcher pathMatcher, Handler handler, Http.Method... methods) Create an HTTP/1.1 specific route.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.helidon.reactive.webserver.ServerLifecycle
afterStop, beforeStart
-
Field Details
-
EMPTY_PATH_MATCHER
Path matcher for routing which doesn't specify any other path matcher. Matcher accepts ANY path and aremainingforprefixMatchis whole tested path.
-
-
Constructor Details
-
Http1Route
Create a new route.- Parameters:
method- supported methodpath- request path (exact)handler- handle the request
-
Http1Route
Create a new route.- Parameters:
pathMatcher- match path of the requesthandler- handle the requestmethods- supported methods
-
-
Method Details
-
matchVersion
Description copied from interface:HttpRouteHTTP protocol version supported by the route.- Specified by:
matchVersionin interfaceHttpRoute- Parameters:
version- HTTP protocol version supported by the route- Returns:
- true if supported
-
route
Create an HTTP/1 specific route.- Parameters:
method- accepted methodpath- path patternhandler- handler- Returns:
- a new HTTP/1.1 specific route
-
route
Create an HTTP/1.1 specific route.- Parameters:
pathMatcher- URI Path Matcherhandler- handlermethods- HTTPmethodshandled by this route- Returns:
- a new HTTP/1.1 specific route
-
acceptedMethods
Gets all acceptedHTTP methodsor empty set if accepts ANY method ornullif no method (not a method based route).- Returns:
- accepted methods.
-
accepts
Returnstrueif this record accepts provided method.- Parameters:
method- An HTTP method.- Returns:
trueif this record accepts provided method.
-
acceptedMethods
-
accepts
-
handler
Returns an effectiveHandler.- Returns:
- an request / response handler.
-
toString
-