Package net.shibboleth.spring.metadata

# Class AbstractMetadataProviderParser

java.lang.Object
org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
net.shibboleth.shared.spring.custom.AbstractCustomBeanDefinitionParser
net.shibboleth.spring.metadata.AbstractMetadataProviderParser

All Implemented Interfaces:
  `BeanDefinitionParser`

Direct Known Subclasses:
  `AbstractDynamicMetadataProviderParser`, `AbstractReloadingMetadataProviderParser`, `ChainingMetadataProviderParser`, `InlineMetadataProviderParser`

public abstract class AbstractMetadataProviderParser extends AbstractCustomBeanDefinitionParser
Parser for the MetadataProviderType in the `urn:mace:shibboleth:2.0:metadata` namespace. If we are the top most element then we need to summon up a `MetadataProviderContainer` and inject what we would usually create into that.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final String`
`autoWiredNodeProcessingRef`
Bean ID for defaulted `AutoWiredNodeProcessingMetadataFilter` instance.
`private final String`
`byReferenceBridgeRef`
Bean ID for defaulted `ByReferenceMetadataFilterBridge` instance.
`static final QName`
`CHAINING_PROVIDER_ELEMENT_NAME`
ChainingMetadataProviderElement name.
`private final org.slf4j.Logger`
`log`
Logger.
`static final QName`
`METADATA_FILTER_ELEMENT_NAME`
MetadataFilter Element name.
`static final String`
`METADATA_NAMESPACE`
Namespace for Metadata.
`static final String`
`SECURITY_NAMESPACE`
Namespace for Security.
`static final QName`
`TRUST_ENGINE_ELEMENT_NAME`
TrustEngine Element name.

### Fields inherited from class net.shibboleth.shared.spring.custom.AbstractCustomBeanDefinitionParser

`CUSTOM_PARSER_PROPERTIES_LOCATION`

### Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser

`ID_ATTRIBUTE, NAME_ATTRIBUTE`

## Constructor Summary

Constructors
Constructor
Description
`AbstractMetadataProviderParser()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doNativeParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)`
Parse the element into the provider builder.
`protected final void`
`doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)`
`protected final Class<?>`
`getBeanClass(Element element)`
`protected abstract Class<? extends MetadataResolver>`
`getNativeBeanClass(Element element)`
Return the real class implement by this type.
`private boolean`
`isChaining(Element element)`
Is this a chaining resolver?
`private boolean`
`isPresentNotChaining(Element element, String attribute)`
Handle attributes which are inappropriate for specific implementations.
`private boolean`
`isTopMost(Element element)`
Is this the element at the top of the file? Yes, if it has no parent.
`private void`
`processMetadataFilters(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)`
Handle set up of metadata filters with chaining and auto-install of node processing filter.
`private void`
`processPredicateOptions(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)`
Process predicate-related options.

### Methods inherited from class net.shibboleth.shared.spring.custom.AbstractCustomBeanDefinitionParser

`getCustomProperty, registerBeanDefinition`

### Methods inherited from class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser

`doParse, getBeanClassName, getParentName, parseInternal`

### Methods inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser

`parse, postProcessComponentDefinition, resolveId, shouldFireEvents, shouldGenerateId, shouldGenerateIdAsFallback, shouldParseNameAsAliases`

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

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

## Field Details

### SECURITY_NAMESPACE

@Nonnull @NotEmpty public static final String SECURITY_NAMESPACE
Namespace for Security.

See Also:
  - Constant Field Values

### METADATA_NAMESPACE

@Nonnull @NotEmpty public static final String METADATA_NAMESPACE
Namespace for Metadata.

See Also:
  - Constant Field Values

### METADATA_FILTER_ELEMENT_NAME

@Nonnull public static final QName METADATA_FILTER_ELEMENT_NAME
MetadataFilter Element name.

### CHAINING_PROVIDER_ELEMENT_NAME

@Nonnull public static final QName CHAINING_PROVIDER_ELEMENT_NAME
ChainingMetadataProviderElement name.

### TRUST_ENGINE_ELEMENT_NAME

@Nonnull public static final QName TRUST_ENGINE_ELEMENT_NAME
TrustEngine Element name.

### log

@Nonnull private final org.slf4j.Logger log
Logger.

### byReferenceBridgeRef

@Nullable private final String byReferenceBridgeRef
Bean ID for defaulted `ByReferenceMetadataFilterBridge` instance.

### autoWiredNodeProcessingRef

@Nullable private final String autoWiredNodeProcessingRef
Bean ID for defaulted `AutoWiredNodeProcessingMetadataFilter` instance.

## Constructor Details

### AbstractMetadataProviderParser

public AbstractMetadataProviderParser()
Constructor.

## Method Details

### isPresentNotChaining

private boolean isPresentNotChaining(@Nonnull Element element, @Nonnull String attribute)
Handle attributes which are inappropriate for specific implementations. The chaining metadata provider cannot have "requireValidMetadata" or "failFastInitialization" set, even though they are present in the schema.

This method detects whether these elements are present and if the element is not a chaining provider returns true, otherwise it returns false and emits a warning.

Parameters:
  `element` - the element
  `attribute` - the attribute
Returns:
  true iff this is not a chaining resolver and the attribute is present

### isChaining

private boolean isChaining(@Nonnull Element element)
Is this a chaining resolver?

Parameters:
  `element` - root element of resolver
Returns:
  whether the type is Chaining

### isTopMost

private boolean isTopMost(@Nonnull Element element)
Is this the element at the top of the file? Yes, if it has no parent. In this situation we need to wrap the element in a `MetadataProviderContainer`.

Parameters:
  `element` - the element.
Returns:
  whether it is the outmost element.

### getNativeBeanClass

@Nonnull protected abstract Class<? extends MetadataResolver> getNativeBeanClass(@Nonnull Element element)
Return the real class implement by this type. This has the same function as the more usual `AbstractSingleBeanDefinitionParser.getBeanClass(Element)` but it may need to be shimmed in `AbstractMetadataProviderParser` which may need to insert an extra bean.

Parameters:
  `element` - the `Element` that is being parsed
Returns:
  the `Class` of the bean that is being defined via parsing the supplied `Element`, or `null` if none
See Also:
  - `AbstractSingleBeanDefinitionParser.getBeanClassName(org.w3c.dom.Element)`

### getBeanClass

protected final Class<?> getBeanClass(@Nonnull Element element)

Overrides:
  `getBeanClass` in class `AbstractSingleBeanDefinitionParser`

### doParse

protected final void doParse(@Nonnull Element element, @Nonnull ParserContext parserContext, @Nonnull BeanDefinitionBuilder builder)

Overrides:
  `doParse` in class `AbstractSingleBeanDefinitionParser`

### doNativeParse

protected void doNativeParse(@Nonnull Element element, @Nonnull ParserContext parserContext, @Nonnull BeanDefinitionBuilder builder)
Parse the element into the provider builder. This has the same function as the more usual `AbstractSingleBeanDefinitionParser.doParse(Element, ParserContext, BeanDefinitionBuilder)` but it may need to be shimmed in this class which may need to insert an extra bean.

Parameters:
  `element` - the XML element being parsed
  `parserContext` - the object encapsulating the current state of the parsing process
  `builder` - used to define the `BeanDefinition`
See Also:
  - `AbstractSingleBeanDefinitionParser.doParse(Element, BeanDefinitionBuilder)`

### processMetadataFilters

private void processMetadataFilters(@Nonnull Element element, @Nonnull ParserContext parserContext, @Nonnull BeanDefinitionBuilder builder)
Handle set up of metadata filters with chaining and auto-install of node processing filter.

Parameters:
  `element` - the current element being processed
  `parserContext` - the current parser context
  `builder` - the current bean definition builder

### processPredicateOptions

private void processPredicateOptions(@Nonnull Element element, @Nonnull ParserContext parserContext, @Nonnull BeanDefinitionBuilder builder)
Process predicate-related options.

Parameters:
  `element` - the current element being processed
  `parserContext` - the current parser context
  `builder` - the current bean definition builder