Class Http2Route

java.lang.Object
io.helidon.webserver.Http1Route
io.helidon.webserver.http2.Http2Route
All Implemented Interfaces:
HttpRoute, ServerLifecycle

public class Http2Route extends Http1Route
A route for HTTP/2 only. To create a route valid for any version of HTTP, please use HttpRoute.
  • Field Details

    • EMPTY_PATH_MATCHER

      static final PathMatcher EMPTY_PATH_MATCHER
      Path matcher for routing which doesn't specify any other path matcher. Matcher accepts ANY path and a remaining for prefixMatch is whole tested path.
  • Method Details

    • matchVersion

      public boolean matchVersion(Http.Version version)
      Description copied from interface: HttpRoute
      HTTP protocol version supported by the route.
      Specified by:
      matchVersion in interface HttpRoute
      Overrides:
      matchVersion in class Http1Route
      Parameters:
      version - HTTP protocol version supported by the route
      Returns:
      true if supported
    • route

      public static Http2Route route(Http.Method method, String path, Handler handler)
      Create an HTTP/2 specific route.
      Parameters:
      method - accepted method
      path - path pattern
      handler - handler
      Returns:
      a new HTTP/2.0 specific route
    • route

      public static Http2Route route(PathMatcher pathMatcher, Handler handler, Http.Method... methods)
      Create an HTTP/2 specific route.
      Parameters:
      pathMatcher - URI Path Matcher
      handler - handler
      methods - HTTP methods handled by this route
      Returns:
      a new HTTP/2 specific route
    • acceptedMethods

      default Set<Http.RequestMethod> acceptedMethods()
      Gets all accepted HTTP methods or empty set if accepts ANY method or null if no method (not a method based route).
      Returns:
      accepted methods.
    • accepts

      default boolean accepts(Http.RequestMethod method)
      Returns true if this record accepts provided method.
      Parameters:
      method - An HTTP method.
      Returns:
      true if this record accepts provided method.
    • acceptedMethods

      public Set<Http.RequestMethod> acceptedMethods()
    • accepts

      public boolean accepts(Http.RequestMethod method)
    • handler

      public Handler handler()
      Returns an effective Handler.
      Returns:
      an request / response handler.
    • diagnosticEvent

      public Map<String,String> diagnosticEvent()
    • match

      public PathMatcher.Result match(CharSequence path)
      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 that path parameter is null.
    • toString

      public String toString()
      Overrides:
      toString in class Object