Major revamp of credential and trust handling code, PKIX engine still needs work.
[shibboleth/cpp-opensaml.git] / saml / saml2 / metadata / MetadataFilter.h
index 5c5f373..a4482d9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2006 Internet2
+ *  Copyright 2001-2007 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 
 /**
- * @file MetadataFilter.h
+ * @file saml/saml2/metadata/MetadataFilter.h
  * 
  * Processes metadata after it's been unmarshalled.
  */
 
+#include <saml/base.h>
+#include <saml/exceptions.h>
+#include <saml/saml2/metadata/MetadataProvider.h>
+
+#include <xmltooling/XMLObject.h>
+
 #ifndef __saml2_metadatafilt_h__
 #define __saml2_metadatafilt_h__
 
-#include <saml/saml2/metadata/Metadata.h>
-
 namespace opensaml {
 
     namespace saml2md {
@@ -39,7 +43,8 @@ namespace opensaml {
         class SAML_API MetadataFilter
         {
             MAKE_NONCOPYABLE(MetadataFilter);
-            
+        protected:
+            MetadataFilter() {}
         public:
             virtual ~MetadataFilter() {}
             
@@ -55,11 +60,25 @@ namespace opensaml {
              * signal the removal of information, only for systemic processing failure.
              * 
              * @param xmlObject the metadata to be filtered.
-             * @throws FilterException thrown if an error occurs during the filtering process
              */
             virtual void doFilter(xmltooling::XMLObject& xmlObject) const=0;
         };
 
+        /**
+         * Registers MetadataFilter classes into the runtime.
+         */
+        void SAML_API registerMetadataFilters();
+        
+        /** MetadataFilter that deletes blacklisted entities. */
+        #define BLACKLIST_METADATA_FILTER  "Blacklist"
+
+        /** MetadataFilter that deletes all but whitelisted entities. */
+        #define WHITELIST_METADATA_FILTER  "Whitelist"
+
+        /** MetadataFilter that verifies signatures and filters out any that don't pass. */
+        #define SIGNATURE_METADATA_FILTER  "Signature"
+        
+        DECL_XMLTOOLING_EXCEPTION(MetadataFilterException,SAML_EXCEPTIONAPI(SAML_API),opensaml::saml2md,MetadataException,Exceptions related to metadata filtering);
     };
 };