Class Http1Route

java.lang.Object
io.helidon.webserver.http1.Http1Route
All Implemented Interfaces:
HttpRoute, Route, ServerLifecycle

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.
  • Method Details

    • route

      public static Http1Route route(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
    • accepts

      public PathMatchers.MatchResult accepts(HttpPrologue prologue)
      Description copied from interface: HttpRoute
      Whether this route accept the provided request.
      Specified by:
      accepts in interface HttpRoute
      Parameters:
      prologue - prologue of the request
      Returns:
      result of the validation
      See Also:
    • pathMatcher

      public Optional<PathMatcher> pathMatcher()
      Description copied from interface: HttpRoute
      Path matcher for this HTTP route.
      Specified by:
      pathMatcher in interface HttpRoute
      Returns:
      optional path matcher
    • handler

      public Handler handler()
      Description copied from interface: HttpRoute
      Handler of this route.
      Specified by:
      handler in interface HttpRoute
      Returns:
      handler
    • beforeStart

      public void beforeStart()
      Description copied from interface: ServerLifecycle
      Before server start. If this method throws an exception, server startup fails and the server attempts startup cleanup.
      Specified by:
      beforeStart in interface ServerLifecycle
    • afterStart

      public void afterStart(WebServer webServer)
      Description copied from interface: ServerLifecycle
      After server start. If this method throws an exception, server startup fails and the server attempts startup cleanup.
      Specified by:
      afterStart in interface ServerLifecycle
      Parameters:
      webServer - the WebServer that was started
    • afterStop

      public void afterStop()
      Description copied from interface: ServerLifecycle
      After server stop. Exceptions thrown by this method fail WebServer.stop() after listener cleanup has been attempted. If this method is invoked during startup cleanup, exceptions may fail WebServer.start(). If this method is invoked during suspend or resume failure cleanup, exceptions may be suppressed on the original suspend or resume failure.
      Specified by:
      afterStop in interface ServerLifecycle