opensaml::saml2md::AbstractDynamicMetadataProvider Class Reference

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

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

Inheritance diagram for opensaml::saml2md::AbstractDynamicMetadataProvider:

opensaml::saml2md::AbstractMetadataProvider opensaml::saml2md::ObservableMetadataProvider opensaml::saml2md::MetadataProvider

List of all members.

Public Member Functions

 AbstractDynamicMetadataProvider (bool defaultNegativeCache, const xercesc::DOMElement *e=0, bool deprecationSupport=true)
 Constructor.
xmltooling::Lockable * lock ()
void unlock ()
const char * getId () const
 Returns an identifier for the provider for logging/status purposes.
const xmltooling::XMLObject * getMetadata () const
 Gets the entire metadata tree, after the registered filter has been applied.
std::pair< const
EntityDescriptor *, const
RoleDescriptor * > 
getEntityDescriptor (const Criteria &criteria) const
 Gets entity metadata based on supplied criteria.

Protected Member Functions

virtual EntityDescriptorresolve (const Criteria &criteria, std::string &cacheTag) const =0
 Resolves a metadata instance using the supplied criteria.
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.
time_t computeNextRefresh (const EntityDescriptor &entity, time_t currentTime) const
 Compute the number of seconds until the next refresh attempt.
EntityDescriptorentityFromStream (std::istream &stream) const
 Parse and unmarshal the provided stream, returning the EntityDescriptor if there is one.

Protected Attributes

bool m_validate
 Controls XML schema validation.


Detailed Description

Simple implementation of a dynamic, caching MetadataProvider.

Constructor & Destructor Documentation

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

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.

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.

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

Reimplemented from opensaml::saml2md::AbstractMetadataProvider.

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

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)

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

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


Member Data Documentation

Controls XML schema validation.


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

Generated on Mon Apr 13 19:46:41 2020 for opensaml-3.1.0 by  doxygen 1.5.6