Package org.springframework.security.access

# Interface SecurityMetadataSource

All Superinterfaces:
  `org.springframework.aop.framework.AopInfrastructureBean`

All Known Subinterfaces:
  `MethodSecurityMetadataSource`

All Known Implementing Classes:
  `AbstractFallbackMethodSecurityMetadataSource`, `AbstractMethodSecurityMetadataSource`, `DelegatingMethodSecurityMetadataSource`, `Jsr250MethodSecurityMetadataSource`, `MapBasedMethodSecurityMetadataSource`, `PrePostAnnotationSecurityMetadataSource`, `SecuredAnnotationSecurityMetadataSource`

public interface SecurityMetadataSource extends org.springframework.aop.framework.AopInfrastructureBean
Implemented by classes that store and can identify the `ConfigAttribute`s that applies to a given secure object invocation.

## Method Summary

Modifier and Type
Method
Description
`Collection<ConfigAttribute>`
`getAllConfigAttributes()`
If available, returns all of the `ConfigAttribute`s defined by the implementing class.
`Collection<ConfigAttribute>`
`getAttributes(Object object)`
Accesses the `ConfigAttribute`s that apply to a given secure object.
`boolean`
`supports(Class<?> clazz)`
Indicates whether the `SecurityMetadataSource` implementation is able to provide `ConfigAttribute`s for the indicated secure object type.

## Method Details

### getAttributes

Collection<ConfigAttribute> getAttributes(Object object) throws IllegalArgumentException
Accesses the `ConfigAttribute`s that apply to a given secure object.

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 the `SecurityMetadataSource` implementation

### getAllConfigAttributes

Collection<ConfigAttribute> getAllConfigAttributes()
If available, returns all of the `ConfigAttribute`s defined by the implementing class.

This is used by the `AbstractSecurityInterceptor` to perform startup time validation of each `ConfigAttribute` configured against it.

Returns:
  the `ConfigAttribute`s or `null` if unsupported

### supports

boolean supports(Class<?> clazz)
Indicates whether the `SecurityMetadataSource` implementation is able to provide `ConfigAttribute`s for the indicated secure object type.

Parameters:
  `clazz` - the class that is being queried
Returns:
  true if the implementation can process the indicated class