Package org.springframework.security.config.annotation.web.messaging

# Class MessageSecurityMetadataSourceRegistry

java.lang.Object
org.springframework.security.config.annotation.web.messaging.MessageSecurityMetadataSourceRegistry

@Deprecated public class MessageSecurityMetadataSourceRegistry extends Object
Deprecated.
Use `MessageMatcherDelegatingAuthorizationManager` instead
Allows mapping security constraints using `MessageMatcher` to the security expressions.

Since:
  4.0

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`final class`
`MessageSecurityMetadataSourceRegistry.Constraint`
Deprecated.
Represents the security constraint to be applied to the `MessageMatcher` instances.

## Constructor Summary

Constructors
Constructor
Description
`MessageSecurityMetadataSourceRegistry()`
Deprecated.

## Method Summary

Modifier and Type
Method
Description
`MessageSecurityMetadataSourceRegistry.Constraint`
`anyMessage()`
Deprecated.
Maps any `Message` to a security expression.
`protected boolean`
`containsMapping()`
Deprecated.
Allows determining if a mapping was added.
`protected org.springframework.security.messaging.access.intercept.MessageSecurityMetadataSource`
`createMetadataSource()`
Deprecated.
Allows subclasses to create creating a `MessageSecurityMetadataSource`.
`MessageSecurityMetadataSourceRegistry`
`expressionHandler(org.springframework.security.access.expression.SecurityExpressionHandler<org.springframework.messaging.Message<Object>> expressionHandler)`
Deprecated.
The `SecurityExpressionHandler` to be used.
`protected boolean`
`isSimpDestPathMatcherConfigured()`
Deprecated.
Determines if the `simpDestPathMatcher(PathMatcher)` has been explicitly set.
`MessageSecurityMetadataSourceRegistry.Constraint`
`matchers(org.springframework.security.messaging.util.matcher.MessageMatcher<?>... matchers)`
Deprecated.
Maps a `List` of `MessageMatcher` instances to a security expression.
`MessageSecurityMetadataSourceRegistry.Constraint`
`nullDestMatcher()`
Deprecated.
Maps any `Message` that has a null SimpMessageHeaderAccessor destination header (i.e.
`MessageSecurityMetadataSourceRegistry.Constraint`
`simpDestMatchers(String... patterns)`
Deprecated.
Maps a `List` of `SimpDestinationMessageMatcher` instances without regard to the `SimpMessageType`.
`MessageSecurityMetadataSourceRegistry`
`simpDestPathMatcher(org.springframework.util.PathMatcher pathMatcher)`
Deprecated.
The `PathMatcher` to be used with the `simpDestMatchers(String...)`.
`MessageSecurityMetadataSourceRegistry.Constraint`
`simpMessageDestMatchers(String... patterns)`
Deprecated.
Maps a `List` of `SimpDestinationMessageMatcher` instances that match on `SimpMessageType.MESSAGE`.
`MessageSecurityMetadataSourceRegistry.Constraint`
`simpSubscribeDestMatchers(String... patterns)`
Deprecated.
Maps a `List` of `SimpDestinationMessageMatcher` instances that match on `SimpMessageType.SUBSCRIBE`.
`MessageSecurityMetadataSourceRegistry.Constraint`
`simpTypeMatchers(org.springframework.messaging.simp.SimpMessageType... typesToMatch)`
Deprecated.
Maps a `List` of `SimpDestinationMessageMatcher` instances.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### MessageSecurityMetadataSourceRegistry

public MessageSecurityMetadataSourceRegistry()
Deprecated.

## Method Details

### anyMessage

public MessageSecurityMetadataSourceRegistry.Constraint anyMessage()
Deprecated.
Maps any `Message` to a security expression.

Returns:
  the Expression to associate

### nullDestMatcher

public MessageSecurityMetadataSourceRegistry.Constraint nullDestMatcher()
Deprecated.
Maps any `Message` that has a null SimpMessageHeaderAccessor destination header (i.e. CONNECT, CONNECT_ACK, HEARTBEAT, UNSUBSCRIBE, DISCONNECT, DISCONNECT_ACK, OTHER)

Returns:
  the Expression to associate

### simpTypeMatchers

public MessageSecurityMetadataSourceRegistry.Constraint simpTypeMatchers(org.springframework.messaging.simp.SimpMessageType... typesToMatch)
Deprecated.
Maps a `List` of `SimpDestinationMessageMatcher` instances.

Parameters:
  `typesToMatch` - the `SimpMessageType` instance to match on
Returns:
  the `MessageSecurityMetadataSourceRegistry.Constraint` associated to the matchers.

### simpDestMatchers

public MessageSecurityMetadataSourceRegistry.Constraint simpDestMatchers(String... patterns)
Deprecated.
Maps a `List` of `SimpDestinationMessageMatcher` instances without regard to the `SimpMessageType`. If no destination is found on the Message, then the Matcher returns false.

Parameters:
  `patterns` - the patterns to create `SimpDestinationMessageMatcher` from. Uses `simpDestPathMatcher(PathMatcher)` .
Returns:
  the `MessageSecurityMetadataSourceRegistry.Constraint` that is associated to the `MessageMatcher`
See Also:
  - `simpDestPathMatcher(PathMatcher)`

### simpMessageDestMatchers

public MessageSecurityMetadataSourceRegistry.Constraint simpMessageDestMatchers(String... patterns)
Deprecated.
Maps a `List` of `SimpDestinationMessageMatcher` instances that match on `SimpMessageType.MESSAGE`. If no destination is found on the Message, then the Matcher returns false.

Parameters:
  `patterns` - the patterns to create `SimpDestinationMessageMatcher` from. Uses `simpDestPathMatcher(PathMatcher)`.
Returns:
  the `MessageSecurityMetadataSourceRegistry.Constraint` that is associated to the `MessageMatcher`
See Also:
  - `simpDestPathMatcher(PathMatcher)`

### simpSubscribeDestMatchers

public MessageSecurityMetadataSourceRegistry.Constraint simpSubscribeDestMatchers(String... patterns)
Deprecated.
Maps a `List` of `SimpDestinationMessageMatcher` instances that match on `SimpMessageType.SUBSCRIBE`. If no destination is found on the Message, then the Matcher returns false.

Parameters:
  `patterns` - the patterns to create `SimpDestinationMessageMatcher` from. Uses `simpDestPathMatcher(PathMatcher)`.
Returns:
  the `MessageSecurityMetadataSourceRegistry.Constraint` that is associated to the `MessageMatcher`
See Also:
  - `simpDestPathMatcher(PathMatcher)`

### simpDestPathMatcher

public MessageSecurityMetadataSourceRegistry simpDestPathMatcher(org.springframework.util.PathMatcher pathMatcher)
Deprecated.
The `PathMatcher` to be used with the `simpDestMatchers(String...)`. The default is to use the default constructor of `AntPathMatcher`.

Parameters:
  `pathMatcher` - the `PathMatcher` to use. Cannot be null.
Returns:
  the `MessageSecurityMetadataSourceRegistry` for further customization.

### isSimpDestPathMatcherConfigured

protected boolean isSimpDestPathMatcherConfigured()
Deprecated.
Determines if the `simpDestPathMatcher(PathMatcher)` has been explicitly set.

Returns:
  true if `simpDestPathMatcher(PathMatcher)` has been explicitly set, else false.

### matchers

public MessageSecurityMetadataSourceRegistry.Constraint matchers(org.springframework.security.messaging.util.matcher.MessageMatcher<?>... matchers)
Deprecated.
Maps a `List` of `MessageMatcher` instances to a security expression.

Parameters:
  `matchers` - the `MessageMatcher` instances to map.
Returns:
  The `MessageSecurityMetadataSourceRegistry.Constraint` that is associated to the `MessageMatcher` instances

### expressionHandler

public MessageSecurityMetadataSourceRegistry expressionHandler(org.springframework.security.access.expression.SecurityExpressionHandler<org.springframework.messaging.Message<Object>> expressionHandler)
Deprecated.
The `SecurityExpressionHandler` to be used. The default is to use `DefaultMessageSecurityExpressionHandler`.

Parameters:
  `expressionHandler` - the `SecurityExpressionHandler` to use. Cannot be null.
Returns:
  the `MessageSecurityMetadataSourceRegistry` for further customization.

### createMetadataSource

protected org.springframework.security.messaging.access.intercept.MessageSecurityMetadataSource createMetadataSource()
Deprecated.
Allows subclasses to create creating a `MessageSecurityMetadataSource`.

This is not exposed so as not to confuse users of the API, which should never invoke this method.

Returns:
  the `MessageSecurityMetadataSource` to use

### containsMapping

protected boolean containsMapping()
Deprecated.
Allows determining if a mapping was added.

This is not exposed so as not to confuse users of the API, which should never need to invoke this method.

Returns:
  true if a mapping was added, else false