opensaml-3.0.1

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
opensaml::saml2md::AbstractDynamicMetadataProvider Class Referenceabstract

Simple implementation of a dynamic, caching MetadataProvider. More...

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

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

## Public Member Functions
| AbstractDynamicMetadataProvider (bool defaultNegativeCache, const xercesc::DOMElement *e=0, bool deprecationSupport=true)
| Constructor. More...
xmltooling::Lockable * | lock ()
void | unlock ()
const char * | getId () const
| Returns an identifier for the provider for logging/status purposes. More...
const xmltooling::XMLObject * | getMetadata () const
| Gets the entire metadata tree, after the registered filter has been applied. More...
std::pair< const EntityDescriptor *, const RoleDescriptor * > | getEntityDescriptor (const Criteria &criteria) const
| Gets entity metadata based on supplied criteria. More...
Public Member Functions inherited from opensaml::saml2md::AbstractMetadataProvider
void | outputStatus (std::ostream &os) const
| Generate an XML representation of the provider's status. More...
void | emitChangeEvent () const
| Convenience method for notifying every registered Observer of an event. More...
void | emitChangeEvent (const EntityDescriptor &) const
| Convenience method for notifying every registered Observer of an event. More...
std::pair< const EntityDescriptor *, const RoleDescriptor * > | getEntityDescriptor (const Criteria &criteria) const
| Gets entity metadata based on supplied criteria. More...
const EntitiesDescriptor * | getEntitiesDescriptor (const char *name, bool requireValidMetadata=true) const
| Gets the metadata for a given group of entities. More...
const xmltooling::Credential * | resolve (const xmltooling::CredentialCriteria *criteria=0) const
std::vector< constxmltooling::Credential * >::size_type | resolve (std::vector< const xmltooling::Credential * > &results, const xmltooling::CredentialCriteria *criteria=0) const
virtual std::pair< const EntityDescriptor *, const RoleDescriptor * > | getEntityDescriptor (const Criteria &criteria) const=0
| Gets entity metadata based on supplied criteria. More...
virtual const EntitiesDescriptor * | getEntitiesDescriptor (const XMLCh *name, bool requireValidMetadata=true) const
| Gets the metadata for a given group of entities. More...
virtual const EntitiesDescriptor * | getEntitiesDescriptor (const char *name, bool requireValidMetadata=true) const=0
| Gets the metadata for a given group of entities. More...
Public Member Functions inherited from opensaml::saml2md::ObservableMetadataProvider
virtual void | addObserver (const Observer *newObserver) const
| Adds a metadata observer. More...
virtual const Observer * | removeObserver (const Observer *oldObserver) const
| Removes a metadata observer. More...
Public Member Functions inherited from opensaml::saml2md::MetadataProvider
virtual | ~MetadataProvider ()
| Destructor will delete any installed filters.
virtual const char * | getId () const
| Returns an identifier for the provider for logging/status purposes. More...
virtual void | addMetadataFilter (MetadataFilter *newFilter)
| Adds a metadata filter to apply to any resolved metadata. More...
virtual MetadataFilter * | removeMetadataFilter (MetadataFilter *oldFilter)
| Removes a metadata filter. More...
void | setContext (const MetadataFilterContext *ctx)
| Sets a filtering context object for use by the filtering process. More...
virtual void | init ()=0
| Should be called after instantiating provider and adding filters, but before performing any lookup operations. More...
virtual void | outputStatus (std::ostream &os) const
| Generate an XML representation of the provider's status. More...
virtual const xmltooling::XMLObject * | getMetadata () const =0
| Gets the entire metadata tree, after the registered filter has been applied. More...
virtual const EntitiesDescriptor * | getEntitiesDescriptor (const XMLCh *name, bool requireValidMetadata=true) const
| Gets the metadata for a given group of entities. More...
virtual const EntitiesDescriptor * | getEntitiesDescriptor (const char *name, bool requireValidMetadata=true) const =0
| Gets the metadata for a given group of entities. More...
virtual std::pair< const EntityDescriptor *, const RoleDescriptor * > | getEntityDescriptor (const Criteria &criteria) const =0
| Gets entity metadata based on supplied criteria. More...

