public class MessageSecurityMetadataSourceRegistry extends Object
MessageMatcher
to the security
expressions.Modifier and Type | Class and Description |
---|---|
class |
MessageSecurityMetadataSourceRegistry.Constraint
Represents the security constraint to be applied to the
MessageMatcher
instances. |
Constructor and Description |
---|
MessageSecurityMetadataSourceRegistry() |
public MessageSecurityMetadataSourceRegistry()
public MessageSecurityMetadataSourceRegistry.Constraint anyMessage()
Message
to a security expression.public MessageSecurityMetadataSourceRegistry.Constraint nullDestMatcher()
Message
that has a null SimpMessageHeaderAccessor destination
header (i.e. CONNECT, CONNECT_ACK, HEARTBEAT, UNSUBSCRIBE, DISCONNECT,
DISCONNECT_ACK, OTHER)public MessageSecurityMetadataSourceRegistry.Constraint simpTypeMatchers(org.springframework.messaging.simp.SimpMessageType... typesToMatch)
List
of SimpDestinationMessageMatcher
instances.typesToMatch
- the SimpMessageType
instance to match onMessageSecurityMetadataSourceRegistry.Constraint
associated to the matchers.public MessageSecurityMetadataSourceRegistry.Constraint simpDestMatchers(String... patterns)
List
of SimpDestinationMessageMatcher
instances without
regard to the SimpMessageType
. If no destination is found on the Message,
then the Matcher returns false.patterns
- the patterns to create
SimpDestinationMessageMatcher
from. Uses
simpDestPathMatcher(PathMatcher)
.MessageSecurityMetadataSourceRegistry.Constraint
that is associated to the MessageMatcher
simpDestPathMatcher(PathMatcher)
public MessageSecurityMetadataSourceRegistry.Constraint simpMessageDestMatchers(String... patterns)
List
of SimpDestinationMessageMatcher
instances that match
on SimpMessageType.MESSAGE
. If no destination is found on the Message, then
the Matcher returns false.patterns
- the patterns to create
SimpDestinationMessageMatcher
from. Uses
simpDestPathMatcher(PathMatcher)
.MessageSecurityMetadataSourceRegistry.Constraint
that is associated to the MessageMatcher
simpDestPathMatcher(PathMatcher)
public MessageSecurityMetadataSourceRegistry.Constraint simpSubscribeDestMatchers(String... patterns)
List
of SimpDestinationMessageMatcher
instances that match
on SimpMessageType.SUBSCRIBE
. If no destination is found on the Message,
then the Matcher returns false.patterns
- the patterns to create
SimpDestinationMessageMatcher
from. Uses
simpDestPathMatcher(PathMatcher)
.MessageSecurityMetadataSourceRegistry.Constraint
that is associated to the MessageMatcher
simpDestPathMatcher(PathMatcher)
public MessageSecurityMetadataSourceRegistry simpDestPathMatcher(PathMatcher pathMatcher)
PathMatcher
to be used with the
simpDestMatchers(String...)
. The
default is to use the default constructor of AntPathMatcher
.pathMatcher
- the PathMatcher
to use. Cannot be null.MessageSecurityMetadataSourceRegistry
for further
customization.protected boolean isSimpDestPathMatcherConfigured()
simpDestPathMatcher(PathMatcher)
has been explicitly set.simpDestPathMatcher(PathMatcher)
has been explicitly set, else false.public MessageSecurityMetadataSourceRegistry.Constraint matchers(MessageMatcher<?>... matchers)
List
of MessageMatcher
instances to a security expression.matchers
- the MessageMatcher
instances to map.MessageSecurityMetadataSourceRegistry.Constraint
that is associated to the MessageMatcher
instancespublic MessageSecurityMetadataSourceRegistry expressionHandler(SecurityExpressionHandler<org.springframework.messaging.Message<Object>> expressionHandler)
SecurityExpressionHandler
to be used. The
default is to use DefaultMessageSecurityExpressionHandler
.expressionHandler
- the SecurityExpressionHandler
to use. Cannot be null.MessageSecurityMetadataSourceRegistry
for further
customization.protected MessageSecurityMetadataSource createMetadataSource()
MessageSecurityMetadataSource
.
This is not exposed so as not to confuse users of the API, which should never invoke this method.
MessageSecurityMetadataSource
to useprotected boolean containsMapping()
This is not exposed so as not to confuse users of the API, which should never need to invoke this method.