public abstract class AbstractMetadataProvider extends AbstractInitializableComponent implements MetadataProvider
MetadataProvider interface.| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractMetadataProvider.EntityDescriptorIterator
Iterates over EntitiesDescriptor or EntityDescriptor.
|
| Constructor and Description |
|---|
AbstractMetadataProvider() |
| Modifier and Type | Method and Description |
|---|---|
protected MetadataFilter |
createFilter()
Creates the filter(s) that this instance should be configured with.
|
protected abstract void |
createMetadataResolver(boolean requireValidMetadata,
boolean failFastInitialization,
MetadataFilter filter)
Creates the specific
MetadataResolver instance for the provider implementation. |
protected abstract void |
destroyMetadataResolver()
Destroys the metadata resolver.
|
protected void |
doDestroy() |
protected void |
doInitialize() |
Optional<EntityDescriptor> |
getEntityDescriptor(String entityID)
Returns the entity descriptor identified by the given entityID.
|
List<EntityDescriptor> |
getIdentityProviders()
Utility method that returns a list of entity descriptors for Identity Providers found in the metadata.
|
Optional<IDPSSODescriptor> |
getIDPSSODescriptor(String entityID)
A utility method that extracts the IdP SSO descriptor from the Entity Descriptor identified by the supplied
entityID.
|
Optional<org.joda.time.DateTime> |
getLastUpdate()
Returns the time the currently available metadata was last updated.
|
Optional<XMLObject> |
getMetadata()
Returns the XML element making up the metadata for the federation.
|
Optional<Element> |
getMetadataDOM()
Returns the DOM element making up the metadata for the federation.
|
List<EntityDescriptor> |
getServiceProviders()
Utility method that returns a list of entity descriptors for Service Providers found in the metadata.
|
Optional<SPSSODescriptor> |
getSPSSODescriptor(String entityID)
A utility method that extracts the SP SSO descriptor from the Entity Descriptor identified by the supplied
entityID.
|
protected abstract void |
initializeMetadataResolver()
Initializes the metadata resolver.
|
Iterable<EntityDescriptor> |
iterator()
Returns an iterator for all entity descriptors held by the provider.
|
Iterable<EntityDescriptor> |
iterator(QName role)
Returns an iterator for all entity descriptors having the given role.
|
void |
refresh()
Refresh the metadata handled by the provider.
|
void |
setExclusionPredicates(List<Predicate<EntityDescriptor>> exclusionPredicates)
Assigns a list of exclusion predicates that will be applied to downloaded metadata.
|
void |
setFailFastInitialization(boolean failFast)
Sets whether problems during initialization should cause the provider to fail or go on without metadata.
|
void |
setInclusionPredicates(List<Predicate<EntityDescriptor>> inclusionPredicates)
Assigns a list of inclusion predicates that will be applied to downloaded metadata.
|
void |
setPerformSchemaValidation(boolean performSchemaValidation)
Assigns whether XML schema validation should be performed on downloaded metadata.
|
void |
setRequireValidMetadata(boolean requireValidMetadata)
Sets whether the metadata returned by queries must be valid.
|
void |
setSignatureVerificationCertificate(X509Certificate signatureVerificationCertificate)
Assigns the certificate that was used to sign metadata that is downloaded.
|
destroy, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetID, getMetadataResolverinitialize, isInitializeddestroy, isDestroyedpublic Optional<XMLObject> getMetadata()
EntityDescriptor or an EntitiesDescriptor.getMetadata in interface MetadataProviderpublic Optional<Element> getMetadataDOM() throws MarshallingException
getMetadataDOM in interface MetadataProviderMarshallingException - for XML marshalling errorspublic Optional<org.joda.time.DateTime> getLastUpdate()
getLastUpdate in interface MetadataProviderpublic void refresh()
throws ResolverException
An implementation that does not support refresh should implement this operation as a no-op. Implementations that do
support refresh of metadata should typically be either synchronized or make use other locking
mechanisms to protect against concurrent access.
refresh in interface MetadataProviderResolverException - if the refresh operation was unsuccessfulpublic Iterable<EntityDescriptor> iterator()
iterator in interface MetadataProviderpublic Iterable<EntityDescriptor> iterator(QName role)
To list all IdP:s and SP:s do:
idps = provider.iterator(IDPSSODescriptor.DEFAULT_ELEMENT_NAME);
sps = provider.iterator(SPSSODescriptor.DEFAULT_ELEMENT_NAME);
iterator in interface MetadataProviderrole - role descriptorMetadataProvider.getIdentityProviders(),
MetadataProvider.getServiceProviders()public Optional<EntityDescriptor> getEntityDescriptor(String entityID) throws ResolverException
getEntityDescriptor in interface MetadataProviderentityID - the unique entityID for the entryResolverException - for underlying metadata errorspublic Optional<IDPSSODescriptor> getIDPSSODescriptor(String entityID) throws ResolverException
getIDPSSODescriptor in interface MetadataProviderentityID - the entityID for the IdPResolverException - for underlying metadata errorsMetadataProvider.getEntityDescriptor(String)public Optional<SPSSODescriptor> getSPSSODescriptor(String entityID) throws ResolverException
getSPSSODescriptor in interface MetadataProviderentityID - the entityID for the Service ProviderResolverException - for underlying metadata errorsMetadataProvider.getEntityDescriptor(String)public List<EntityDescriptor> getIdentityProviders() throws ResolverException
getIdentityProviders in interface MetadataProviderResolverException - for metadata errorspublic List<EntityDescriptor> getServiceProviders() throws ResolverException
getServiceProviders in interface MetadataProviderResolverException - for metadata errorsprotected final void doInitialize()
throws ComponentInitializationException
doInitialize in class AbstractInitializableComponentComponentInitializationExceptionprotected MetadataFilter createFilter()
protected void doDestroy()
doDestroy in class AbstractInitializableComponentprotected abstract 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.
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 abstract void initializeMetadataResolver()
throws ComponentInitializationException
ComponentInitializationException - for initialization errorsprotected abstract void destroyMetadataResolver()
public void setRequireValidMetadata(boolean requireValidMetadata)
requireValidMetadata - whether the metadata returned by queries must be validpublic void setFailFastInitialization(boolean failFast)
failFast - whether problems during initialization should cause the provider to failpublic void setSignatureVerificationCertificate(X509Certificate signatureVerificationCertificate)
signatureVerificationCertificate - the certificate to assignpublic void setPerformSchemaValidation(boolean performSchemaValidation)
performSchemaValidation - whether schema validation should be performedpublic void setInclusionPredicates(List<Predicate<EntityDescriptor>> inclusionPredicates)
inclusionPredicates - predicatesMetadataProviderPredicatespublic void setExclusionPredicates(List<Predicate<EntityDescriptor>> exclusionPredicates)
exclusionPredicates - predicatesMetadataProviderPredicatesCopyright © 2018 Litsec AB. All rights reserved.