|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensaml.saml2.metadata.provider.BaseMetadataProvider
org.opensaml.saml2.metadata.provider.ChainingMetadataProvider
public class ChainingMetadataProvider
A metadata provider that uses registered providers, in turn, to answer queries. When searching for entity specific information (entity metadata, roles, etc.) the entity descriptor used is the first non-null descriptor found while iterating over the registered providers in insertion order. This chaining provider implements observation by registering an observer with each contained provider. When the contained provider emits a change this provider will also emit a change to observers registered with it. As such, developers should be careful not to register a the same observer with both container providers and this provider. Doing so will result in an observer being notified twice for each change.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.opensaml.saml2.metadata.provider.ObservableMetadataProvider |
|---|
ObservableMetadataProvider.Observer |
| Field Summary |
|---|
| Fields inherited from class org.opensaml.saml2.metadata.provider.BaseMetadataProvider |
|---|
unmarshallerFactory |
| Constructor Summary | |
|---|---|
ChainingMetadataProvider()
Constructor. |
|
| Method Summary | |
|---|---|
void |
addMetadataProvider(MetadataProvider newProvider)
Adds a metadata provider to the list of registered providers. |
protected void |
doAddMetadataProvider(MetadataProvider provider,
java.util.List<MetadataProvider> providerList)
Adds a metadata provider to the given collection. |
protected void |
emitChangeEvent()
Convenience method for calling ObservableMetadataProvider.Observer.onEvent(MetadataProvider) on
every registered Observer passing in this provider. |
EntitiesDescriptor |
getEntitiesDescriptor(java.lang.String name)
Gets a valid named EntitiesDescriptor from the metadata. |
EntityDescriptor |
getEntityDescriptor(java.lang.String entityID)
Gets the valid metadata for a given entity. |
org.opensaml.xml.XMLObject |
getMetadata()
Gets the metadata from every registered provider and places each within a newly created EntitiesDescriptor. |
MetadataFilter |
getMetadataFilter()
Gets the metadata filter applied to the metadata. |
java.util.List<ObservableMetadataProvider.Observer> |
getObservers()
Gets the list of observers for the provider. |
java.util.List<MetadataProvider> |
getProviders()
Gets an immutable the list of currently registered providers. |
java.util.List<RoleDescriptor> |
getRole(java.lang.String entityID,
javax.xml.namespace.QName roleName)
Gets the valid role descriptors of a given type for a given entity. |
RoleDescriptor |
getRole(java.lang.String entityID,
javax.xml.namespace.QName roleName,
java.lang.String supportedProtocol)
Gets the valid role descriptors of a given type for a given entity that support the given protocol. |
void |
removeMetadataProvider(MetadataProvider provider)
Removes a metadata provider from the list of registered providers. |
void |
setMetadataFilter(MetadataFilter newFilter)
Sets the metadata filter applied to the metadata. |
void |
setProviders(java.util.List<MetadataProvider> newProviders)
Replaces the current set of metadata providers with give collection. |
void |
setRequireValidMetadata(boolean requireValidMetadata)
Sets whether the metadata returned by queries must be valid. |
| Methods inherited from class org.opensaml.saml2.metadata.provider.BaseMetadataProvider |
|---|
requireValidMetadata |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.opensaml.saml2.metadata.provider.MetadataProvider |
|---|
requireValidMetadata |
| Constructor Detail |
|---|
public ChainingMetadataProvider()
| Method Detail |
|---|
public java.util.List<MetadataProvider> getProviders()
public void setProviders(java.util.List<MetadataProvider> newProviders)
throws MetadataProviderException
newProviders - the metadata providers to replace the current providers with
MetadataProviderException - thrown if there is a problem adding the metadata provider
public void addMetadataProvider(MetadataProvider newProvider)
throws MetadataProviderException
newProvider - the provider to be added
MetadataProviderException - thrown if there is a problem adding the metadata provider
protected void doAddMetadataProvider(MetadataProvider provider,
java.util.List<MetadataProvider> providerList)
MetadataProvider.requireValidMetadata() property is set to the value of this metadata
provider's property. If the given metadata provider is an instance of ObservableMetadataProvider then a
ContainedProviderObserver is added to it as well.
provider - provider to be added to the collectionproviderList - collection to which the provider is addedpublic void removeMetadataProvider(MetadataProvider provider)
provider - provider to be removedpublic void setRequireValidMetadata(boolean requireValidMetadata)
setRequireValidMetadata in interface MetadataProvidersetRequireValidMetadata in class BaseMetadataProviderrequireValidMetadata - whether the metadata returned by queries must be validpublic MetadataFilter getMetadataFilter()
getMetadataFilter in interface MetadataProvidergetMetadataFilter in class BaseMetadataProvider
public void setMetadataFilter(MetadataFilter newFilter)
throws MetadataProviderException
setMetadataFilter in interface MetadataProvidersetMetadataFilter in class BaseMetadataProvidernewFilter - the metadata filter applied to the metadata
MetadataProviderException - thrown if the provider can not apply the filter to the metadata
public org.opensaml.xml.XMLObject getMetadata()
throws MetadataProviderException
getMetadata in interface MetadataProviderMetadataProviderException - thrown if the provider can not fetch the metadata, must not be thrown simply if
there is no metadata to fetch
public EntitiesDescriptor getEntitiesDescriptor(java.lang.String name)
throws MetadataProviderException
getEntitiesDescriptor in interface MetadataProvidername - the name of the EntitiesDescriptor
MetadataProviderException - thrown if the provider can not fetch the metadata, must not be thrown if there
is simply no EntitiesDescriptor with the given name
public EntityDescriptor getEntityDescriptor(java.lang.String entityID)
throws MetadataProviderException
getEntityDescriptor in interface MetadataProviderentityID - the ID of the entity
MetadataProviderException - thrown if the provider can not fetch the metadata, must not be thrown if there
is simply no EntityDescriptor with the given ID
public java.util.List<RoleDescriptor> getRole(java.lang.String entityID,
javax.xml.namespace.QName roleName)
throws MetadataProviderException
getRole in interface MetadataProviderentityID - the ID of the entityroleName - the role type
MetadataProviderException - thrown if the provider can not fetch the metadata, must not be thrown if there
is simply no such entity with the given roles
public RoleDescriptor getRole(java.lang.String entityID,
javax.xml.namespace.QName roleName,
java.lang.String supportedProtocol)
throws MetadataProviderException
getRole in interface MetadataProviderentityID - the ID of the entityroleName - the role typesupportedProtocol - the protocol supported by the role
MetadataProviderException - thrown if the provider can not fetch the metadata, must not be thrown if there
is simply no such entity with the given role supporting the given protocolpublic java.util.List<ObservableMetadataProvider.Observer> getObservers()
getObservers in interface ObservableMetadataProviderprotected void emitChangeEvent()
ObservableMetadataProvider.Observer.onEvent(MetadataProvider) on
every registered Observer passing in this provider.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||