java.lang.Object
io.helidon.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
Modifier and TypeFieldDescriptionstatic final PathMatcher
Path matcher for routing which doesn't specify any other path matcher. -
Constructor Summary
ModifierConstructorDescriptionprotected
Http1Route
(Http.Method method, String path, Handler handler) protected
Http1Route
(PathMatcher pathMatcher, Handler handler, Http.Method... methods) -
Method Summary
Modifier and TypeMethodDescriptiondefault Set<Http.RequestMethod>
Gets all acceptedHTTP methods
or empty set if accepts ANY method ornull
if no method (not a method based route).boolean
accepts
(Http.RequestMethod method) default boolean
accepts
(Http.RequestMethod method) Returnstrue
if this record accepts provided method.handler()
Returns an effectiveHandler
.match
(CharSequence path) Matches this against a URI path.boolean
matchVersion
(Http.Version version) HTTP protocol version supported by the route.static Http1Route
route
(Http.Method method, String path, Handler handler) Create an HTTP/1 specific route.static Http1Route
route
(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, wait
Methods inherited from interface io.helidon.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 aremaining
forprefixMatch
is whole tested path.
-
-
Constructor Details
-
Http1Route
-
Http1Route
-
-
Method Details
-
matchVersion
Description copied from interface:HttpRoute
HTTP protocol version supported by the route.- Specified by:
matchVersion
in 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
- HTTPmethods
handled by this route- Returns:
- a new HTTP/1.1 specific route
-
acceptedMethods
Gets all acceptedHTTP methods
or empty set if accepts ANY method ornull
if no method (not a method based route).- Returns:
- accepted methods.
-
accepts
Returnstrue
if this record accepts provided method.- Parameters:
method
- An HTTP method.- Returns:
true
if this record accepts provided method.
-
acceptedMethods
-
accepts
-
handler
Returns an effectiveHandler
.- Returns:
- an request / response handler.
-
diagnosticEvent
-
match
Matches this against a URI path. Drops any path parameters before matching.- Parameters:
path
- resolved and normalized URI path to test against.- Returns:
- a
PathMatcher.Result
of the test. - Throws:
NullPointerException
- in case thatpath
parameter isnull
.
-
toString
-