org.opensaml.saml2.metadata.provider
Interface MetadataProvider

All Known Subinterfaces:
ObservableMetadataProvider
All Known Implementing Classes:
AbstractMetadataProvider, AbstractObservableMetadataProvider, AbstractReloadingMetadataProvider, 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 it 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.


Method Summary
 EntitiesDescriptor getEntitiesDescriptor(String name)
          Gets a valid named EntitiesDescriptor from the metadata.
 EntityDescriptor getEntityDescriptor(String entityID)
          Gets the valid metadata for a given entity.
 XMLObject getMetadata()
          Gets the valid metadata tree, after the registered filter has been applied.
 MetadataFilter getMetadataFilter()
          Gets the metadata filter applied to the metadata.
 List<RoleDescriptor> getRole(String entityID, QName roleName)
          Gets the valid role descriptors of a given type for a given entity.
 RoleDescriptor getRole(String entityID, QName roleName, String supportedProtocol)
          Gets the valid role descriptors of a given type for a given entity that support the given protocol.
 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 the element, and all its ancestral element'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

XMLObject getMetadata()
                      throws MetadataProviderException
Gets the valid 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, must not be thrown simply if there is no metadata to fetch

getEntitiesDescriptor

EntitiesDescriptor getEntitiesDescriptor(String name)
                                         throws MetadataProviderException
Gets a valid 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, must not be thrown if there is simply no EntitiesDescriptor with the given name

getEntityDescriptor

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

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, must not be thrown if there is simply no EntityDescriptor with the given ID

getRole

List<RoleDescriptor> getRole(String entityID,
                             QName roleName)
                             throws MetadataProviderException
Gets the valid role descriptors of a given type for a given entity.

Parameters:
entityID - the ID of the entity
roleName - the role type
Returns:
the modifiable list of role descriptors
Throws:
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

getRole

RoleDescriptor getRole(String entityID,
                       QName roleName,
                       String supportedProtocol)
                       throws MetadataProviderException
Gets the valid role descriptors of a given type for a given entity that support the given protocol.

Parameters:
entityID - the ID of the entity
roleName - the role type
supportedProtocol - the protocol supported by the role
Returns:
the role descriptor
Throws:
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 protocol


Copyright © 1999-2012. All Rights Reserved.