Class MessageMatcherDelegatingAuthorizationManager.Builder
java.lang.Object
org.springframework.security.messaging.access.intercept.MessageMatcherDelegatingAuthorizationManager.Builder
- Enclosing class:
- MessageMatcherDelegatingAuthorizationManager
A builder for
MessageMatcherDelegatingAuthorizationManager
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal class
Represents the security constraint to be applied to theMessageMatcher
instances. -
Constructor Summary
Constructors -
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) Maps aList
ofSimpDestinationMessageMatcher
(orPathPatternMessageMatcher
if the application has configured aPathPatternMessageMatcher.Builder
bean) instances without regard to theSimpMessageType
.simpDestPathMatcher
(Supplier<org.springframework.util.PathMatcher> pathMatcher) Deprecated.simpDestPathMatcher
(org.springframework.util.PathMatcher pathMatcher) Deprecated.simpMessageDestMatchers
(String... patterns) Maps aList
ofSimpDestinationMessageMatcher
(orPathPatternMessageMatcher
if the application has configured aPathPatternMessageMatcher.Builder
bean) instances that match onSimpMessageType.MESSAGE
.simpSubscribeDestMatchers
(String... patterns) Maps aList
ofSimpDestinationMessageMatcher
(orPathPatternMessageMatcher
if the application has configured aPathPatternMessageMatcher.Builder
bean) instances that match onSimpMessageType.SUBSCRIBE
.simpTypeMatchers
(org.springframework.messaging.simp.SimpMessageType... typesToMatch) Maps aList
ofSimpMessageTypeMatcher
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
ofSimpMessageTypeMatcher
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
(orPathPatternMessageMatcher
if the application has configured aPathPatternMessageMatcher.Builder
bean) instances without regard to theSimpMessageType
. If no destination is found on the Message, then the Matcher returns false.- Parameters:
patterns
- the patterns to createMessageMatcher
s from.
-
simpMessageDestMatchers
public MessageMatcherDelegatingAuthorizationManager.Builder.Constraint simpMessageDestMatchers(String... patterns) Maps aList
ofSimpDestinationMessageMatcher
(orPathPatternMessageMatcher
if the application has configured aPathPatternMessageMatcher.Builder
bean) instances that match onSimpMessageType.MESSAGE
. If no destination is found on the Message, then the Matcher returns false.- Parameters:
patterns
- the patterns to createMessageMatcher
s from.
-
simpSubscribeDestMatchers
public MessageMatcherDelegatingAuthorizationManager.Builder.Constraint simpSubscribeDestMatchers(String... patterns) Maps aList
ofSimpDestinationMessageMatcher
(orPathPatternMessageMatcher
if the application has configured aPathPatternMessageMatcher.Builder
bean) instances that match onSimpMessageType.SUBSCRIBE
. If no destination is found on the Message, then the Matcher returns false.- Parameters:
patterns
- the patterns to createMessageMatcher
s from.
-
simpDestPathMatcher
@Deprecated public MessageMatcherDelegatingAuthorizationManager.Builder simpDestPathMatcher(org.springframework.util.PathMatcher pathMatcher) Deprecated.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
@Deprecated public MessageMatcherDelegatingAuthorizationManager.Builder simpDestPathMatcher(Supplier<org.springframework.util.PathMatcher> pathMatcher) Deprecated.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
-