2 * Copyright 2001-2007 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/DynamicMetadataProvider.h
20 * Simple implementation of a dynamic caching MetadataProvider.
23 #ifndef __saml2_dynmetadataprov_h__
24 #define __saml2_dynmetadataprov_h__
26 #include <saml/saml2/metadata/AbstractMetadataProvider.h>
32 * Simple implementation of a dynamic, caching MetadataProvider.
34 class SAML_API DynamicMetadataProvider : public AbstractMetadataProvider
40 * @param e DOM to supply configuration for provider
42 DynamicMetadataProvider(const xercesc::DOMElement* e=NULL);
44 virtual ~DynamicMetadataProvider();
46 xmltooling::Lockable* lock() {
58 const xmltooling::XMLObject* getMetadata() const {
59 throw MetadataException("getMetadata operation not implemented on this provider.");
62 std::pair<const EntityDescriptor*,const RoleDescriptor*> getEntityDescriptor(const Criteria& criteria) const;
65 /** Controls XML schema validation. */
68 /** Caps the allowable cache duration of a metadata instance. */
69 time_t m_maxCacheDuration;
72 * Resolves a metadata instance using the supplied criteria.
74 * @param criteria lookup criteria
75 * @return a valid metadata instance
77 virtual EntityDescriptor* resolve(const Criteria& criteria) const;
80 mutable xmltooling::RWLock* m_lock;
86 #endif /* __saml2_dynmetadataprov_h__ */