Class SimpDestinationMessageMatcher
java.lang.Object
org.springframework.security.messaging.util.matcher.SimpDestinationMessageMatcher
- All Implemented Interfaces:
- MessageMatcher<Object>
 MessageMatcher which compares a pre-defined pattern against the destination of a
 Message. There is also support for optionally matching on a specified
 SimpMessageType.
 
- Since:
- 4.0
- 
Field SummaryFieldsFields inherited from interface org.springframework.security.messaging.util.matcher.MessageMatcherANY_MESSAGE
- 
Constructor SummaryConstructorsConstructorDescriptionSimpDestinationMessageMatcher(String pattern) Creates a new instance with the specified pattern, nullSimpMessageType(matches any type), and aAntPathMatchercreated from the default constructor.SimpDestinationMessageMatcher(String pattern, org.springframework.util.PathMatcher pathMatcher) Creates a new instance with the specified pattern andPathMatcher.
- 
Method SummaryModifier and TypeMethodDescriptioncreateMessageMatcher(String pattern, org.springframework.util.PathMatcher matcher) Creates a new instance with the specified pattern,SimpMessageType.MESSAGE, andPathMatcher.createSubscribeMatcher(String pattern, org.springframework.util.PathMatcher matcher) Creates a new instance with the specified pattern,SimpMessageType.SUBSCRIBE, andPathMatcher.extractPathVariables(org.springframework.messaging.Message<?> message) booleanmatches(org.springframework.messaging.Message<?> message) Returns true if theMessagematches, else falsetoString()
- 
Field Details- 
NULL_DESTINATION_MATCHER
 
- 
- 
Constructor Details- 
SimpDestinationMessageMatcherCreates a new instance with the specified pattern, null SimpMessageType(matches any type), and aAntPathMatchercreated from the default constructor.The mapping matches destinations despite the using the following rules: - ? matches one character
- * matches zero or more characters
- ** matches zero or more 'directories' in a path
 Some examples: - com/t?st.jsp- matches- com/testbut also- com/tastor- com/txst
- com/*suffix- matches all files ending in- suffixin the- comdirectory
- com/**/test- matches all destinations ending with- testunderneath the- compath
 - Parameters:
- pattern- the pattern to use
 
- 
SimpDestinationMessageMatcherpublic SimpDestinationMessageMatcher(String pattern, org.springframework.util.PathMatcher pathMatcher) Creates a new instance with the specified pattern and PathMatcher.- Parameters:
- pattern- the pattern to use
- pathMatcher- the- PathMatcherto use.
 
 
- 
- 
Method Details- 
matchespublic boolean matches(org.springframework.messaging.Message<?> message) Description copied from interface:MessageMatcherReturns true if theMessagematches, else false- Specified by:
- matchesin interface- MessageMatcher<Object>
- Parameters:
- message- the- Messageto match on
- Returns:
- true if the Messagematches, else false
 
- 
extractPathVariables
- 
getMessageTypeMatcher
- 
toString
- 
createSubscribeMatcherpublic static SimpDestinationMessageMatcher createSubscribeMatcher(String pattern, org.springframework.util.PathMatcher matcher) Creates a new instance with the specified pattern, SimpMessageType.SUBSCRIBE, andPathMatcher.- Parameters:
- pattern- the pattern to use
- matcher- the- PathMatcherto use.
 
- 
createMessageMatcherpublic static SimpDestinationMessageMatcher createMessageMatcher(String pattern, org.springframework.util.PathMatcher matcher) Creates a new instance with the specified pattern, SimpMessageType.MESSAGE, andPathMatcher.- Parameters:
- pattern- the pattern to use
- matcher- the- PathMatcherto use.
 
 
-