org.opensaml.saml2.metadata.provider
Interface MetadataProvider

All Known Subinterfaces:
ObservableMetadataProvider
All Known Implementing Classes:
AbstractMetadataProvider, AbstractObservableMetadataProvider, BaseMetadataProvider, ChainingMetadataProvider, DOMMetadataProvider, FileBackedHTTPMetadataProvider, FilesystemMetadataProvider, HTTPMetadataProvider, ResourceBackedMetadataProvider

public interface MetadataProvider

A local store into which metadata can be loaded and queried. Specific implementations may perform additional logic such as caching (and refreshing) metadata and merging metadata, about a single entity, from multiple sources. NOTE, developers should not try to marshall the metadata that comes from a metadata provider. It is possible that the a provider, or MetadataFilter, implementation may make changes to the retrieved metadata that make unusable for marshalling. For example, by removing elements required by the schema but not by the user of the provider as a way of saving on memory. Or by remove elements and thus invalidating a signature that had be present on the retrieved metadata.


Method Summary
 EntitiesDescriptor getEntitiesDescriptor(java.lang.String name)
          Gets a named EntitiesDescriptor from the metadata.
 EntityDescriptor getEntityDescriptor(java.lang.String entityID)
          Gets the metadata for a given entity if the metadata is valid.
 org.opensaml.xml.XMLObject getMetadata()
          Gets the entire metadata tree, after the registered filter has been applied.
 MetadataFilter getMetadataFilter()
          Gets the metadata filter applied to the metadata.
 java.util.List<RoleDescriptor> getRole(java.lang.String entityID, javax.xml.namespace.QName roleName)
          Gets the role descriptors of a given type for a given entity from valid metadata.
 RoleDescriptor getRole(java.lang.String entityID, javax.xml.namespace.QName roleName, java.lang.String supportedProtocol)
          Gets the role descriptors of a given type for a given entity that support the given protocol from valid metadata.
 boolean requireValidMetadata()
          Gets whether the metadata returned by queries must be valid.
 void setMetadataFilter(MetadataFilter newFilter)
          Sets the metadata filter applied to the metadata.
 void setRequireValidMetadata(boolean requireValidMetadata)
          Sets whether the metadata returned by queries must be valid.
 

Method Detail

requireValidMetadata

boolean requireValidMetadata()
Gets whether the metadata returned by queries must be valid. At a minimum, metadata is valid only if the date expressed in entity's validUntil attribute has not passed. Specific implementations may add additional constraints.

Returns:
whether the metadata returned by queries must be valid

setRequireValidMetadata

void setRequireValidMetadata(boolean requireValidMetadata)
Sets whether the metadata returned by queries must be valid.

Parameters:
requireValidMetadata - whether the metadata returned by queries must be valid

getMetadataFilter

MetadataFilter getMetadataFilter()
Gets the metadata filter applied to the metadata.

Returns:
the metadata filter applied to the metadata

setMetadataFilter

void setMetadataFilter(MetadataFilter newFilter)
                       throws MetadataProviderException
Sets the metadata filter applied to the metadata.

Parameters:
newFilter - the metadata filter applied to the metadata
Throws:
MetadataProviderException - thrown if the provider can not apply the filter to the metadata

getMetadata

org.opensaml.xml.XMLObject getMetadata()
                                       throws MetadataProviderException
Gets the entire metadata tree, after the registered filter has been applied.

Returns:
the entire metadata tree
Throws:
MetadataProviderException - thrown if the provider can not fetch the metadata

getEntitiesDescriptor

EntitiesDescriptor getEntitiesDescriptor(java.lang.String name)
                                         throws MetadataProviderException
Gets a named EntitiesDescriptor from the metadata.

Parameters:
name - the name of the EntitiesDescriptor
Returns:
the EntitiesDescriptor or null
Throws:
MetadataProviderException - thrown if the provider can not fetch the metadata

getEntityDescriptor

EntityDescriptor getEntityDescriptor(java.lang.String entityID)
                                     throws MetadataProviderException
Gets the metadata for a given entity if the metadata is valid.

Parameters:
entityID - the ID of the entity
Returns:
the entity's metadata or null if there is no metadata or no valid metadata
Throws:
MetadataProviderException - thrown if the provider can not fetch the metadata

getRole

java.util.List<RoleDescriptor> getRole(java.lang.String entityID,
                                       javax.xml.namespace.QName roleName)
                                       throws MetadataProviderException
Gets the role descriptors of a given type for a given entity from valid metadata.

Parameters:
entityID - the ID of the entity
roleName - the role type
Returns:
the role descriptors
Throws:
MetadataProviderException - thrown if the provider can not fetch the metadata

getRole

RoleDescriptor getRole(java.lang.String entityID,
                       javax.xml.namespace.QName roleName,
                       java.lang.String supportedProtocol)
                       throws MetadataProviderException
Gets the role descriptors of a given type for a given entity that support the given protocol from valid metadata.

Parameters:
entityID - the ID of the entity
roleName - the role type
supportedProtocol - the protocol supported by the role
Returns:
the role descriptors
Throws:
MetadataProviderException - thrown if the provider can not fetch the metadata


Copyright © 2006-2009 Internet2. All Rights Reserved.