/** * Build a {@link org.glassfish.jersey.server.internal.routing.Router hierarchical request path matching processor}. * * @return hierarchical request path matching processor (i.e. router). */ public PathMatchingRouter build() { return new PathMatchingRouter(acceptedRoutes()); }
@Override public Continuation apply(RequestProcessingContext requestContext) { return Continuation.of(requestContext, getMethodRouter(requestContext)); } };
/** * Create a new request pre-processing stage that extracts a matched endpoint from a routing context, * where it was previously stored by the request routing stage and * (if available) returns the endpoint wrapped in a next terminal stage. * * This request pre-processing stage should be a final stage in the request processing chain. * * @return new matched endpoint extractor request pre-processing stage. */ public static Stage<RequestProcessingContext> matchedEndpointExtractor() { return new MatchedEndpointExtractorStage(); }
/** * Create new request path pattern matching router builder. * * @param pattern request path matching pattern. * @return new request path pattern matching router builder. */ static PathToRouterBuilder newRoute(final PathPattern pattern) { final PathMatchingRouterBuilder builder = new PathMatchingRouterBuilder(); builder.startNewRoute(pattern); return builder; }
/** * Create a routing stage builder for a given runtime resource model. * * @param resourceModel runtime resource model * @return new routing stage builder. */ public static Builder forModel(RuntimeResourceModel resourceModel) { return new Builder(resourceModel); }
/** * Complete the currently built unfinished sub-route (if any) and start building a new one. * * The completed sub-route is added to the list of the routes accepted by the router that is being built. * * @param pattern routing pattern for the new sub-route. * @return updated router builder. */ public PathToRouterBuilder route(final PathPattern pattern) { startNewRoute(pattern); return this; }
/** * Obtain a sub-resource locator router for given resource method. * * @param resourceMethod resource method to obtain the router for. * @return sub-resource locator router. */ Router getRouter(final ResourceMethod resourceMethod) { return new SubResourceLocatorRouter(createServiceFunction, valueSuppliers, resourceMethod, resourceContext, this); }
/** * Create a new request route. * * @param routingPattern request path routing pattern. * @param routers next-level routers to be processed in case the routing * pattern matches the unmatched right-hand part of the request path. * @return new request route. */ static Route of(PathPattern routingPattern, List<Router> routers) { return new Route(routingPattern, routers); }
/** * Create a terminal continuation from the routed request. * * @param result routed request. * @return terminal continuation with no {@link #next() next level routers} * in the routing hierarchy and the supplied routed request. */ static Continuation of(final RequestProcessingContext result) { return new Continuation(result, null); }
/** * Construct a match result matching the whole supplied path. * * @param path matched path. */ public SingleMatchResult(final String path) { this.path = stripMatrixParams(path); }
/** * Build a {@link org.glassfish.jersey.server.internal.routing.Router hierarchical request path matching processor}. * * @return hierarchical request path matching processor (i.e. router). */ public PathMatchingRouter build() { return new PathMatchingRouter(acceptedRoutes()); }
@Override public Continuation apply(final RequestProcessingContext data) { return Continuation.of(data); } };
/** * Create a new request pre-processing stage that extracts a matched endpoint from a routing context, * where it was previously stored by the request routing stage and * (if available) returns the endpoint wrapped in a next terminal stage. * * This request pre-processing stage should be a final stage in the request processing chain. * * @return new matched endpoint extractor request pre-processing stage. */ public static Stage<RequestProcessingContext> matchedEndpointExtractor() { return new MatchedEndpointExtractorStage(); }
/** * Complete the currently built unfinished sub-route (if any) and start building a new one. * * The completed sub-route is added to the list of the routes accepted by the router that is being built. * * @param pattern routing pattern for the new sub-route. * @return updated router builder. */ public PathToRouterBuilder route(final PathPattern pattern) { startNewRoute(pattern); return this; }
/** * Obtain a sub-resource locator router for given resource method. * * @param resourceMethod resource method to obtain the router for. * @return sub-resource locator router. */ Router getRouter(final ResourceMethod resourceMethod) { return new SubResourceLocatorRouter(createServiceFunction, valueSuppliers, resourceMethod, resourceContext, this); }
/** * Create a new request route. * * @param routingPattern request path routing pattern. * @param routers next-level routers to be processed in case the routing * pattern matches the unmatched right-hand part of the request path. * @return new request route. */ static Route of(PathPattern routingPattern, List<Router> routers) { return new Route(routingPattern, routers); }
@Override public Continuation apply(final RequestProcessingContext data) { return Continuation.of(data); } };
@Override public Continuation apply(RequestProcessingContext requestContext) { return Continuation.of(requestContext, getMethodRouter(requestContext)); } };