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
    Modifier and Type
    Class
    Description
    static enum 
     
  • Field Summary

    Fields inherited from class org.springframework.web.reactive.handler.AbstractHandlerMapping

    mappingsLogger

    Fields inherited from class org.springframework.context.support.ApplicationObjectSupport

    logger

    Fields 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_ATTRIBUTE

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor
    Description
    RoutePredicateHandlerMapping(FilteringWebHandler webHandler, RouteLocator routeLocator, GlobalCorsProperties globalCorsProperties, org.springframework.core.env.Environment environment)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected @Nullable org.springframework.web.cors.CorsConfiguration
    getCorsConfiguration(Object handler, org.springframework.web.server.ServerWebExchange exchange)
     
    protected reactor.core.publisher.Mono<?>
    getHandlerInternal(org.springframework.web.server.ServerWebExchange exchange)
     
    protected String
     
    protected reactor.core.publisher.Mono<Route>
    lookupRoute(org.springframework.web.server.ServerWebExchange exchange)
     
    protected void
    validateRoute(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, setUseCaseSensitiveMatch

    Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

    getApplicationContext, getMessageSourceAccessor, initApplicationContext, initApplicationContext, isContextRequired, obtainApplicationContext, requiredContextClass, setApplicationContext

    Methods inherited from class Object

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

  • Method Details

    • getHandlerInternal

      protected reactor.core.publisher.Mono<?> getHandlerInternal(org.springframework.web.server.ServerWebExchange exchange)
      Specified by:
      getHandlerInternal in class org.springframework.web.reactive.handler.AbstractHandlerMapping
    • getCorsConfiguration

      protected @Nullable org.springframework.web.cors.CorsConfiguration getCorsConfiguration(Object handler, org.springframework.web.server.ServerWebExchange exchange)
      Overrides:
      getCorsConfiguration in class org.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 validate
      exchange - current exchange
      Throws:
      Exception - if validation failed
    • getSimpleName

      protected String getSimpleName()