Class DefaultMessageSecurityMetadataSource
java.lang.Object
org.springframework.security.messaging.access.intercept.DefaultMessageSecurityMetadataSource
- All Implemented Interfaces:
org.springframework.aop.framework.AopInfrastructureBean
,SecurityMetadataSource
,MessageSecurityMetadataSource
public final class DefaultMessageSecurityMetadataSource
extends Object
implements MessageSecurityMetadataSource
A default implementation of
MessageSecurityMetadataSource
that looks up the
ConfigAttribute
instances using a MessageMatcher
.
Each entry is considered in order. The first entry that matches, the corresponding
Collection<ConfigAttribute>
is returned.
- Since:
- 4.0
- See Also:
-
Constructor Summary
ConstructorDescriptionDefaultMessageSecurityMetadataSource
(LinkedHashMap<MessageMatcher<?>, Collection<ConfigAttribute>> messageMap) -
Method Summary
Modifier and TypeMethodDescriptionIf available, returns all of theConfigAttribute
s defined by the implementing class.getAttributes
(Object object) Accesses theConfigAttribute
s that apply to a given secure object.boolean
Indicates whether theSecurityMetadataSource
implementation is able to provideConfigAttribute
s for the indicated secure object type.
-
Constructor Details
-
DefaultMessageSecurityMetadataSource
public DefaultMessageSecurityMetadataSource(LinkedHashMap<MessageMatcher<?>, Collection<ConfigAttribute>> messageMap)
-
-
Method Details
-
getAttributes
Description copied from interface:SecurityMetadataSource
Accesses theConfigAttribute
s that apply to a given secure object.- Specified by:
getAttributes
in interfaceSecurityMetadataSource
- Parameters:
object
- the object being secured- Returns:
- the attributes that apply to the passed in secured object. Should return an empty collection if there are no applicable attributes.
- Throws:
IllegalArgumentException
- if the passed object is not of a type supported by theSecurityMetadataSource
implementation
-
getAllConfigAttributes
Description copied from interface:SecurityMetadataSource
If available, returns all of theConfigAttribute
s defined by the implementing class.This is used by the
AbstractSecurityInterceptor
to perform startup time validation of eachConfigAttribute
configured against it.- Specified by:
getAllConfigAttributes
in interfaceSecurityMetadataSource
- Returns:
- the
ConfigAttribute
s ornull
if unsupported
-
supports
Description copied from interface:SecurityMetadataSource
Indicates whether theSecurityMetadataSource
implementation is able to provideConfigAttribute
s for the indicated secure object type.- Specified by:
supports
in interfaceSecurityMetadataSource
- Parameters:
clazz
- the class that is being queried- Returns:
- true if the implementation can process the indicated class
-