Class Http1Route

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

public class Http1Route extends Object implements HttpRoute
A route for HTTP/1.1 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.
  • Constructor Details

  • 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
      Parameters:
      version - HTTP protocol version supported by the route
      Returns:
      true if supported
    • route

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

      public static Http1Route route(PathMatcher pathMatcher, Handler handler, Http.Method... methods)
      Create an HTTP/1.1 specific route.
      Parameters:
      pathMatcher - URI Path Matcher
      handler - handler
      methods - HTTP methods handled by this route
      Returns:
      a new HTTP/1.1 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