Class PathPatternMessageMatcher
java.lang.Object
org.springframework.security.messaging.util.matcher.PathPatternMessageMatcher
- All Implemented Interfaces:
MessageMatcher<Object>
Match
Messages 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 classA 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 theMessagedestination if the path is a match, otherwise theMessageMatcher.MatchResult.getVariables()returns aCollections.emptyMap()booleanmatches(org.springframework.messaging.Message<?> message) Returns true if theMessagematches, else falseInitialize this builder with thePathPatternParser.defaultInstancethat is configured with thePathContainer.Options.HTTP_PATHseparatorwithPathPatternParser(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.defaultInstancethat is configured with thePathContainer.Options.HTTP_PATHseparator -
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 theMessagematches, else false- Specified by:
matchesin interfaceMessageMatcher<Object>- Parameters:
message- theMessageto match on- Returns:
- true if the
Messagematches, else false
-
matcher
Extract the path variables from theMessagedestination if the path is a match, otherwise theMessageMatcher.MatchResult.getVariables()returns aCollections.emptyMap()- Specified by:
matcherin interfaceMessageMatcher<Object>- Parameters:
message- the message whose path variables to extract.- Returns:
- a
MatchResultof the path variables and values.
-