Class ApplicationContextServerWebExchangeMatcher<C>

java.lang.Object
org.springframework.boot.security.reactive.ApplicationContextServerWebExchangeMatcher<C>
Type Parameters:
C - the type of the context that the match method actually needs to use. Can be an ApplicationContext or a class of an existing bean.
All Implemented Interfaces:
org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher

public abstract class ApplicationContextServerWebExchangeMatcher<C> extends Object implements org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher
ApplicationContext backed ServerWebExchangeMatcher. Can work directly with the ApplicationContext, obtain an existing bean or create a new bean that is autowired in the usual way.
Since:
2.0.0
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher

    org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher.MatchResult
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Supplier<C>
    getContext(org.springframework.web.server.ServerWebExchange exchange)
     
    protected boolean
    ignoreApplicationContext(org.springframework.context.ApplicationContext applicationContext)
    Returns if the ApplicationContext should be ignored and not used for matching.
    protected void
    Called once the context has been initialized.
    final reactor.core.publisher.Mono<org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher.MatchResult>
    matches(org.springframework.web.server.ServerWebExchange exchange)
     
    protected abstract reactor.core.publisher.Mono<org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher.MatchResult>
    matches(org.springframework.web.server.ServerWebExchange exchange, Supplier<C> context)
    Decides whether the rule implemented by the strategy matches the supplied exchange.

    Methods inherited from class java.lang.Object

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

    • ApplicationContextServerWebExchangeMatcher

      public ApplicationContextServerWebExchangeMatcher(Class<? extends C> contextClass)
  • Method Details

    • matches

      public final reactor.core.publisher.Mono<org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher.MatchResult> matches(org.springframework.web.server.ServerWebExchange exchange)
      Specified by:
      matches in interface org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher
    • matches

      protected abstract reactor.core.publisher.Mono<org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher.MatchResult> matches(org.springframework.web.server.ServerWebExchange exchange, Supplier<C> context)
      Decides whether the rule implemented by the strategy matches the supplied exchange.
      Parameters:
      exchange - the source exchange
      context - a supplier for the initialized context (may throw an exception)
      Returns:
      if the exchange matches
    • ignoreApplicationContext

      protected boolean ignoreApplicationContext(org.springframework.context.ApplicationContext applicationContext)
      Returns if the ApplicationContext should be ignored and not used for matching. If this method returns true then the context will not be used and the matches method will return false.
      Parameters:
      applicationContext - the candidate application context
      Returns:
      if the application context should be ignored
      Since:
      2.2.5
    • getContext

      protected Supplier<C> getContext(org.springframework.web.server.ServerWebExchange exchange)
    • initialized

      protected void initialized(Supplier<C> context)
      Called once the context has been initialized.
      Parameters:
      context - a supplier for the initialized context (may throw an exception)