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 classRepresents the security constraint to be applied to theMessageMatcherinstances. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMaps anyMessageto a security expression.AuthorizationManager<org.springframework.messaging.Message<?>>build()matchers(MessageMatcher<?>... matchers) Maps aListofMessageMatcherinstances to a security expression.Maps anyMessagethat has a null SimpMessageHeaderAccessor destination header (i.e.simpDestMatchers(String... patterns) Maps aListofSimpDestinationMessageMatcher(orPathPatternMessageMatcherif the application has configured aPathPatternMessageMatcher.Builderbean) instances without regard to theSimpMessageType.simpDestPathMatcher(Supplier<org.springframework.util.PathMatcher> pathMatcher) Deprecated.simpDestPathMatcher(org.springframework.util.PathMatcher pathMatcher) Deprecated.simpMessageDestMatchers(String... patterns) Maps aListofSimpDestinationMessageMatcher(orPathPatternMessageMatcherif the application has configured aPathPatternMessageMatcher.Builderbean) instances that match onSimpMessageType.MESSAGE.simpSubscribeDestMatchers(String... patterns) Maps aListofSimpDestinationMessageMatcher(orPathPatternMessageMatcherif the application has configured aPathPatternMessageMatcher.Builderbean) instances that match onSimpMessageType.SUBSCRIBE.simpTypeMatchers(org.springframework.messaging.simp.SimpMessageType... typesToMatch) Maps aListofSimpMessageTypeMatcherinstances.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
anyMessage
Maps anyMessageto a security expression.- Returns:
- the Expression to associate
-
nullDestMatcher
Maps anyMessagethat 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 aListofSimpMessageTypeMatcherinstances.- Parameters:
typesToMatch- theSimpMessageTypeinstance to match on- Returns:
- the
MessageMatcherDelegatingAuthorizationManager.Builder.Constraintassociated to the matchers.
-
simpDestMatchers
public MessageMatcherDelegatingAuthorizationManager.Builder.Constraint simpDestMatchers(String... patterns) Maps aListofSimpDestinationMessageMatcher(orPathPatternMessageMatcherif the application has configured aPathPatternMessageMatcher.Builderbean) instances without regard to theSimpMessageType. If no destination is found on the Message, then the Matcher returns false.- Parameters:
patterns- the patterns to createMessageMatchers from.
-
simpMessageDestMatchers
public MessageMatcherDelegatingAuthorizationManager.Builder.Constraint simpMessageDestMatchers(String... patterns) Maps aListofSimpDestinationMessageMatcher(orPathPatternMessageMatcherif the application has configured aPathPatternMessageMatcher.Builderbean) instances that match onSimpMessageType.MESSAGE. If no destination is found on the Message, then the Matcher returns false.- Parameters:
patterns- the patterns to createMessageMatchers from.
-
simpSubscribeDestMatchers
public MessageMatcherDelegatingAuthorizationManager.Builder.Constraint simpSubscribeDestMatchers(String... patterns) Maps aListofSimpDestinationMessageMatcher(orPathPatternMessageMatcherif the application has configured aPathPatternMessageMatcher.Builderbean) instances that match onSimpMessageType.SUBSCRIBE. If no destination is found on the Message, then the Matcher returns false.- Parameters:
patterns- the patterns to createMessageMatchers from.
-
simpDestPathMatcher
@Deprecated public MessageMatcherDelegatingAuthorizationManager.Builder simpDestPathMatcher(org.springframework.util.PathMatcher pathMatcher) Deprecated.ThePathMatcherto be used with thesimpDestMatchers(String...). The default is to use the default constructor ofAntPathMatcher.- Parameters:
pathMatcher- thePathMatcherto use. Cannot be null.- Returns:
- the
MessageMatcherDelegatingAuthorizationManager.Builderfor further customization.
-
simpDestPathMatcher
@Deprecated public MessageMatcherDelegatingAuthorizationManager.Builder simpDestPathMatcher(Supplier<org.springframework.util.PathMatcher> pathMatcher) Deprecated.ThePathMatcherto be used with thesimpDestMatchers(String...). Use this method to delay the computation or lookup of thePathMatcher.- Parameters:
pathMatcher- thePathMatcherto use. Cannot be null.- Returns:
- the
MessageMatcherDelegatingAuthorizationManager.Builderfor further customization.
-
matchers
public MessageMatcherDelegatingAuthorizationManager.Builder.Constraint matchers(MessageMatcher<?>... matchers) Maps aListofMessageMatcherinstances to a security expression.- Parameters:
matchers- theMessageMatcherinstances to map.- Returns:
- The
MessageMatcherDelegatingAuthorizationManager.Builder.Constraintthat is associated to theMessageMatcherinstances
-
build
-