Class RouteMatchers

java.lang.Object
org.forgerock.json.resource.RouteMatchers

public final class RouteMatchers extends Object
A utility class that contains methods for creating route matchers.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.forgerock.http.routing.ResourceApiVersionBehaviourManager
    Creates a new ResourceApiVersionBehaviourManager which is responsibly for managing whether warning headers are returned and the default version behaviour when the Accept-API-Version header is not present on the request.
    static org.forgerock.services.routing.RouteMatcher<Request>
    requestResourceApiVersionMatcher(org.forgerock.http.routing.Version version)
    Creates a RouteMatcher instance that matches the request resource API version with the provided version.
    static org.forgerock.services.routing.RouteMatcher<Request>
    requestUriMatcher(org.forgerock.http.routing.RoutingMode mode, String template)
    Creates a RouteMatcher instance that matches Requests with the provided mode and template.
    static Filter
    resourceApiVersionContextFilter(org.forgerock.http.routing.ResourceApiVersionBehaviourManager behaviourManager)
    Creates a Filter which MUST be placed, in the route, before any API Version routing takes place.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • requestUriMatcher

      public static org.forgerock.services.routing.RouteMatcher<Request> requestUriMatcher(org.forgerock.http.routing.RoutingMode mode, String template)
      Creates a RouteMatcher instance that matches Requests with the provided mode and template.
      Parameters:
      mode - The routing mode.
      template - The uri template.
      Returns:
      A RouteMatcher instance.
    • newResourceApiVersionBehaviourManager

      public static org.forgerock.http.routing.ResourceApiVersionBehaviourManager newResourceApiVersionBehaviourManager()
      Creates a new ResourceApiVersionBehaviourManager which is responsibly for managing whether warning headers are returned and the default version behaviour when the Accept-API-Version header is not present on the request.
      Returns:
      A new ResourceApiVersionBehaviourManager.
    • resourceApiVersionContextFilter

      public static Filter resourceApiVersionContextFilter(org.forgerock.http.routing.ResourceApiVersionBehaviourManager behaviourManager)
      Creates a Filter which MUST be placed, in the route, before any API Version routing takes place.

      The filter will add the required Contexts, default version behaviour and response headers.

      Parameters:
      behaviourManager - A ResourceApiVersionBehaviourManager instance.
      Returns:
      A Filter instance.
    • requestResourceApiVersionMatcher

      public static org.forgerock.services.routing.RouteMatcher<Request> requestResourceApiVersionMatcher(org.forgerock.http.routing.Version version)
      Creates a RouteMatcher instance that matches the request resource API version with the provided version.
      Parameters:
      version - The API version of the resource.
      Returns:
      A RouteMatcher instance.