Add context API to metadata filters.
[shibboleth/cpp-opensaml.git] / saml / saml2 / metadata / MetadataProvider.h
index 05d2493..eea4120 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <vector>
 #include <iostream>
+#include <boost/shared_ptr.hpp>
 #include <boost/ptr_container/ptr_vector.hpp>
 #include <xmltooling/exceptions.h>
 #include <xmltooling/security/CredentialResolver.h>
@@ -51,6 +52,7 @@ namespace opensaml {
         class SAML_API RoleDescriptor;
         class SAML_API MetadataCredentialResolver;
         class SAML_API MetadataFilter;
+        class SAML_API MetadataFilterContext;
 
 #if defined (_MSC_VER)
         #pragma warning( push )
@@ -121,6 +123,15 @@ namespace opensaml {
             virtual MetadataFilter* removeMetadataFilter(MetadataFilter* oldFilter);
 
             /**
+             * Sets a filtering context object for use by the filtering process.
+             * <p>The MetadataProvider takes ownership of the object. Any existing
+             * object is cleared.
+             *
+             * @param ctx   a context object
+             */
+            void setContext(MetadataFilterContext* ctx);
+
+            /**
              * Should be called after instantiating provider and adding filters, but before
              * performing any lookup operations. Allows the provider to defer initialization
              * processes that are likely to result in exceptions until after the provider is
@@ -251,6 +262,7 @@ namespace opensaml {
             void doFilters(xmltooling::XMLObject& xmlObject) const;
 
         private:
+            boost::shared_ptr<MetadataFilterContext> m_filterContext;
             boost::ptr_vector<MetadataFilter> m_filters;
         };