- All Superinterfaces:
ServerLifecycle
- All Known Implementing Classes:
Http1Route
,Http2Route
public interface HttpRoute
A basic HTTP route (should be usable by ANY HTTP protocol version).
-
Field Summary
Modifier and TypeFieldDescriptionstatic final PathMatcher
Path matcher for routing which doesn't specify any other path matcher. -
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).default boolean
accepts
(Http.RequestMethod method) Returnstrue
if this record accepts provided method.default boolean
matchVersion
(Http.Version version) HTTP protocol version supported by the route.static HttpRoute
route
(Http.Method method, String path, Handler handler) Create HTTP route.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.
-
-
Method Details
-
matchVersion
HTTP protocol version supported by the route.- Parameters:
version
- HTTP protocol version supported by the route- Returns:
- true if supported
-
route
Create HTTP route.- Parameters:
method
- accepted methodpath
- path patternhandler
- handler- Returns:
- a new HTTP 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.
-