Interface RouteManager<A,B,C extends Route<A>,D extends RouteManager<A,B,C,D,E>,E extends Router<A,B,C,D,E>>

Type Parameters:
A - the resource type
B - the router input type
C - the route type
D - the route manager type
E - the router type
All Known Subinterfaces:
AcceptContentRoute.Manager<A,B,C,D,E>, AcceptLanguageRoute.Manager<A,B,C,D,E>, AuthorityRoute.Manager<A,B,C,D,E>, ContentRoute.Manager<A,B,C,D,E>, ErrorRoute.Manager<A,B,C,D,E>, HeadersRoute.Manager<A,B,C,D,E>, MethodRoute.Manager<A,B,C,D,E>, PathRoute.Manager<A,B,C,D,E>, QueryParametersRoute.Manager<A,B,C,D,E>, URIRoute.Manager<A,B,C,D,E>, WebSocketSubprotocolRoute.Manager<A,B,C,D,E>
All Known Implementing Classes:
AbstractRouteManager

public interface RouteManager<A,B,C extends Route<A>,D extends RouteManager<A,B,C,D,E>,E extends Router<A,B,C,D,E>>

A route manager is used to fluently define routes in a Router.

Since:
1.12
Author:
Jeremy Kuhn
  • Method Summary

    Modifier and Type
    Method
    Description
    Disables all routes matching the criteria specified in the route manager and defined in the router it comes from.
    Enables all routes matching the criteria specified in the route manager and defined in the router it comes from.
    Finds all routes matching the criteria specified in the route manager and defined in the router it comes from.
    Removes all routes matching the criteria specified in the route manager and defined in the router it comes from.
    default E
    set(A resource)
    Sets the routes targeting the specified resource in the router and returns the router.
    default E
    set(Supplier<A> resourceFactory)
    Sets the routes targeting resources provided by the specified factory in the router and returns the router.
    set(Supplier<A> resourceFactory, Consumer<C> routeConfigurer)
    Sets the routes in the router targeting resources provided by the specified factory, configure the resulting routes with the specified configurer and returns the router.
  • Method Details

    • set

      default E set(A resource)

      Sets the routes targeting the specified resource in the router and returns the router.

      Note that the same resource instance is targeted by all the resulting routes created in the router.

      Parameters:
      resource - the target resource
      Returns:
      the router
    • set

      default E set(Supplier<A> resourceFactory)

      Sets the routes targeting resources provided by the specified factory in the router and returns the router.

      Unlike set(Object), each resulting routes target a different resource instance provided by the specified resource factory.

      Parameters:
      resourceFactory - a resource factory
      Returns:
      the router
    • set

      E set(Supplier<A> resourceFactory, Consumer<C> routeConfigurer)

      Sets the routes in the router targeting resources provided by the specified factory, configure the resulting routes with the specified configurer and returns the router.

      Unlike set(Object), each resulting routes target a different resource instance provided by the specified resource factory.

      The route configurer allows to post process the route before adding it to the server. This especially allows to set specific route information into the resource instance.

      Parameters:
      resourceFactory - a resource factory
      routeConfigurer - a route configurer
      Returns:
      the router
    • enable

      E enable()

      Enables all routes matching the criteria specified in the route manager and defined in the router it comes from.

      Returns:
      the router
    • disable

      E disable()

      Disables all routes matching the criteria specified in the route manager and defined in the router it comes from.

      Returns:
      the router
    • remove

      E remove()

      Removes all routes matching the criteria specified in the route manager and defined in the router it comes from.

      Returns:
      the router
    • findRoutes

      Set<C> findRoutes()

      Finds all routes matching the criteria specified in the route manager and defined in the router it comes from.

      Returns:
      a set of routes or an empty set if no route matches the criteria