2 * Copyright 2001-2006 Internet2
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * @file saml/saml2/metadata/AbstractMetadataProvider.h
20 * Base class for caching metadata providers.
23 #ifndef __saml2_absmetadataprov_h__
24 #define __saml2_absmetadataprov_h__
26 #include <saml/saml2/metadata/ObservableMetadataProvider.h>
33 * Base class for caching metadata providers.
35 class SAML_API AbstractMetadataProvider : public ObservableMetadataProvider
41 * If a DOM is supplied, a set of default logic will be used to identify
42 * and build a KeyResolver plugin and install it into the provider.
44 * The following XML content is supported:
47 * <li><KeyResolver> elements with a type attribute
50 * XML namespaces are ignored in the processing of these elements.
52 * @param e DOM to supply configuration for provider
54 AbstractMetadataProvider(const DOMElement* e=NULL);
56 void emitChangeEvent();
59 virtual ~AbstractMetadataProvider();
61 virtual const xmlsignature::KeyResolver* getKeyResolver() const {
65 virtual const EntityDescriptor* getEntityDescriptor(const char* id, bool requireValidMetadata=true) const;
66 virtual const EntityDescriptor* getEntityDescriptor(const SAMLArtifact* artifact) const;
67 virtual const EntitiesDescriptor* getEntitiesDescriptor(const char* name, bool requireValidMetadata=true) const;
70 /** Embedded KeyResolver instance. */
71 xmlsignature::KeyResolver* m_resolver;
74 * Loads an entity into the cache for faster lookup. This includes
75 * processing known reverse lookup strategies for artifacts.
77 * @param site entity definition
78 * @param validUntil expiration time of the entity definition
80 virtual void index(EntityDescriptor* site, time_t validUntil);
83 * Loads a group of entities into the cache for faster lookup.
85 * @param group group definition
86 * @param validUntil expiration time of the group definition
88 virtual void index(EntitiesDescriptor* group, time_t validUntil);
91 * Clear the cache of known entities and groups.
93 virtual void clearDescriptorIndex();
96 std::vector<MetadataFilter*> m_filters;
98 typedef std::multimap<std::string,const EntityDescriptor*> sitemap_t;
99 typedef std::multimap<std::string,const EntitiesDescriptor*> groupmap_t;
108 #endif /* __saml2_absmetadataprov_h__ */