opensaml::saml2md::MetadataProvider Class Referenceabstract

Supplies an individual source of metadata. More...

`#include <saml/saml2/metadata/MetadataProvider.h>`

Inheritance diagram for opensaml::saml2md::MetadataProvider:
[legend]
Collaboration diagram for opensaml::saml2md::MetadataProvider:
[legend]

## Classes

struct | Criteria
| Batches up criteria for entity lookup. More...

## Public Member Functions

virtual | ~MetadataProvider ()
| Destructor will delete any installed filters.
virtual const char * | getId () const
| Returns an identifier for the provider for logging/status purposes.
virtual void | addMetadataFilter (MetadataFilter *newFilter)
| Adds a metadata filter to apply to any resolved metadata.
virtual MetadataFilter * | removeMetadataFilter (MetadataFilter *oldFilter)
| Removes a metadata filter.
void | setContext (const MetadataFilterContext *ctx)
| Sets a filtering context object for use by the filtering process.
virtual void | init ()=0
| Should be called after instantiating provider and adding filters, but before performing any lookup operations.
virtual void | outputStatus (std::ostream &os) const
| Generate an XML representation of the provider's status.
virtual const xmltooling::XMLObject * | getMetadata () const =0
| Gets the entire metadata tree, after the registered filter has been applied.
virtual const EntitiesDescriptor * | getEntitiesDescriptor (const XMLCh *name, bool requireValidMetadata=true) const
| Gets the metadata for a given group of entities.
virtual const EntitiesDescriptor * | getEntitiesDescriptor (const char *name, bool requireValidMetadata=true) const =0
| Gets the metadata for a given group of entities.
virtual std::pair< const EntityDescriptor *, const RoleDescriptor * > | getEntityDescriptor (const Criteria &criteria) const =0
| Gets entity metadata based on supplied criteria.

## Protected Member Functions

| MetadataProvider (const xercesc::DOMElement *e, bool deprecationSupport=true)
| Constructor.
void | doFilters (const MetadataFilterContext *ctx, xmltooling::XMLObject &xmlObject) const
| Applies any installed filters to a metadata instance.

## Detailed Description

Supplies an individual source of metadata.

The source can be a local file, remote service, or the result of a dynamic lookup, can include local caching, etc. Providers MUST be locked before any lookup operations.

## Constructor & Destructor Documentation

## MetadataProvider()

opensaml::saml2md::MetadataProvider::MetadataProvider | ( | const xercesc::DOMElement * | e,
|  | bool | deprecationSupport = true )

protected

Constructor.

If a DOM is supplied, a set of default logic will be used to identify and build MetadataFilter plugins and install them into the provider.

The following XML content is supported:

- <MetadataFilter> elements with a type attribute and type-specific content
- <Exclude> elements representing a BlacklistMetadataFilter
- <Include> elements representing a WhitelistMetadataFilter

XML namespaces are ignored in the processing of these elements.

Parameters

  e | DOM to supply configuration for provider
  deprecationSupport | true iff deprecated features and settings should be supported

## Member Function Documentation

## addMetadataFilter()

virtual void opensaml::saml2md::MetadataProvider::addMetadataFilter | ( | MetadataFilter * | newFilter | ) |

virtual

Adds a metadata filter to apply to any resolved metadata.

Will not be applied to metadata that is already loaded.

Parameters

  newFilter | metadata filter to add

## doFilters()

void opensaml::saml2md::MetadataProvider::doFilters | ( | const MetadataFilterContext * | ctx,
|  | xmltooling::XMLObject & | xmlObject ) const

protected

Applies any installed filters to a metadata instance.

Parameters

  ctx | The Context for this filtering operation.
  xmlObject | the metadata to be filtered

## getEntitiesDescriptor() [1/2]

virtual const EntitiesDescriptor * opensaml::saml2md::MetadataProvider::getEntitiesDescriptor | ( | const char * | name,
|  | bool | requireValidMetadata = true ) const

