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
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
FieldsModifier and TypeFieldDescriptionprivate final StringBean ID for defaultedAutoWiredNodeProcessingMetadataFilterinstance.private final StringBean ID for defaultedByReferenceMetadataFilterBridgeinstance.static final QNameChainingMetadataProviderElement name.private final org.slf4j.LoggerLogger.static final QNameMetadataFilter Element name.static final StringNamespace for Metadata.static final StringNamespace for Security.static final QNameTrustEngine Element name.Fields inherited from class net.shibboleth.shared.spring.custom.AbstractCustomBeanDefinitionParser
CUSTOM_PARSER_PROPERTIES_LOCATIONFields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
ID_ATTRIBUTE, NAME_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoNativeParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) Parse the element into the provider builder.protected final voiddoParse(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 booleanisChaining(Element element) Is this a chaining resolver?private booleanisPresentNotChaining(Element element, String attribute) Handle attributes which are inappropriate for specific implementations.private booleanIs this the element at the top of the file? Yes, if it has no parent.private voidprocessMetadataFilters(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) Handle set up of metadata filters with chaining and auto-install of node processing filter.private voidprocessPredicateOptions(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) Process predicate-related options.Methods inherited from class net.shibboleth.shared.spring.custom.AbstractCustomBeanDefinitionParser
getCustomProperty, registerBeanDefinitionMethods inherited from class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
doParse, getBeanClassName, getParentName, parseInternalMethods inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
parse, postProcessComponentDefinition, resolveId, shouldFireEvents, shouldGenerateId, shouldGenerateIdAsFallback, shouldParseNameAsAliases
-
Field Details
-
SECURITY_NAMESPACE
Namespace for Security.- See Also:
-
METADATA_NAMESPACE
Namespace for Metadata.- See Also:
-
METADATA_FILTER_ELEMENT_NAME
MetadataFilter Element name. -
CHAINING_PROVIDER_ELEMENT_NAME
ChainingMetadataProviderElement name. -
TRUST_ENGINE_ELEMENT_NAME
TrustEngine Element name. -
log
@Nonnull private final org.slf4j.Logger logLogger. -
byReferenceBridgeRef
Bean ID for defaultedByReferenceMetadataFilterBridgeinstance. -
autoWiredNodeProcessingRef
Bean ID for defaultedAutoWiredNodeProcessingMetadataFilterinstance.
-
-
Constructor Details
-
AbstractMetadataProviderParser
public AbstractMetadataProviderParser()Constructor.
-
-
Method Details
-
isPresentNotChaining
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
Is this a chaining resolver?- Parameters:
element- root element of resolver- Returns:
- whether the type is Chaining
-
isTopMost
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
@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 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:
-
getBeanClass
- Overrides:
getBeanClassin classAbstractSingleBeanDefinitionParser
-
doParse
protected final void doParse(@Nonnull Element element, @Nonnull ParserContext parserContext, @Nonnull BeanDefinitionBuilder builder) - Overrides:
doParsein classAbstractSingleBeanDefinitionParser
-
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 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:
-
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 processedparserContext- the current parser contextbuilder- 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 processedparserContext- the current parser contextbuilder- the current bean definition builder
-