X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=saml%2Fsaml2%2Fmetadata%2FChainingMetadataProvider.h;fp=saml%2Fsaml2%2Fmetadata%2FChainingMetadataProvider.h;h=42b90e1d8036880279dd341cc3fe711210d9f0d5;hb=1ffcb743f90aeb3da11054316f3d005ff7edbf7b;hp=d71a254934218872155a5c0d9756d7e1e9cb13be;hpb=e8d75900802dfa84c06290f88e365fd355ce6881;p=shibboleth%2Fcpp-opensaml.git diff --git a/saml/saml2/metadata/ChainingMetadataProvider.h b/saml/saml2/metadata/ChainingMetadataProvider.h index d71a254..42b90e1 100644 --- a/saml/saml2/metadata/ChainingMetadataProvider.h +++ b/saml/saml2/metadata/ChainingMetadataProvider.h @@ -1,101 +1,101 @@ -/* - * Copyright 2001-2006 Internet2 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file saml/security/ChainingMetadataProvider.h - * - * MetadataProvider that uses multiple providers in sequence. - */ - -#ifndef __saml_chainmeta_h__ -#define __saml_chainmeta_h__ - -#include -#include - -namespace opensaml { - namespace saml2md { - - /** - * MetadataProvider that uses multiple providers in sequence. - */ - class SAML_API ChainingMetadataProvider - : public ObservableMetadataProvider, public ObservableMetadataProvider::Observer { - public: - /** - * Constructor. - * - * If a DOM is supplied, the following XML content is supported: - * - * - * - * XML namespaces are ignored in the processing of this content. - * - * @param e DOM to supply configuration for provider - */ - ChainingMetadataProvider(const DOMElement* e=NULL); - - /** - * Destructor will delete any embedded engines. - */ - virtual ~ChainingMetadataProvider(); - - /** - * Adds a provider for future calls. The provider MUST be - * initialized before adding it. - * - * @param newProvider provider to add - */ - void addMetadataProvider(MetadataProvider* newProvider) { - m_providers.push_back(newProvider); - } - - /** - * Removes a provider. The caller must delete the provider if necessary. - * - * @param oldProvider provider to remove - * @return the old provider - */ - MetadataProvider* removeMetadataProvider(MetadataProvider* oldProvider) { - for (std::vector::iterator i=m_providers.begin(); i!=m_providers.end(); i++) { - if (oldProvider==(*i)) { - m_providers.erase(i); - return oldProvider; - } - } - return NULL; - } - - xmltooling::Lockable* lock(); - void unlock(); - void init(); - const xmlsignature::KeyResolver* getKeyResolver() const; - const xmltooling::XMLObject* getMetadata() const; - const EntitiesDescriptor* getEntitiesDescriptor(const char* name, bool requireValidMetadata=true) const; - const EntityDescriptor* getEntityDescriptor(const char* id, bool requireValidMetadata=true) const; - const EntityDescriptor* getEntityDescriptor(const SAMLArtifact* artifact) const; - void onEvent(MetadataProvider& provider); - - private: - xmltooling::ThreadKey* m_tlsKey; - std::vector m_providers; - }; - }; -}; - -#endif /* __saml_chainmeta_h__ */ +/* + * Copyright 2001-2006 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file saml/security/ChainingMetadataProvider.h + * + * MetadataProvider that uses multiple providers in sequence. + */ + +#ifndef __saml_chainmeta_h__ +#define __saml_chainmeta_h__ + +#include +#include + +namespace opensaml { + namespace saml2md { + + /** + * MetadataProvider that uses multiple providers in sequence. + */ + class SAML_API ChainingMetadataProvider + : public ObservableMetadataProvider, public ObservableMetadataProvider::Observer { + public: + /** + * Constructor. + * + * If a DOM is supplied, the following XML content is supported: + * + *
    + *
  • <MetadataProvider> elements with a type attribute + *
+ * + * XML namespaces are ignored in the processing of this content. + * + * @param e DOM to supply configuration for provider + */ + ChainingMetadataProvider(const DOMElement* e=NULL); + + /** + * Destructor will delete any embedded engines. + */ + virtual ~ChainingMetadataProvider(); + + /** + * Adds a provider for future calls. The provider MUST be + * initialized before adding it. + * + * @param newProvider provider to add + */ + void addMetadataProvider(MetadataProvider* newProvider) { + m_providers.push_back(newProvider); + } + + /** + * Removes a provider. The caller must delete the provider if necessary. + * + * @param oldProvider provider to remove + * @return the old provider + */ + MetadataProvider* removeMetadataProvider(MetadataProvider* oldProvider) { + for (std::vector::iterator i=m_providers.begin(); i!=m_providers.end(); i++) { + if (oldProvider==(*i)) { + m_providers.erase(i); + return oldProvider; + } + } + return NULL; + } + + xmltooling::Lockable* lock(); + void unlock(); + void init(); + const xmlsignature::KeyResolver* getKeyResolver() const; + const xmltooling::XMLObject* getMetadata() const; + const EntitiesDescriptor* getEntitiesDescriptor(const char* name, bool requireValidMetadata=true) const; + const EntityDescriptor* getEntityDescriptor(const char* id, bool requireValidMetadata=true) const; + const EntityDescriptor* getEntityDescriptor(const SAMLArtifact* artifact) const; + void onEvent(MetadataProvider& provider); + + private: + xmltooling::ThreadKey* m_tlsKey; + std::vector m_providers; + }; + }; +}; + +#endif /* __saml_chainmeta_h__ */