pure virtual

Gets the metadata for a given group of entities.

If a valid group is returned, the resolver will be left in a locked state. The caller MUST unlock the resolver when finished with the group.

Parameters

  name | the name of the group
  requireValidMetadata | indicates whether the metadata for the group must be valid/current

Returns
  the group's metadata or nullptr if there is no metadata or no valid metadata

Implemented in opensaml::saml2md::AbstractMetadataProvider.

## getEntitiesDescriptor() [2/2]

virtual const EntitiesDescriptor * opensaml::saml2md::MetadataProvider::getEntitiesDescriptor | ( | const XMLCh * | name,
|  | bool | requireValidMetadata = true ) const

virtual

Gets the metadata for a given group of entities.

If a valid group is returned, the resolver will be left in a locked state. The caller MUST unlock the resolver when finished with the group.

Parameters

  name | the name of the group
  requireValidMetadata | indicates whether the metadata for the group must be valid/current

Returns
  the group's metadata or nullptr if there is no metadata or no valid metadata

Reimplemented in opensaml::saml2md::AbstractMetadataProvider.

## getEntityDescriptor()

virtual std::pair< const EntityDescriptor *, const RoleDescriptor * > opensaml::saml2md::MetadataProvider::getEntityDescriptor | ( | const Criteria & | criteria | ) | const

pure virtual

Gets entity metadata based on supplied criteria.

If a valid entity is returned, the provider will be left in a locked state. The caller MUST unlock the provider when finished with the entity.

Parameters

  criteria | lookup criteria

Returns
  the entity's metadata (and optionally a role) or nullptr if there is no qualifying metadata

Implemented in opensaml::saml2md::AbstractDynamicMetadataProvider, and opensaml::saml2md::AbstractMetadataProvider.

## getId()

virtual const char * opensaml::saml2md::MetadataProvider::getId | ( |  | ) | const

virtual

Returns an identifier for the provider for logging/status purposes.

Returns
  an identifier, or null

Reimplemented in opensaml::saml2md::AbstractDynamicMetadataProvider.

## getMetadata()

virtual const xmltooling::XMLObject * opensaml::saml2md::MetadataProvider::getMetadata | ( |  | ) | const

pure virtual

Gets the entire metadata tree, after the registered filter has been applied.

The caller MUST unlock the provider when finished with the data.

Returns
  the entire metadata tree

Implemented in opensaml::saml2md::AbstractDynamicMetadataProvider.

## init()

virtual void opensaml::saml2md::MetadataProvider::init | ( |  | ) |

pure virtual

Should be called after instantiating provider and adding filters, but before performing any lookup operations.

Allows the provider to defer initialization processes that are likely to result in exceptions until after the provider is safely created. Providers SHOULD perform as much processing as possible in this method so as to report/log any errors that would affect later processing.

## outputStatus()

virtual void opensaml::saml2md::MetadataProvider::outputStatus | ( | std::ostream & | os | ) | const

virtual

Generate an XML representation of the provider's status.

The XML must be well-formed, but is otherwise arbitrary.

Parameters

  os | stream to write status information to

Reimplemented in opensaml::saml2md::AbstractMetadataProvider.

## removeMetadataFilter()

virtual MetadataFilter * opensaml::saml2md::MetadataProvider::removeMetadataFilter | ( | MetadataFilter * | oldFilter | ) |

virtual

Removes a metadata filter.

The caller must delete the filter if necessary.

Parameters

  oldFilter | metadata filter to remove

Returns
  the old filter

## setContext()

void opensaml::saml2md::MetadataProvider::setContext | ( | const MetadataFilterContext * | ctx | ) |

Sets a filtering context object for use by the filtering process.

The object's lifetime must last for the duration of the lifetime of the MetadataProvider.

Parameters

  ctx | a context object

The documentation for this class was generated from the following file:

- saml/saml2/metadata/MetadataProvider.h