Package net.shibboleth.idp.attribute.config

# Class BeanConfigurationLookupStrategy<T>

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.attribute.config.AbstractMetadataDrivenConfigurationLookupStrategy<T>
net.shibboleth.idp.attribute.config.BeanConfigurationLookupStrategy<T>

Type Parameters:
  `T` - type of bean

All Implemented Interfaces:
  `Function<BaseContext,T>`, `Component`, `DestructableComponent`, `InitializableComponent`, `Aware`, `ApplicationContextAware`

public class BeanConfigurationLookupStrategy<T> extends AbstractMetadataDrivenConfigurationLookupStrategy<T> implements ApplicationContextAware
A strategy function that examines SAML metadata associated with a relying party and derives bean-based configuration settings based on EntityAttribute extension tags.

Defaults to no caching of the result to avoid bean lifecycle issues if relying party config is reloaded.

Since:
  5.0.0

## Nested Class Summary

## Nested classes/interfaces inherited from class net.shibboleth.idp.attribute.config.AbstractMetadataDrivenConfigurationLookupStrategy

`AbstractMetadataDrivenConfigurationLookupStrategy.CachedConfigurationContext`

## Field Summary

Fields
Modifier and Type
Field
Description
`private ApplicationContext`
`applicationContext`
Enclosing Spring context.
`private static final org.slf4j.Logger`
`LOG`
Class logger.
`private Class<T>`
`propertyType`
Type of bean to return.

## Constructor Summary

Constructors
Constructor
Description
`BeanConfigurationLookupStrategy()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doInitialize()`
`protected T`
`doTranslate(IdPAttribute tag)`
Translate the value(s) into a setting of the appropriate type.
`protected T`
`doTranslate(Attribute tag)`
Translate the value(s) into a setting of the appropriate type.
`void`
`setApplicationContext(ApplicationContext context)`
`void`
`setPropertyType(Class<T> type)`
Set the type of bean to search for.
`private T`
`xmlObjectToBean(XMLObject object)`
Convert an XMLObject to a Spring bean reference if the type is supported.

### Methods inherited from class net.shibboleth.idp.attribute.config.AbstractMetadataDrivenConfigurationLookupStrategy

`apply, setDefaultValue, setDefaultValueStrategy, setEnableCaching, setExplicitPropertyName, setIgnoreUnmappedEntityAttributes, setLegacyPropertyName, setMessageMetadataLookupStrategy, setProfileAliases, setProfileIdLookupStrategy, setProfileMetadataLookupStrategy, setPropertyName, setStrictNameFormat`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized`

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

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

### Methods inherited from interface java.util.function.Function

`andThen, compose`

## Field Details

### LOG

@Nonnull private static final org.slf4j.Logger LOG
Class logger.

### applicationContext

@NonnullAfterInit private ApplicationContext applicationContext
Enclosing Spring context.

### propertyType

@NonnullAfterInit private Class<T> propertyType
Type of bean to return.

## Constructor Details

### BeanConfigurationLookupStrategy

public BeanConfigurationLookupStrategy()
Constructor.

## Method Details

### setPropertyType

public void setPropertyType(@Nonnull Class<T> type)
Set the type of bean to search for.

Parameters:
  `type` - bean type

### setApplicationContext

public void setApplicationContext(@Nonnull ApplicationContext context) throws BeansException

Specified by:
  `setApplicationContext` in interface `ApplicationContextAware`
Throws:
  `BeansException`

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractMetadataDrivenConfigurationLookupStrategy<T>`
Throws:
  `ComponentInitializationException`

### doTranslate

@Nullable protected T doTranslate(@Nonnull IdPAttribute tag)
Translate the value(s) into a setting of the appropriate type.

Overrides of this function can assume a non-zero collection of values.

Specified by:
  `doTranslate` in class `AbstractMetadataDrivenConfigurationLookupStrategy<T>`
Parameters:
  `tag` - tag to translate
Returns:
  the setting derived from the tag's value(s)

### doTranslate

@Nullable protected T doTranslate(@Nonnull Attribute tag)
Translate the value(s) into a setting of the appropriate type.

Overrides of this function can assume a non-zero collection of values.

Specified by:
  `doTranslate` in class `AbstractMetadataDrivenConfigurationLookupStrategy<T>`
Parameters:
  `tag` - tag to translate
Returns:
  the setting derived from the tag's value(s)

### xmlObjectToBean

@Nullable private T xmlObjectToBean(@Nonnull XMLObject object)
Convert an XMLObject to a Spring bean reference if the type is supported.

Parameters:
  `object` - object to convert
Returns:
  the converted value, or null