opensaml-3.2.1
opensaml::saml2md::AbstractMetadataProvider Class Reference

Base class for caching metadata providers. More...

#include <saml/saml2/metadata/AbstractMetadataProvider.h>

Inheritance diagram for opensaml::saml2md::AbstractMetadataProvider:
opensaml::saml2md::ObservableMetadataProvider opensaml::saml2md::MetadataProvider opensaml::saml2md::AbstractDynamicMetadataProvider

Public Member Functions

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.
 
void emitChangeEvent (const EntityDescriptor &) const
 Convenience method for notifying every registered Observer of an event.
 
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< const xmltooling::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 ObserverremoveObserver (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 MetadataFilterremoveMetadataFilter (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 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...
 

Protected Member Functions

 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...
 
- 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

time_t m_lastUpdate
 Time of last update for reporting. More...
 
xmltooling::KeyInfoResolver * m_resolver
 Embedded KeyInfoResolver instance. More...
 

Detailed Description

Base class for caching metadata providers.

Constructor & Destructor Documentation

◆ AbstractMetadataProvider()

opensaml::saml2md::AbstractMetadataProvider::AbstractMetadataProvider ( const xercesc::DOMElement *  e = 0,
bool  deprecationSupport = true 
)
protected

Constructor.

If a DOM is supplied, a set of default logic will be used to identify and build a KeyInfoResolver plugin and install it into the provider.

The following XML content is supported:

  • <KeyInfoResolver> elements with a type attribute

XML namespaces are ignored in the processing of these elements.

Parameters
eDOM to supply configuration for provider
deprecationSupporttrue iff deprecated features and settings should be supported

Member Function Documentation

◆ clearDescriptorIndex()

virtual void opensaml::saml2md::AbstractMetadataProvider::clearDescriptorIndex ( bool  freeSites = false)
protectedvirtual

Clear the cache of known entities and groups.

Parameters
freeSitestrue iff the objects cached in the site map should be freed.

◆ getEntitiesDescriptor() [1/3]

virtual const EntitiesDescriptor* opensaml::saml2md::MetadataProvider::getEntitiesDescriptor

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
namethe name of the group
requireValidMetadataindicates 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

◆ getEntitiesDescriptor() [2/3]

virtual const EntitiesDescriptor* opensaml::saml2md::MetadataProvider::getEntitiesDescriptor

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
namethe name of the group
requireValidMetadataindicates 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

◆ getEntitiesDescriptor() [3/3]

const EntitiesDescriptor* opensaml::saml2md::AbstractMetadataProvider::getEntitiesDescriptor ( const char *  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
namethe name of the group
requireValidMetadataindicates 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

Implements opensaml::saml2md::MetadataProvider.

◆ getEntityDescriptor() [1/2]

virtual std::pair<const EntityDescriptor*,const RoleDescriptor*> opensaml::saml2md::MetadataProvider::getEntityDescriptor

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
criterialookup criteria
Returns
the entity's metadata (and optionally a role) or nullptr if there is no qualifying metadata

◆ getEntityDescriptor() [2/2]

std::pair<const EntityDescriptor*,const RoleDescriptor*> opensaml::saml2md::AbstractMetadataProvider::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
criterialookup criteria
Returns
the entity's metadata (and optionally a role) or nullptr if there is no qualifying metadata

Implements opensaml::saml2md::MetadataProvider.

◆ indexEntity()

virtual void opensaml::saml2md::AbstractMetadataProvider::indexEntity ( EntityDescriptor *  site,
time_t &  validUntil,
bool  replace = false 
) const
protectedvirtual

Loads an entity into the cache for faster lookup.

This includes processing known reverse lookup strategies for artifacts. The validUntil parameter will contain the smallest value found on output. This method will not free any objects removed from the cache.

Parameters
siteentity definition
validUntilmaximum expiration time of the entity definition
replacetrue iff existing entries for the same entity should be cleared/replaced

◆ indexGroup()

virtual void opensaml::saml2md::AbstractMetadataProvider::indexGroup ( EntitiesDescriptor *  group,
time_t &  validUntil 
) const
protectedvirtual

Loads a group of entities into the cache for faster lookup.

The validUntil parameter will contain the smallest value found on output.

Parameters
groupgroup definition
validUntilmaximum expiration time of the group definition

◆ outputStatus()

void opensaml::saml2md::AbstractMetadataProvider::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
osstream to write status information to

Reimplemented from opensaml::saml2md::MetadataProvider.

◆ unindex()

virtual void opensaml::saml2md::AbstractMetadataProvider::unindex ( const XMLCh *  entityID,
bool  freeSites = false 
) const
protectedvirtual

Clear a specific entity from the cache.

Parameters
entityIDthe ID of the entity to remove
freeSitestrue iff the objects cached in the site map should be freed.

Member Data Documentation

◆ m_lastUpdate

time_t opensaml::saml2md::AbstractMetadataProvider::m_lastUpdate
mutableprotected

Time of last update for reporting.

◆ m_resolver

xmltooling::KeyInfoResolver* opensaml::saml2md::AbstractMetadataProvider::m_resolver
protected

Embedded KeyInfoResolver instance.


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