Class MessageMatcherDelegatingAuthorizationManager.Builder
java.lang.Object
org.springframework.security.messaging.access.intercept.MessageMatcherDelegatingAuthorizationManager.Builder
- Enclosing class:
- MessageMatcherDelegatingAuthorizationManager
A builder for
MessageMatcherDelegatingAuthorizationManager
.-
Nested Class Summary
Modifier and TypeClassDescriptionfinal class
Represents the security constraint to be applied to theMessageMatcher
instances. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionMaps anyMessage
to a security expression.AuthorizationManager<org.springframework.messaging.Message<?>>
build()
matchers
(MessageMatcher<?>... matchers) Maps aList
ofMessageMatcher
instances to a security expression.Maps anyMessage
that has a null SimpMessageHeaderAccessor destination header (i.e.simpDestMatchers
(String... patterns) simpDestPathMatcher
(Supplier<org.springframework.util.PathMatcher> pathMatcher) ThePathMatcher
to be used with thesimpDestMatchers(String...)
.simpDestPathMatcher
(org.springframework.util.PathMatcher pathMatcher) ThePathMatcher
to be used with thesimpDestMatchers(String...)
.simpMessageDestMatchers
(String... patterns) simpSubscribeDestMatchers
(String... patterns) simpTypeMatchers
(org.springframework.messaging.simp.SimpMessageType... typesToMatch) Maps aList
ofSimpDestinationMessageMatcher
instances.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
anyMessage
Maps anyMessage
to a security expression.- Returns:
- the Expression to associate
-
nullDestMatcher
Maps anyMessage
that has a null SimpMessageHeaderAccessor destination header (i.e. CONNECT, CONNECT_ACK, HEARTBEAT, UNSUBSCRIBE, DISCONNECT, DISCONNECT_ACK, OTHER)- Returns:
- the Expression to associate
-
simpTypeMatchers
public MessageMatcherDelegatingAuthorizationManager.Builder.Constraint simpTypeMatchers(org.springframework.messaging.simp.SimpMessageType... typesToMatch) Maps aList
ofSimpDestinationMessageMatcher
instances.- Parameters:
typesToMatch
- theSimpMessageType
instance to match on- Returns:
- the
MessageMatcherDelegatingAuthorizationManager.Builder.Constraint
associated to the matchers.
-
simpDestMatchers
public MessageMatcherDelegatingAuthorizationManager.Builder.Constraint simpDestMatchers(String... patterns) Maps aList
ofSimpDestinationMessageMatcher
instances without regard to theSimpMessageType
. If no destination is found on the Message, then the Matcher returns false.- Parameters:
patterns
- the patterns to createSimpDestinationMessageMatcher
from.
-
simpMessageDestMatchers
public MessageMatcherDelegatingAuthorizationManager.Builder.Constraint simpMessageDestMatchers(String... patterns) Maps aList
ofSimpDestinationMessageMatcher
instances that match onSimpMessageType.MESSAGE
. If no destination is found on the Message, then the Matcher returns false.- Parameters:
patterns
- the patterns to createSimpDestinationMessageMatcher
from.
-
simpSubscribeDestMatchers
public MessageMatcherDelegatingAuthorizationManager.Builder.Constraint simpSubscribeDestMatchers(String... patterns) Maps aList
ofSimpDestinationMessageMatcher
instances that match onSimpMessageType.SUBSCRIBE
. If no destination is found on the Message, then the Matcher returns false.- Parameters:
patterns
- the patterns to createSimpDestinationMessageMatcher
from.
-
simpDestPathMatcher
public MessageMatcherDelegatingAuthorizationManager.Builder simpDestPathMatcher(org.springframework.util.PathMatcher pathMatcher) ThePathMatcher
to be used with thesimpDestMatchers(String...)
. The default is to use the default constructor ofAntPathMatcher
.- Parameters:
pathMatcher
- thePathMatcher
to use. Cannot be null.- Returns:
- the
MessageMatcherDelegatingAuthorizationManager.Builder
for further customization.
-
simpDestPathMatcher
public MessageMatcherDelegatingAuthorizationManager.Builder simpDestPathMatcher(Supplier<org.springframework.util.PathMatcher> pathMatcher) ThePathMatcher
to be used with thesimpDestMatchers(String...)
. Use this method to delay the computation or lookup of thePathMatcher
.- Parameters:
pathMatcher
- thePathMatcher
to use. Cannot be null.- Returns:
- the
MessageMatcherDelegatingAuthorizationManager.Builder
for further customization.
-
matchers
public MessageMatcherDelegatingAuthorizationManager.Builder.Constraint matchers(MessageMatcher<?>... matchers) Maps aList
ofMessageMatcher
instances to a security expression.- Parameters:
matchers
- theMessageMatcher
instances to map.- Returns:
- The
MessageMatcherDelegatingAuthorizationManager.Builder.Constraint
that is associated to theMessageMatcher
instances
-
build
-