Interface HttpRoute

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 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

      default boolean matchVersion(Http.Version version)
      HTTP protocol version supported by the route.
      Parameters:
      version - HTTP protocol version supported by the route
      Returns:
      true if supported
    • route

      static HttpRoute route(Http.Method method, String path, Handler handler)
      Create HTTP route.
      Parameters:
      method - accepted method
      path - path pattern
      handler - handler
      Returns:
      a new HTTP 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.