Class AbstractMetadataProviderParser
- java.lang.Object
-
- org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
-
- org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
-
- net.shibboleth.ext.spring.util.AbstractCustomBeanDefinitionParser
-
- net.shibboleth.idp.profile.spring.relyingparty.metadata.AbstractMetadataProviderParser
-
- All Implemented Interfaces:
BeanDefinitionParser
- Direct Known Subclasses:
AbstractDynamicMetadataProviderParser,AbstractReloadingMetadataProviderParser,ChainingMetadataProviderParser,InlineMetadataProviderParser
public abstract class AbstractMetadataProviderParser extends AbstractCustomBeanDefinitionParser
Parser for the MetadataProviderType in theurn:mace:shibboleth:2.0:metadatanamespace. If we are the top most element then we need to summon up aMetadataProviderContainerand inject what we would usually create into that.
-
-
Field Summary
Fields Modifier and Type Field Description static QNameCHAINING_PROVIDER_ELEMENT_NAMEChainingMetadataProviderElement name.private org.slf4j.LoggerlogLogger.static QNameMETADATA_FILTER_ELEMENT_NAMEMetadataFilter Element name.static StringMETADATA_NAMESPACENamespace for Metadata.static StringSECURITY_NAMESPACENamespace for Security.static QNameTRUST_ENGINE_ELEMENT_NAMERelyingPartyGroup Element name.-
Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
ID_ATTRIBUTE, NAME_ATTRIBUTE
-
-
Constructor Summary
Constructors Constructor Description AbstractMetadataProviderParser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voiddoNativeParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)Parse the element into the provider builder.protected voiddoParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)protected Class<?>getBeanClass(Element element)protected abstract Class<? extends MetadataResolver>getNativeBeanClass(Element element)Return the real class implement by this type.private booleanisChaining(Element element)Is this a chaining resolver?private booleanisPresentNotChaining(Element element, String attribute)Handle attributes which are inappropriate for specific implementations.private booleanisTopMost(Element element)Is this the element at the top of the file? Yes, if it has no parent.private voidprocessPredicateOptions(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)Process predicate-related options.-
Methods inherited from class net.shibboleth.ext.spring.util.AbstractCustomBeanDefinitionParser
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
-
-
-
-
Field Detail
-
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
RelyingPartyGroup Element name.
-
log
@Nonnull private final org.slf4j.Logger log
Logger.
-
-
Method Detail
-
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 elementattribute- 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 aMetadataProviderContainer.- Parameters:
element- the element.- Returns:
- whether it is the outmost element.
-
getNativeBeanClass
protected abstract Class<? extends MetadataResolver> getNativeBeanClass(Element element)
Return the real class implement by this type. This has the same function as the more usualAbstractSingleBeanDefinitionParser.getBeanClass(Element)but it may need to be shimmed inAbstractMetadataProviderParserwhich may need to insert an extra bean.- Parameters:
element- theElementthat is being parsed- Returns:
- the
Classof the bean that is being defined via parsing the suppliedElement, ornullif none - See Also:
AbstractSingleBeanDefinitionParser.getBeanClassName(org.w3c.dom.Element)
-
getBeanClass
protected final Class<?> getBeanClass(Element element)
- Overrides:
getBeanClassin classAbstractSingleBeanDefinitionParser
-
doParse
protected final void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)
- Overrides:
doParsein classAbstractSingleBeanDefinitionParser
-
doNativeParse
protected void doNativeParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)
Parse the element into the provider builder. This has the same function as the more usualAbstractSingleBeanDefinitionParser.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 parsedparserContext- the object encapsulating the current state of the parsing processbuilder- used to define theBeanDefinition- See Also:
AbstractSingleBeanDefinitionParser.doParse(Element, BeanDefinitionBuilder)
-
processPredicateOptions
private void processPredicateOptions(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)
Process predicate-related options.- Parameters:
element- the current element being processedparserContext- the current parser contextbuilder- the current bean definition builder
-
-