Class BeforeFilterFunctions

java.lang.Object
org.springframework.cloud.gateway.server.mvc.filter.BeforeFilterFunctions

public abstract class BeforeFilterFunctions extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Default CircuitBreaker Fallback Execution Exception Message header name.
    static final String
    Default CircuitBreaker Fallback Execution Exception Type header name.
    static final String
    Default CircuitBreaker Root Cause Execution Exception Message header name.
    static final String
    Default CircuitBreaker Root Cause Execution Exception Type header name.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
    addRequestHeader(String name, String... values)
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
    addRequestParameter(String name, String... values)
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
    mapRequestHeader(String fromHeader, String toHeader)
     
    static <T, R> Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
    modifyRequestBody(Class<T> inClass, Class<R> outClass, String newContentType, BodyFilterFunctions.RewriteFunction<T,R> rewriteFunction)
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
    requestHeaderSize(String maxSize, String errorHeaderName)
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
    requestHeaderSize(org.springframework.util.unit.DataSize maxSize)
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
    requestHeaderSize(org.springframework.util.unit.DataSize maxSize, String errorHeaderName)
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
    requestSize(org.springframework.util.unit.DataSize maxSize)
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
    rewritePath(String regexp, String replacement)
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
    routeId(String routeId)
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
    Returns a filter function that strips the servlet context-path from the request URI.
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
    stripPrefix(int parts)
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
    uri(String uri)
     
    static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
    uri(URI uri)
     

    Methods inherited from class java.lang.Object

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

    • CB_EXECUTION_EXCEPTION_TYPE

      public static final String CB_EXECUTION_EXCEPTION_TYPE
      Default CircuitBreaker Fallback Execution Exception Type header name.
      See Also:
    • CB_EXECUTION_EXCEPTION_MESSAGE

      public static final String CB_EXECUTION_EXCEPTION_MESSAGE
      Default CircuitBreaker Fallback Execution Exception Message header name.
      See Also:
    • CB_ROOT_CAUSE_EXCEPTION_TYPE

      public static final String CB_ROOT_CAUSE_EXCEPTION_TYPE
      Default CircuitBreaker Root Cause Execution Exception Type header name.
      See Also:
    • CB_ROOT_CAUSE_EXCEPTION_MESSAGE

      public static final String CB_ROOT_CAUSE_EXCEPTION_MESSAGE
      Default CircuitBreaker Root Cause Execution Exception Message header name.
      See Also:
  • Method Details

    • adaptCachedBody

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> adaptCachedBody()
    • addRequestHeader

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> addRequestHeader(String name, String... values)
    • addRequestHeadersIfNotPresent

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> addRequestHeadersIfNotPresent(String... values)
    • addRequestHeadersIfNotPresent

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> addRequestHeadersIfNotPresent(List<KeyValues.KeyValue> keyValues)
    • addRequestParameter

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> addRequestParameter(String name, String... values)
    • fallbackHeaders

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> fallbackHeaders()
    • fallbackHeaders

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> fallbackHeaders(Consumer<BeforeFilterFunctions.FallbackHeadersConfig> configConsumer)
    • mapRequestHeader

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> mapRequestHeader(String fromHeader, String toHeader)
    • modifyRequestBody

      public static <T, R> Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> modifyRequestBody(Class<T> inClass, Class<R> outClass, String newContentType, BodyFilterFunctions.RewriteFunction<T,R> rewriteFunction)
    • prefixPath

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> prefixPath(String prefix)
    • preserveHostHeader

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> preserveHostHeader()
    • removeRequestHeader

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> removeRequestHeader(String name)
    • removeRequestParameter

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> removeRequestParameter(String name)
    • requestHeaderSize

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> requestHeaderSize(String maxSize)
    • requestHeaderSize

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> requestHeaderSize(String maxSize, String errorHeaderName)
    • requestHeaderSize

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> requestHeaderSize(org.springframework.util.unit.DataSize maxSize)
    • requestHeaderSize

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> requestHeaderSize(org.springframework.util.unit.DataSize maxSize, String errorHeaderName)
    • requestHeaderToRequestUri

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> requestHeaderToRequestUri(String name)
    • requestSize

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> requestSize(String maxSize)
    • requestSize

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> requestSize(org.springframework.util.unit.DataSize maxSize)
    • rewritePath

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> rewritePath(String regexp, String replacement)
    • rewriteRequestParameter

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> rewriteRequestParameter(String name, String replacement)
    • routeId

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> routeId(String routeId)
    • setPath

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> setPath(String path)
    • setRequestHeader

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> setRequestHeader(String name, String value)
    • setRequestHostHeader

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> setRequestHostHeader(String host)
    • stripContextPath

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> stripContextPath()
      Returns a filter function that strips the servlet context-path from the request URI. Users should add this filter before path-manipulating filters (StripPrefix, RewritePath, PrefixPath) when using server.servlet.context-path.
      Returns:
      a function that strips the context-path from the request URI
    • stripPrefix

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> stripPrefix()
    • stripPrefix

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> stripPrefix(int parts)
    • uri

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> uri(String uri)
    • uri

      public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> uri(URI uri)