## Protected Member Functions
virtual EntityDescriptor * | resolve (const Criteria &criteria, std::string &cacheTag) const =0
| Resolves a metadata instance using the supplied criteria. More...
virtual time_t | cacheEntity (EntityDescriptor *entity, const std::string &cacheTag, bool locked=false) const
| Index an entity and cache the fact of it being indexed. More...
time_t | computeNextRefresh (const EntityDescriptor &entity, time_t currentTime) const
| Compute the number of seconds until the next refresh attempt. More...
EntityDescriptor * | entityFromStream (std::istream &stream) const
| Parse and unmarshal the provided stream, returning the EntityDescriptor if there is one. More...
Protected Member Functions inherited from opensaml::saml2md::AbstractMetadataProvider
| AbstractMetadataProvider (const xercesc::DOMElement *e=0, bool deprecationSupport=true)
| Constructor. More...
virtual void | indexEntity (EntityDescriptor *site, time_t &validUntil, bool replace=false) const
| Loads an entity into the cache for faster lookup. More...
virtual void | indexGroup (EntitiesDescriptor *group, time_t &validUntil) const
| Loads a group of entities into the cache for faster lookup. More...
virtual void | unindex (const XMLCh *entityID, bool freeSites=false) const
| Clear a specific entity from the cache. More...
virtual void | clearDescriptorIndex (bool freeSites=false)
| Clear the cache of known entities and groups. More...
Protected Member Functions inherited from opensaml::saml2md::ObservableMetadataProvider
| ObservableMetadataProvider (const xercesc::DOMElement *e=0, bool deprecationSupport=true)
| Constructor. More...
virtual void | emitChangeEvent () const
| Convenience method for notifying every registered Observer of an event. More...
virtual void | emitChangeEvent (const EntityDescriptor &entity) const
| Convenience method for notifying every registered Observer of an event. More...
Protected Member Functions inherited from opensaml::saml2md::MetadataProvider
| MetadataProvider (const xercesc::DOMElement *e, bool deprecationSupport=true)
| Constructor. More...
void | doFilters (const MetadataFilterContext *ctx, xmltooling::XMLObject &xmlObject) const
| Applies any installed filters to a metadata instance. More...

## Protected Attributes
bool | m_validate
| Controls XML schema validation.
Protected Attributes inherited from opensaml::saml2md::AbstractMetadataProvider
time_t | m_lastUpdate
| Time of last update for reporting.
xmltooling::KeyInfoResolver * | m_resolver
| Embedded KeyInfoResolver instance.

## Detailed Description

Simple implementation of a dynamic, caching MetadataProvider.

## Constructor & Destructor Documentation

## ◆ AbstractDynamicMetadataProvider()

opensaml::saml2md::AbstractDynamicMetadataProvider::AbstractDynamicMetadataProvider | ( | bool | defaultNegativeCache,
|  | const xercesc::DOMElement * | e = `0`,
|  | bool | deprecationSupport = `true`
| ) |  |

Constructor.

Parameters

  defaultNegativeCache | - if not specified in the element, do we cache lookup failures?
  e | DOM to supply configuration for provider
  deprecationSupport | true iff deprecated features and settings should be supported

## Member Function Documentation

## ◆ cacheEntity()

virtual time_t opensaml::saml2md::AbstractDynamicMetadataProvider::cacheEntity | ( | EntityDescriptor * | entity,
|  | const std::string & | cacheTag,
|  | bool | locked = `false`
| ) |  | const
| protected virtual

Index an entity and cache the fact of it being indexed.

Parameters

  entity | what to cache
  cacheTag | cache tag
  locked | have we locked ourselves exclusively first?

Returns
  the cache ttl (for logging purposes)

## ◆ computeNextRefresh()

time_t opensaml::saml2md::AbstractDynamicMetadataProvider::computeNextRefresh | ( | const EntityDescriptor & | entity,
|  | time_t | currentTime
| ) |  | const
| protected

Compute the number of seconds until the next refresh attempt.

Parameters

  entity | entity to evaluate
  currentTime | baseline for calculation

Returns
  the cache ttl

## ◆ entityFromStream()

EntityDescriptor * opensaml::saml2md::AbstractDynamicMetadataProvider::entityFromStream | ( | std::istream & | stream | ) | const
| protected

Parse and unmarshal the provided stream, returning the EntityDescriptor if there is one.

Parameters

  stream | the stream to parse

Returns
  the entity, or nullptr if there isn't one

## ◆ getEntityDescriptor()

std::pair< const EntityDescriptor *, const RoleDescriptor * > opensaml::saml2md::AbstractDynamicMetadataProvider::getEntityDescriptor | ( | const Criteria & | criteria | ) | const
| 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

Implements opensaml::saml2md::MetadataProvider.

## ◆ getId()

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

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

Returns
  an identifier, or null

Reimplemented from opensaml::saml2md::MetadataProvider.

## ◆ getMetadata()

const xmltooling::XMLObject * opensaml::saml2md::AbstractDynamicMetadataProvider::getMetadata | ( |  | ) | const
| 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

Implements opensaml::saml2md::MetadataProvider.

## ◆ resolve()

virtual EntityDescriptor * opensaml::saml2md::AbstractDynamicMetadataProvider::resolve | ( | const Criteria & | criteria,
|  | std::string & | cacheTag
| ) |  | const
| protected pure virtual

Resolves a metadata instance using the supplied criteria.

A null return value indicates the instance hasn't changed since the prevous request for the same instance.

The cache tag may be modified on output to update it for future calls.

Parameters

  criteria | lookup criteria
  cacheTag | implementation specific cache tag

Returns
  a valid metadata instance or null

Exceptions

  an | exception if resolution failed

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

- saml/saml2/metadata/AbstractDynamicMetadataProvider.h