Default response methods.
[shibboleth/cpp-opensaml.git] / saml / binding / MessageFlowRule.h
index 97c9797..0dfc97d 100644 (file)
@@ -20,6 +20,9 @@
  * SAML replay and freshness checking SecurityPolicyRule
  */
 
+#ifndef __saml_flowrule_h__
+#define __saml_flowrule_h__
+
 #include <saml/binding/SecurityPolicyRule.h>
 
 
@@ -27,8 +30,8 @@ namespace opensaml {
     /**
      * SAML replay and freshness checking SecurityPolicyRule
      * 
-     * Subclasses can provide support for additional message types
-     * by overriding the main method and then calling the check method.
+     * Some form of message rule to extract ID and timestamp must be
+     * run prior to this rule.
      */
     class SAML_API MessageFlowRule : public SecurityPolicyRule
     {
@@ -36,24 +39,25 @@ namespace opensaml {
         MessageFlowRule(const DOMElement* e);
         virtual ~MessageFlowRule() {}
         
-        std::pair<saml2::Issuer*,const saml2md::RoleDescriptor*> evaluate(
-            const GenericRequest& request,
-            const xmltooling::XMLObject& message,
-            const saml2md::MetadataProvider* metadataProvider,
-            const xmltooling::QName* role,
-            const TrustEngine* trustEngine
-            ) const;
-    
-    protected:
+        void evaluate(const xmltooling::XMLObject& message, const GenericRequest* request, SecurityPolicy& policy) const;
+
         /**
-         * Performs the check.
+         * Controls whether rule executes replay checking.
          * 
-         * @param id            message identifier
-         * @param issueInstant  timestamp of protocol message
+         * @param checkReplay  replay checking value to set
+         */
+        void setCheckReplay(bool checkReplay) {
+            m_checkReplay = checkReplay;
+        }
+    
+        /**
+         * Controls maximum elapsed time between message issue and rule execution.
          * 
-         * @exception BindingException  raised if a check fails  
+         * @param expires  maximum elapsed time in seconds
          */
-        void check(const XMLCh* id, time_t issueInstant) const;
+        void setExpires(time_t expires) {
+            m_expires = expires;
+        }
     
     private:
         bool m_checkReplay;
@@ -61,3 +65,5 @@ namespace opensaml {
     };
     
 };
+
+#endif /* __saml_flowrule_h__ */