Class CompositeMetadataProvider
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
se.swedenconnect.opensaml.saml2.metadata.provider.AbstractMetadataProvider
se.swedenconnect.opensaml.saml2.metadata.provider.CompositeMetadataProvider
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,MetadataProvider
A metadata provider that collects its metadata from multiple sources (providers).
It is recommended that all providers installed have the failFastInitialization property set to false.
Otherwise a failing provider will shut down the entire compostite provider.
- Author:
- Martin Lindström (martin.lindstrom@litsec.se)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class se.swedenconnect.opensaml.saml2.metadata.provider.AbstractMetadataProvider
AbstractMetadataProvider.EntityDescriptorIterator -
Constructor Summary
ConstructorsConstructorDescriptionCompositeMetadataProvider(String id, List<MetadataProvider> metadataProviders) Constructs a composite metadata provider by assigning it a list of provider instances that it shall read its metadata from. -
Method Summary
Modifier and TypeMethodDescriptionprotected MetadataFilterReturnsnullsince theCompositeMetadataResolverdoesn't perform any filtering.protected voidcreateMetadataResolver(boolean requireValidMetadata, boolean failFastInitialization, MetadataFilter filter) Creates the specificMetadataResolverinstance for the provider implementation.protected voidDestroys the metadata resolver.getID()Returns the identifier for the provider.Returns the time the currently available metadata was last updated.Collects all metadata from all underlying providers and creates anEntitiesDescriptorelement.Returns the underlying OpenSAML metadata resolver.Gets the underlying providers.protected voidInitializes the metadata resolver.voidsetCacheDuration(Duration cacheDuration) Assigns thecacheDurationto assign to the aggregated metadata (returned viagetMetadata()).voidsetExclusionPredicates(List<Predicate<EntityDescriptor>> exclusionPredicates) It is not possible to set configuration for metadata for aCompositeMetadataResolver.voidsetFailFastInitialization(boolean failFast) It is not possible to set configuration for metadata for aCompositeMetadataResolver.voidsetInclusionPredicates(List<Predicate<EntityDescriptor>> inclusionPredicates) It is not possible to set configuration for metadata for aCompositeMetadataResolver.voidsetPerformSchemaValidation(boolean performSchemaValidation) It is not possible to set configuration for metadata for aCompositeMetadataResolver.voidsetRequireValidMetadata(boolean requireValidMetadata) It is not possible to set configuration for metadata for aCompositeMetadataResolver.voidsetSignatureVerificationCertificate(X509Certificate signatureVerificationCertificate) It is not possible to set configuration for metadata for aCompositeMetadataResolver.voidsetValidity(Duration validity) Assigns how long the aggregated metadata (returned viagetMetadata()) should be valid.Methods inherited from class se.swedenconnect.opensaml.saml2.metadata.provider.AbstractMetadataProvider
doDestroy, doInitialize, getEntityDescriptor, getEntityDescriptor, getIdentityProviders, getMetadataDOM, getServiceProviders, getSignatureVerificationCertificates, iterator, iterator, refresh, setKeepOnlySpAndIdps, setMetadata, setSignatureVerificationCertificatesMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Constructor Details
-
CompositeMetadataProvider
Constructs a composite metadata provider by assigning it a list of provider instances that it shall read its metadata from.The
idparameter will also by used as theNameattribute for theEntitiesDescriptorthat will be returned bygetMetadata().- Parameters:
id- the identifier for the provider (may not be changed later on)metadataProviders- a list of providers
-
-
Method Details
-
getProviders
Gets the underlying providers.- Returns:
- a list of the underlying metadata providers
-
getID
Returns the identifier for the provider.- Returns:
- the identifier
-
getMetadataResolver
Returns the underlying OpenSAML metadata resolver.- Returns:
- OpenSAML metadata resolver
-
getMetadata
Collects all metadata from all underlying providers and creates anEntitiesDescriptorelement. Any duplicate entity ID:s will be removed.- Specified by:
getMetadatain interfaceMetadataProvider- Overrides:
getMetadatain classAbstractMetadataProvider- Returns:
- an XML element
-
getLastUpdate
Returns the time the currently available metadata was last updated.- Specified by:
getLastUpdatein interfaceMetadataProvider- Overrides:
getLastUpdatein classAbstractMetadataProvider- Returns:
- time when the currently metadata was last updated, or null if no metadata has been successfully loaded
-
createMetadataResolver
protected void createMetadataResolver(boolean requireValidMetadata, boolean failFastInitialization, MetadataFilter filter) throws ResolverException Creates the specificMetadataResolverinstance for the provider implementation.The
filterparameter is aMetadataFilterthat must be installed for the resolver. Any other filters that should be installed by the specific instance should be placed last in a filter chain.- Specified by:
createMetadataResolverin classAbstractMetadataProvider- Parameters:
requireValidMetadata- should be passed intoMetadataResolver.setRequireValidMetadata(boolean)failFastInitialization- should be passed intoAbstractMetadataResolver.setFailFastInitialization(boolean)(if applicable)filter- filter that must be installed for the resolver- Throws:
ResolverException- for errors creating the resolver
-
createFilter
Returnsnullsince theCompositeMetadataResolverdoesn't perform any filtering.- Overrides:
createFilterin classAbstractMetadataProvider- Returns:
- a metadata filter
-
initializeMetadataResolver
Initializes the metadata resolver.- Specified by:
initializeMetadataResolverin classAbstractMetadataProvider- Throws:
ComponentInitializationException- for initialization errors
-
destroyMetadataResolver
protected void destroyMetadataResolver()Destroys the metadata resolver.- Specified by:
destroyMetadataResolverin classAbstractMetadataProvider
-
setRequireValidMetadata
public void setRequireValidMetadata(boolean requireValidMetadata) It is not possible to set configuration for metadata for aCompositeMetadataResolver. This should be done on each of the underlying resolvers.- Overrides:
setRequireValidMetadatain classAbstractMetadataProvider- Parameters:
requireValidMetadata- whether the metadata returned by queries must be valid
-
setFailFastInitialization
public void setFailFastInitialization(boolean failFast) It is not possible to set configuration for metadata for aCompositeMetadataResolver. This should be done on each of the underlying resolvers.- Overrides:
setFailFastInitializationin classAbstractMetadataProvider- Parameters:
failFast- whether problems during initialization should cause the provider to fail
-
setInclusionPredicates
It is not possible to set configuration for metadata for aCompositeMetadataResolver. This should be done on each of the underlying resolvers.- Overrides:
setInclusionPredicatesin classAbstractMetadataProvider- Parameters:
inclusionPredicates- predicates- See Also:
-
setExclusionPredicates
It is not possible to set configuration for metadata for aCompositeMetadataResolver. This should be done on each of the underlying resolvers.- Overrides:
setExclusionPredicatesin classAbstractMetadataProvider- Parameters:
exclusionPredicates- predicates- See Also:
-
setSignatureVerificationCertificate
It is not possible to set configuration for metadata for aCompositeMetadataResolver. This should be done on each of the underlying resolvers.- Overrides:
setSignatureVerificationCertificatein classAbstractMetadataProvider- Parameters:
signatureVerificationCertificate- the certificate to assign
-
setPerformSchemaValidation
public void setPerformSchemaValidation(boolean performSchemaValidation) It is not possible to set configuration for metadata for aCompositeMetadataResolver. This should be done on each of the underlying resolvers.- Overrides:
setPerformSchemaValidationin classAbstractMetadataProvider- Parameters:
performSchemaValidation- whether schema validation should be performed
-
setValidity
Assigns how long the aggregated metadata (returned viagetMetadata()) should be valid. If not assigned, the provider will calculate thevalidUntilbased on the lowestvalidUntilvalue from the underlying providers.- Parameters:
validity- the validity
-
setCacheDuration
Assigns thecacheDurationto assign to the aggregated metadata (returned viagetMetadata()). If not assigned thecacheDurationwill be based on the lowestcacheDurationvalue from the underlying providers.- Parameters:
cacheDuration- the cache duration
-