Improve property inheritance, first batch of SessionInitiators, rename providerId.
[shibboleth/sp.git] / shibsp / handler / AbstractHandler.h
index 4f1cb85..31a5cbf 100644 (file)
 
 #include <shibsp/handler/Handler.h>
 #include <shibsp/util/DOMPropertySet.h>
+
 #include <log4cpp/Category.hh>
+#include <saml/binding/HTTPRequest.h>
 #include <xmltooling/XMLObject.h>
 
 namespace shibsp {
 
+    class SHIBSP_API SPRequest;
+
 #if defined (_MSC_VER)
     #pragma warning( push )
     #pragma warning( disable : 4250 )
@@ -65,9 +69,33 @@ namespace shibsp {
          */
         virtual void checkError(const xmltooling::XMLObject* response) const;
         
+        /**
+         * Implements various mechanisms to preserve RelayState,
+         * such as cookies or StorageService-backed keys.
+         * 
+         * <p>If a supported mechanism can be identified, the input parameter will be
+         * replaced with a suitable state key, URL-encoded.
+         * 
+         * @param request       the active SPRequest
+         * @param relayState    RelayState token to supply with message
+         */
+        virtual void preserveRelayState(SPRequest& request, std::string& relayState) const;
+
+        /**
+         * Implements various mechanisms to recover RelayState,
+         * such as cookies or StorageService-backed keys.
+         * 
+         * <p>If a supported mechanism can be identified, the input parameter will be
+         * replaced with the recovered state information.
+         * 
+         * @param httpRequest   incoming HTTP request
+         * @param relayState    RelayState token supplied with message
+         */
+        virtual void recoverRelayState(opensaml::HTTPRequest& httpRequest, std::string& relayState) const;
+        
         /** Logging object. */
-        log4cpp::Category& m_log; 
-    
+        log4cpp::Category& m_log;
+        
     public:
         virtual ~AbstractHandler() {}
     };