Class RoutePredicateHandlerMapping
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.reactive.handler.AbstractHandlerMapping
org.springframework.cloud.gateway.handler.RoutePredicateHandlerMapping
- All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.context.ApplicationContextAware, org.springframework.core.Ordered, org.springframework.web.reactive.HandlerMapping
public class RoutePredicateHandlerMapping
extends org.springframework.web.reactive.handler.AbstractHandlerMapping
- Author:
- Spencer Gibb
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.springframework.web.reactive.handler.AbstractHandlerMapping
mappingsLoggerFields inherited from class org.springframework.context.support.ApplicationObjectSupport
loggerFields inherited from interface org.springframework.web.reactive.HandlerMapping
API_VERSION_ATTRIBUTE, BEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTEFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionRoutePredicateHandlerMapping(FilteringWebHandler webHandler, RouteLocator routeLocator, GlobalCorsProperties globalCorsProperties, org.springframework.core.env.Environment environment) -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable org.springframework.web.cors.CorsConfigurationgetCorsConfiguration(Object handler, org.springframework.web.server.ServerWebExchange exchange) protected reactor.core.publisher.Mono<?> getHandlerInternal(org.springframework.web.server.ServerWebExchange exchange) protected Stringprotected reactor.core.publisher.Mono<Route> lookupRoute(org.springframework.web.server.ServerWebExchange exchange) protected voidvalidateRoute(Route route, org.springframework.web.server.ServerWebExchange exchange) Validate the given handler against the current request.Methods inherited from class org.springframework.web.reactive.handler.AbstractHandlerMapping
formatMappingName, getApiVersionStrategy, getCorsProcessor, getHandler, getOrder, getPathPatternParser, hasCorsConfigurationSource, setApiVersionStrategy, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setOrder, setUseCaseSensitiveMatchMethods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext
-
Constructor Details
-
RoutePredicateHandlerMapping
public RoutePredicateHandlerMapping(FilteringWebHandler webHandler, RouteLocator routeLocator, GlobalCorsProperties globalCorsProperties, org.springframework.core.env.Environment environment)
-
-
Method Details
-
getHandlerInternal
protected reactor.core.publisher.Mono<?> getHandlerInternal(org.springframework.web.server.ServerWebExchange exchange) - Specified by:
getHandlerInternalin classorg.springframework.web.reactive.handler.AbstractHandlerMapping
-
getCorsConfiguration
protected @Nullable org.springframework.web.cors.CorsConfiguration getCorsConfiguration(Object handler, org.springframework.web.server.ServerWebExchange exchange) - Overrides:
getCorsConfigurationin classorg.springframework.web.reactive.handler.AbstractHandlerMapping
-
lookupRoute
protected reactor.core.publisher.Mono<Route> lookupRoute(org.springframework.web.server.ServerWebExchange exchange) -
validateRoute
protected void validateRoute(Route route, org.springframework.web.server.ServerWebExchange exchange) Validate the given handler against the current request.The default implementation is empty. Can be overridden in subclasses, for example to enforce specific preconditions expressed in URL mappings.
- Parameters:
route- the Route object to validateexchange- current exchange- Throws:
Exception- if validation failed
-
getSimpleName
-