Interface WebRouteManager<A extends ExchangeContext,B extends WebRoutable<A,B>>

Type Parameters:
A - the type of the exchange context
B - the type of web routable
All Superinterfaces:
RouteManager<A,WebExchange<A>,B,WebRouteManager<A,B>,WebRoute<A>>

public interface WebRouteManager<A extends ExchangeContext,B extends WebRoutable<A,B>> extends RouteManager<A,WebExchange<A>,B,WebRouteManager<A,B>,WebRoute<A>>

A web route manager is used to manage web routes in a web router.

It is created by a web router and allows to define, enable, disable, remove and find routes in a web router.

Since:
1.0
Author:
Jeremy Kuhn
See Also:
  • Method Details

    • path

      default WebRouteManager<A,B> path(String path) throws IllegalArgumentException

      Specifies the path to the resource served by the web route without matching trailing slash.

      The specified path can be a parameterized path including path parameters as defined by URIBuilder.

      Parameters:
      path - the path to the resource
      Returns:
      the web route manager
      Throws:
      IllegalArgumentException - if the specified path is not absolute
      See Also:
    • path

      WebRouteManager<A,B> path(String path, boolean matchTrailingSlash) throws IllegalArgumentException

      Specifies the path to the resource served by the web route matching or not trailing slash.

      The specified path can be a parameterized path including path parameters as defined by URIBuilder.

      Parameters:
      path - the path to the resource
      matchTrailingSlash - true to match path with or without trailing slash, false otherwise
      Returns:
      the web route manager
      Throws:
      IllegalArgumentException - if the specified path is not absolute
      See Also:
    • method

      WebRouteManager<A,B> method(Method method)

      Specifies the method used to access the resource served by the web route.

      Parameters:
      method - a HTTP method
      Returns:
      the web route manager
    • consumes

      WebRouteManager<A,B> consumes(String mediaRange)

      Specifies the media range defining the content types accepted by the resource served by the web route as defined by RFC 7231 Section 5.3.2.

      Parameters:
      mediaRange - a media range
      Returns:
      the web route manager
      See Also:
    • produces

      WebRouteManager<A,B> produces(String mediaType)

      Specifies the media type of the resource served by the web route.

      Parameters:
      mediaType - a media type
      Returns:
      the web route manager
      See Also:
    • language

      WebRouteManager<A,B> language(String language)

      Specifies the language of the resource served by the web route.

      Parameters:
      language - a language tag
      Returns:
      the web route manager
      See Also: