Interface Routing.Rules

  • All Known Implementing Classes:
    Routing.Builder
    Enclosing interface:
    Routing

    public static interface Routing.Rules
    An API to define HTTP request routing rules.
    See Also:
    Routing.Builder
    • Method Detail

      • register

        Routing.Rules register​(WebTracingConfig webTracingConfig)
        Configuration of tracing for this routing. The configuration may control whether to log specific components, spans and span logs, either globally, or for a specific path and method combinations.
        Parameters:
        webTracingConfig - WebServer tracing configuration
        Returns:
        Updated routing configuration
      • register

        Routing.Rules register​(Service... services)
        Registers builder consumer. It enables to separate complex routing definitions to dedicated classes.
        Parameters:
        services - services to register
        Returns:
        Updated routing configuration
      • register

        Routing.Rules register​(Supplier<? extends Service>... serviceBuilders)
        Registers builder consumer. It enables to separate complex routing definitions to dedicated classes.
        Parameters:
        serviceBuilders - service builder to register; they will be built as a first step of this method execution
        Returns:
        Updated routing configuration
      • register

        Routing.Rules register​(String pathPattern,
                               Service... services)
        Registers builder consumer. It enables to separate complex routing definitions to dedicated classes.
        Parameters:
        pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.
        services - services to register
        Returns:
        Updated routing configuration
      • register

        Routing.Rules register​(String pathPattern,
                               Supplier<? extends Service>... serviceBuilders)
        Registers builder consumer. It enables to separate complex routing definitions to dedicated classes.
        Parameters:
        pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.
        serviceBuilders - service builder to register; they will be built as a first step of this method execution
        Returns:
        an updated routing configuration
      • get

        Routing.Rules get​(Handler... requestHandlers)
        Routes all GET requests to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • get

        Routing.Rules get​(String pathPattern,
                          Handler... requestHandlers)
        Routes GET requests with corresponding path to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • get

        Routing.Rules get​(PathMatcher pathMatcher,
                          Handler... requestHandlers)
        Routes GET requests with corresponding path to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        pathMatcher - a URI path pattern. See PathMatcher for pattern syntax reference.
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • put

        Routing.Rules put​(Handler... requestHandlers)
        Routes all PUT requests to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • put

        Routing.Rules put​(String pathPattern,
                          Handler... requestHandlers)
        Routes PUT requests with corresponding path to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • put

        Routing.Rules put​(PathMatcher pathMatcher,
                          Handler... requestHandlers)
        Routes PUT requests with corresponding path to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        pathMatcher - define path for a registered router
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • post

        Routing.Rules post​(Handler... requestHandlers)
        Routes all POST requests to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • post

        Routing.Rules post​(String pathPattern,
                           Handler... requestHandlers)
        Routes POST requests with corresponding path to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • post

        Routing.Rules post​(PathMatcher pathMatcher,
                           Handler... requestHandlers)
        Routes POST requests with corresponding path to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        pathMatcher - define path for registered router
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • patch

        Routing.Rules patch​(Handler... requestHandlers)
        Routes all RFC 5789 PATCH requests to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • patch

        Routing.Rules patch​(String pathPattern,
                            Handler... requestHandlers)
        Routes RFC 5789 PATCH requests with corresponding path to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • patch

        Routing.Rules patch​(PathMatcher pathMatcher,
                            Handler... requestHandlers)
        Routes RFC 5789 PATCH requests with corresponding path to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        pathMatcher - define path for registered router
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • delete

        Routing.Rules delete​(Handler... requestHandlers)
        Routes all DELETE requests to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • delete

        Routing.Rules delete​(String pathPattern,
                             Handler... requestHandlers)
        Routes DELETE requests with corresponding path to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • delete

        Routing.Rules delete​(PathMatcher pathMatcher,
                             Handler... requestHandlers)
        Routes DELETE requests with corresponding path to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        pathMatcher - define path for registered router
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • options

        Routing.Rules options​(Handler... requestHandlers)
        Routes all OPTIONS requests to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • options

        Routing.Rules options​(String pathPattern,
                              Handler... requestHandlers)
        Routes OPTIONS requests with corresponding path to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • options

        Routing.Rules options​(PathMatcher pathMatcher,
                              Handler... requestHandlers)
        Routes OPTIONS requests with corresponding path to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        pathMatcher - define path for registered router
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • head

        Routing.Rules head​(Handler... requestHandlers)
        Routes all HEAD requests to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • head

        Routing.Rules head​(String pathPattern,
                           Handler... requestHandlers)
        Routes HEAD requests with corresponding path to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • head

        Routing.Rules head​(PathMatcher pathMatcher,
                           Handler... requestHandlers)
        Routes HEAD requests with corresponding path to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        pathMatcher - define path for registered router
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • trace

        Routing.Rules trace​(Handler... requestHandlers)
        Routes all TRACE requests to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • trace

        Routing.Rules trace​(String pathPattern,
                            Handler... requestHandlers)
        Routes TRACE requests with corresponding path to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • trace

        Routing.Rules trace​(PathMatcher pathMatcher,
                            Handler... requestHandlers)
        Routes TRACE requests with corresponding path to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        pathMatcher - define path for registered router
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • any

        Routing.Rules any​(Handler... requestHandlers)
        Routes all requests to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • any

        Routing.Rules any​(String pathPattern,
                          Handler... requestHandlers)
        Routes all requests with corresponding path to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • any

        Routing.Rules any​(PathMatcher pathMatcher,
                          Handler... requestHandlers)
        Routes all requests with corresponding path to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        pathMatcher - define path for registered router
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • anyOf

        Routing.Rules anyOf​(Iterable<Http.RequestMethod> methods,
                            Handler... requestHandlers)
        Routes requests any specified method to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        methods - HTTP methods
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • anyOf

        Routing.Rules anyOf​(Iterable<Http.RequestMethod> methods,
                            String pathPattern,
                            Handler... requestHandlers)
        Routes requests with any specified method and corresponding path to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        methods - HTTP methods
        pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • anyOf

        Routing.Rules anyOf​(Iterable<Http.RequestMethod> methods,
                            PathMatcher pathMatcher,
                            Handler... requestHandlers)
        Routes requests with any specified method and corresponding path to provided handler(s). Request handler can call ServerRequest.next() to continue processing on the next registered handler.
        Parameters:
        methods - HTTP methods
        pathMatcher - define path for registered router
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • onNewWebServer

        Routing.Rules onNewWebServer​(Consumer<WebServer> webServerConsumer)
        Registers callback on created new WebServer instance with this routing.
        Parameters:
        webServerConsumer - a WebServer creation callback
        Returns:
        updated routing configuration