public class CompositeMetadataProvider extends AbstractMetadataProvider
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.
CompositeMetadataResolver
AbstractMetadataProvider.EntityDescriptorIterator
Constructor and Description |
---|
CompositeMetadataProvider(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.
|
Modifier and Type | Method and Description |
---|---|
protected MetadataFilter |
createFilter()
Returns
null since the CompositeMetadataResolver doesn't perform any filtering. |
protected void |
createMetadataResolver(boolean requireValidMetadata,
boolean failFastInitialization,
MetadataFilter filter)
Creates the specific
MetadataResolver instance for the provider implementation. |
protected void |
destroyMetadataResolver()
Destroys the metadata resolver.
|
String |
getID()
Returns the identifier for the provider.
|
Optional<org.joda.time.DateTime> |
getLastUpdate()
Returns the time the currently available metadata was last updated.
|
Optional<XMLObject> |
getMetadata()
Collects all metadata from all underlying providers and creates an
EntitiesDescriptor element. |
MetadataResolver |
getMetadataResolver()
Returns the underlying OpenSAML metadata resolver.
|
protected void |
initializeMetadataResolver()
Initializes the metadata resolver.
|
void |
setExclusionPredicates(List<Predicate<EntityDescriptor>> exclusionPredicates)
It is not possible to set configuration for metadata for a
CompositeMetadataResolver . |
void |
setFailFastInitialization(boolean failFast)
It is not possible to set configuration for metadata for a
CompositeMetadataResolver . |
void |
setInclusionPredicates(List<Predicate<EntityDescriptor>> inclusionPredicates)
It is not possible to set configuration for metadata for a
CompositeMetadataResolver . |
void |
setPerformSchemaValidation(boolean performSchemaValidation)
It is not possible to set configuration for metadata for a
CompositeMetadataResolver . |
void |
setRequireValidMetadata(boolean requireValidMetadata)
It is not possible to set configuration for metadata for a
CompositeMetadataResolver . |
void |
setSignatureVerificationCertificate(X509Certificate signatureVerificationCertificate)
It is not possible to set configuration for metadata for a
CompositeMetadataResolver . |
doDestroy, doInitialize, getEntityDescriptor, getIdentityProviders, getIDPSSODescriptor, getMetadataDOM, getServiceProviders, getSPSSODescriptor, iterator, iterator, refresh
destroy, initialize, isDestroyed, isInitialized
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initialize, isInitialized
destroy, isDestroyed
public CompositeMetadataProvider(String id, List<MetadataProvider> metadataProviders)
The id
parameter will also by used as the Name
attribute for the EntitiesDescriptor
that will be returned by getMetadata()
.
id
- the identifier for the provider (may not be changed later on)metadataProviders
- a list of providerspublic String getID()
public MetadataResolver getMetadataResolver()
public Optional<XMLObject> getMetadata()
EntitiesDescriptor
element. Any
duplicate entity ID:s will be removed.getMetadata
in interface MetadataProvider
getMetadata
in class AbstractMetadataProvider
public Optional<org.joda.time.DateTime> getLastUpdate()
getLastUpdate
in interface MetadataProvider
getLastUpdate
in class AbstractMetadataProvider
protected void createMetadataResolver(boolean requireValidMetadata, boolean failFastInitialization, MetadataFilter filter) throws ResolverException
MetadataResolver
instance for the provider implementation.
The filter
parameter is a MetadataFilter
that 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.
createMetadataResolver
in class AbstractMetadataProvider
requireValidMetadata
- should be passed into MetadataResolver.setRequireValidMetadata(boolean)
failFastInitialization
- should be passed into AbstractMetadataResolver.setFailFastInitialization(boolean)
(if applicable)filter
- filter that must be installed for the resolverResolverException
- for errors creating the resolverprotected MetadataFilter createFilter()
null
since the CompositeMetadataResolver
doesn't perform any filtering.createFilter
in class AbstractMetadataProvider
protected void initializeMetadataResolver() throws ComponentInitializationException
initializeMetadataResolver
in class AbstractMetadataProvider
ComponentInitializationException
- for initialization errorsprotected void destroyMetadataResolver()
destroyMetadataResolver
in class AbstractMetadataProvider
public void setRequireValidMetadata(boolean requireValidMetadata)
CompositeMetadataResolver
. This should be done
on each of the underlying resolvers.setRequireValidMetadata
in class AbstractMetadataProvider
requireValidMetadata
- whether the metadata returned by queries must be validpublic void setFailFastInitialization(boolean failFast)
CompositeMetadataResolver
. This should be done
on each of the underlying resolvers.setFailFastInitialization
in class AbstractMetadataProvider
failFast
- whether problems during initialization should cause the provider to failpublic void setInclusionPredicates(List<Predicate<EntityDescriptor>> inclusionPredicates)
CompositeMetadataResolver
. This should be done
on each of the underlying resolvers.setInclusionPredicates
in class AbstractMetadataProvider
inclusionPredicates
- predicatesMetadataProviderPredicates
public void setExclusionPredicates(List<Predicate<EntityDescriptor>> exclusionPredicates)
CompositeMetadataResolver
. This should be done
on each of the underlying resolvers.setExclusionPredicates
in class AbstractMetadataProvider
exclusionPredicates
- predicatesMetadataProviderPredicates
public void setSignatureVerificationCertificate(X509Certificate signatureVerificationCertificate)
CompositeMetadataResolver
. This should be done
on each of the underlying resolvers.setSignatureVerificationCertificate
in class AbstractMetadataProvider
signatureVerificationCertificate
- the certificate to assignpublic void setPerformSchemaValidation(boolean performSchemaValidation)
CompositeMetadataResolver
. This should be done
on each of the underlying resolvers.setPerformSchemaValidation
in class AbstractMetadataProvider
performSchemaValidation
- whether schema validation should be performedCopyright © 2018 Litsec AB. All rights reserved.