- 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
FieldsModifier and TypeFieldDescriptionstatic final PathMatcherPath matcher for routing which doesn't specify any other path matcher. -
Method Summary
Modifier and TypeMethodDescriptiondefault Set<Http.RequestMethod>Gets all acceptedHTTP methodsor empty set if accepts ANY method ornullif no method (not a method based route).default booleanaccepts(Http.RequestMethod method) Returnstrueif this record accepts provided method.default booleanmatchVersion(Http.Version version) HTTP protocol version supported by the route.static HttpRouteroute(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 aremainingforprefixMatchis 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 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.
-