Class PathPatternMessageMatcher
java.lang.Object
org.springframework.security.messaging.util.matcher.PathPatternMessageMatcher
- All Implemented Interfaces:
MessageMatcher<Object>
Match
Message
s based on the message destination pattern using a
PathPattern
. There is also support for optionally matching on a specified
SimpMessageType
.- Since:
- 6.5
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A builder for specifying various elements of a message for the purpose of creating aPathPatternMessageMatcher
.Nested classes/interfaces inherited from interface org.springframework.security.messaging.util.matcher.MessageMatcher
MessageMatcher.MatchResult
-
Field Summary
FieldsFields inherited from interface org.springframework.security.messaging.util.matcher.MessageMatcher
ANY_MESSAGE
-
Method Summary
Modifier and TypeMethodDescriptionmatcher
(org.springframework.messaging.Message<?> message) Extract the path variables from theMessage
destination if the path is a match, otherwise theMessageMatcher.MatchResult.getVariables()
returns aCollections.emptyMap()
boolean
matches
(org.springframework.messaging.Message<?> message) Returns true if theMessage
matches, else falseInitialize this builder with thePathPatternParser.defaultInstance
that is configured with thePathContainer.Options.HTTP_PATH
separatorwithPathPatternParser
(org.springframework.web.util.pattern.PathPatternParser parser) Initialize this builder with the providedPathPatternParser
-
Field Details
-
NULL_DESTINATION_MATCHER
-
-
Method Details
-
withDefaults
Initialize this builder with thePathPatternParser.defaultInstance
that is configured with thePathContainer.Options.HTTP_PATH
separator -
withPathPatternParser
public static PathPatternMessageMatcher.Builder withPathPatternParser(org.springframework.web.util.pattern.PathPatternParser parser) Initialize this builder with the providedPathPatternParser
-
matches
public boolean matches(org.springframework.messaging.Message<?> message) Returns true if theMessage
matches, else false- Specified by:
matches
in interfaceMessageMatcher<Object>
- Parameters:
message
- theMessage
to match on- Returns:
- true if the
Message
matches, else false
-
matcher
Extract the path variables from theMessage
destination if the path is a match, otherwise theMessageMatcher.MatchResult.getVariables()
returns aCollections.emptyMap()
- Specified by:
matcher
in interfaceMessageMatcher<Object>
- Parameters:
message
- the message whose path variables to extract.- Returns:
- a
MatchResult
of the path variables and values.
-