/** * Creates a new {@link CompositeServiceEntry} whose {@link Service} is bound at the specified path pattern. * * @see PathMapping#of(String) */ public static <I extends Request, O extends Response> CompositeServiceEntry<I, O> of(String pathPattern, Service<I, O> service) { return new CompositeServiceEntry<>(PathMapping.of(pathPattern), service); }
/** * Sets the path pattern of the service. */ public HttpServiceRegistrationBean setPathPattern(@NotNull String pathPattern) { return setPathMapping(PathMapping.of(pathPattern)); } }
/** * Sets the path pattern of the service. */ public HttpServiceRegistrationBean setPathPattern(@NotNull String pathPattern) { return setPathMapping(PathMapping.of(pathPattern)); } }
/** * Creates a new instance that redirects to the location constructed with the specified * {@code locationPattern}. * * @param redirectStatus the {@link HttpStatus} that the {@link Service} will return. * @param locationPattern the location pattern that is used to generate a redirect location. * * @throws IllegalArgumentException if the specified {@code locationPattern} is unsupported or invalid */ public RedirectService(HttpStatus redirectStatus, String locationPattern) { this(redirectStatus, toLocationFunction(locationPattern)); final Matcher m = PATTERN_PARAMS_START.matcher(locationPattern); if (m.find()) { paramNames = PathMapping.of(locationPattern.substring(m.start())).paramNames(); } }
/** * Binds the specified {@link Service} at the specified path pattern. e.g. * <ul> * <li>{@code /login} (no path parameters)</li> * <li>{@code /users/{userId}} (curly-brace style)</li> * <li>{@code /list/:productType/by/:ordering} (colon style)</li> * <li>{@code exact:/foo/bar} (exact match)</li> * <li>{@code prefix:/files} (prefix match)</li> * <li><code>glob:/~*/downloads/**</code> (glob pattern)</li> * <li>{@code regex:^/files/(?<filePath>.*)$} (regular expression)</li> * </ul> * * @throws IllegalArgumentException if the specified path pattern is invalid */ public B service(String pathPattern, Service<HttpRequest, HttpResponse> service) { service(PathMapping.of(pathPattern), service); return self(); }
/** * Sets the path pattern of the service. */ public HttpServiceRegistrationBean setPathPattern(@NotNull String pathPattern) { return setPathMapping(PathMapping.of(pathPattern)); } }
/** * Sets the path pattern of the service. */ public HttpServiceRegistrationBean setPathPattern(@NotNull String pathPattern) { return setPathMapping(PathMapping.of(pathPattern)); }
/** * Sets the path pattern of the service. */ public HttpServiceRegistrationBean setPathPattern(@NotNull String pathPattern) { return setPathMapping(PathMapping.of(pathPattern)); } }
/** * Sets the path pattern of the service. */ public HttpServiceRegistrationBean setPathPattern(@NotNull String pathPattern) { return setPathMapping(PathMapping.of(pathPattern)); }