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 anApplicationContext
or a class of anexisting 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
backedServerWebExchangeMatcher
. Can work directly with theApplicationContext
, obtain an existing bean orcreate a new bean
that is autowired in the usual way.- Since:
- 2.0.0
Constructor Summary
Constructors Constructor Description ApplicationContextServerWebExchangeMatcher(Class<? extends C> contextClass)
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Supplier<C>
getContext(org.springframework.web.server.ServerWebExchange exchange)
protected void
initialized(Supplier<C> context)
Called once the context has been initialized.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.
Constructor Detail
ApplicationContextServerWebExchangeMatcher
public ApplicationContextServerWebExchangeMatcher(Class<? extends C> contextClass)
Method Detail
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 interfaceorg.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 exchangecontext
- a supplier for the initialized context (may throw an exception)- Returns:
- if the exchange matches
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)