Class Routing.Builder

    • Method Detail

      • register

        public Routing.Builder register​(WebTracingConfig webTracingConfig)
        Description copied from interface: Routing.Rules
        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.
        Specified by:
        register in interface Routing.Rules
        Parameters:
        webTracingConfig - WebServer tracing configuration
        Returns:
        Updated routing configuration
      • register

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

        public Routing.Builder register​(Service... services)
        Description copied from interface: Routing.Rules
        Registers builder consumer. It enables to separate complex routing definitions to dedicated classes.
        Specified by:
        register in interface Routing.Rules
        Parameters:
        services - services to register
        Returns:
        Updated routing configuration
      • register

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

        public Routing.Builder register​(String pathPattern,
                                        Supplier<? extends Service>... serviceBuilders)
        Description copied from interface: Routing.Rules
        Registers builder consumer. It enables to separate complex routing definitions to dedicated classes.
        Specified by:
        register in interface Routing.Rules
        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

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

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

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

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

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

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

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

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

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

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

        public Routing.Builder patch​(String pathPattern,
                                     Handler... requestHandlers)
        Description copied from interface: Routing.Rules
        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.
        Specified by:
        patch in interface Routing.Rules
        Parameters:
        pathPattern - a URI path pattern. See PathMatcher for pattern syntax reference.
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • patch

        public Routing.Builder patch​(PathMatcher pathMatcher,
                                     Handler... requestHandlers)
        Description copied from interface: Routing.Rules
        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.
        Specified by:
        patch in interface Routing.Rules
        Parameters:
        pathMatcher - define path for registered router
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • delete

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        public Routing.Builder anyOf​(Iterable<Http.RequestMethod> methods,
                                     String pathPattern,
                                     Handler... requestHandlers)
        Description copied from interface: Routing.Rules
        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.
        Specified by:
        anyOf in interface Routing.Rules
        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

        public Routing.Builder anyOf​(Iterable<Http.RequestMethod> methods,
                                     PathMatcher pathMatcher,
                                     Handler... requestHandlers)
        Description copied from interface: Routing.Rules
        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.
        Specified by:
        anyOf in interface Routing.Rules
        Parameters:
        methods - HTTP methods
        pathMatcher - define path for registered router
        requestHandlers - handlers to process HTTP request
        Returns:
        an updated routing configuration
      • error

        public <T extends ThrowableRouting.Builder error​(Class<T> exceptionClass,
                                                           ErrorHandler<T> errorHandler)
        Registers an error handler that handles the given type of exceptions.
        Type Parameters:
        T - an error handler type
        Parameters:
        exceptionClass - the type of exception to handle by this handler
        errorHandler - the error handler
        Returns:
        an updated builder
      • build

        public Routing build()
        Builds a new routing instance.
        Specified by:
        build in interface Builder<Routing>
        Returns:
        a new instance