public interface MetadataProvider extends InitializableComponent, DestructableComponent
A MetadataProvider
instance encapsulates OpenSAML:s MetadataResolver
and adds easy to use methods and
configuration.
Modifier and Type | Method and Description |
---|---|
Optional<EntityDescriptor> |
getEntityDescriptor(String entityID)
Returns the entity descriptor identified by the given entityID.
|
String |
getID()
Returns the identifier for the provider.
|
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.
|
MetadataResolver |
getMetadataResolver()
Returns the underlying OpenSAML metadata resolver.
|
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.
|
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.
|
initialize, isInitialized
destroy, isDestroyed
String getID()
Optional<XMLObject> getMetadata() throws ResolverException
EntityDescriptor
or an EntitiesDescriptor
.ResolverException
- for metadata resolving errorsOptional<Element> getMetadataDOM() throws MarshallingException
MarshallingException
- for XML marshalling errorsOptional<org.joda.time.DateTime> getLastUpdate()
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.
ResolverException
- if the refresh operation was unsuccessfulIterable<EntityDescriptor> iterator()
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);
role
- role descriptorgetIdentityProviders()
,
getServiceProviders()
Optional<EntityDescriptor> getEntityDescriptor(String entityID) throws ResolverException
entityID
- the unique entityID for the entryResolverException
- for underlying metadata errorsOptional<IDPSSODescriptor> getIDPSSODescriptor(String entityID) throws ResolverException
entityID
- the entityID for the IdPResolverException
- for underlying metadata errorsgetEntityDescriptor(String)
Optional<SPSSODescriptor> getSPSSODescriptor(String entityID) throws ResolverException
entityID
- the entityID for the Service ProviderResolverException
- for underlying metadata errorsgetEntityDescriptor(String)
List<EntityDescriptor> getIdentityProviders() throws ResolverException
ResolverException
- for metadata errorsList<EntityDescriptor> getServiceProviders() throws ResolverException
ResolverException
- for metadata errorsMetadataResolver getMetadataResolver()
Copyright © 2018 Litsec AB. All rights reserved.