Add property for protocol family to encoders/decoders.
authorScott Cantor <cantor.2@osu.edu>
Tue, 10 Aug 2010 03:02:04 +0000 (03:02 +0000)
committerScott Cantor <cantor.2@osu.edu>
Tue, 10 Aug 2010 03:02:04 +0000 (03:02 +0000)
16 files changed:
saml/binding/MessageDecoder.h
saml/binding/MessageEncoder.h
saml/binding/impl/MessageDecoder.cpp
saml/binding/impl/MessageEncoder.cpp
saml/saml1/binding/SAML1MessageDecoder.h
saml/saml1/binding/impl/SAML1ArtifactEncoder.cpp
saml/saml1/binding/impl/SAML1MessageDecoder.cpp
saml/saml1/binding/impl/SAML1POSTEncoder.cpp
saml/saml1/binding/impl/SAML1SOAPEncoder.cpp
saml/saml2/binding/SAML2MessageDecoder.h
saml/saml2/binding/impl/SAML2ArtifactEncoder.cpp
saml/saml2/binding/impl/SAML2ECPEncoder.cpp
saml/saml2/binding/impl/SAML2MessageDecoder.cpp
saml/saml2/binding/impl/SAML2POSTEncoder.cpp
saml/saml2/binding/impl/SAML2RedirectEncoder.cpp
saml/saml2/binding/impl/SAML2SOAPEncoder.cpp

index 1667a10..bbe176e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2009 Internet2
+ *  Copyright 2001-2010 Internet2
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -61,6 +61,13 @@ namespace opensaml {
         virtual ~MessageDecoder();
 
         /**
+         * Returns identifier for the protocol family associated with the decoder.
+         *
+         * @return  a protocol family identifier, or nullptr
+         */
+        virtual const XMLCh* getProtocolFamily() const;
+
+        /**
          * Indicates whether a web browser or similar user agent delivered the message.
          *
          * @return true iff the message was delivered by a user agent
index 5601568..095a523 100644 (file)
@@ -65,6 +65,13 @@ namespace opensaml {
         virtual bool isUserAgentPresent() const;
 
         /**
+         * Returns identifier for the protocol family associated with the encoder.
+         *
+         * @return  a protocol family identifier, or nullptr
+         */
+        virtual const XMLCh* getProtocolFamily() const;
+
+        /**
          * Interface to caller-supplied artifact generation mechanism.
          * 
          * Generating an artifact for storage and retrieval requires knowledge of
index d5f223d..4ff6c79 100644 (file)
@@ -74,6 +74,11 @@ MessageDecoder::~MessageDecoder()
 {
 }
 
+const XMLCh* MessageDecoder::getProtocolFamily() const
+{
+    return nullptr;
+}
+
 bool MessageDecoder::isUserAgentPresent() const
 {
     return true;
index c4f3e69..035ad55 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2009 Internet2
+ *  Copyright 2001-2010 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -71,6 +71,11 @@ MessageEncoder::~MessageEncoder()
 {
 }
 
+const XMLCh* MessageEncoder::getProtocolFamily() const
+{
+    return nullptr;
+}
+
 bool MessageEncoder::isCompact() const
 {
     return false;
index 2346624..7eda2e1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2009 Internet2
+ *  Copyright 2001-2010 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -39,6 +39,7 @@ namespace opensaml {
             virtual ~SAML1MessageDecoder();
 
         public:
+            const XMLCh* getProtocolFamily() const;
             void extractMessageDetails (
                 const xmltooling::XMLObject& message,
                 const xmltooling::GenericRequest& genericRequest,
index 5ab34c5..99c1432 100644 (file)
@@ -51,7 +51,11 @@ namespace opensaml {
         public:
             SAML1ArtifactEncoder() {}
             virtual ~SAML1ArtifactEncoder() {}
-            
+
+            const XMLCh* getProtocolFamily() const {
+                return samlconstants::SAML11_PROTOCOL_ENUM;
+            }
+
             long encode(
                 GenericResponse& genericResponse,
                 XMLObject* xmlObject,
index 842b52c..97a681e 100644 (file)
@@ -46,6 +46,11 @@ SAML1MessageDecoder::~SAML1MessageDecoder()
 {
 }
 
+const XMLCh* SAML1MessageDecoder::getProtocolFamily() const
+{
+    return samlconstants::SAML11_PROTOCOL_ENUM;
+}
+
 void SAML1MessageDecoder::extractMessageDetails(
     const XMLObject& message, const GenericRequest& req, const XMLCh* protocol, SecurityPolicy& policy
     ) const
index d649db7..73dc625 100644 (file)
@@ -53,7 +53,11 @@ namespace opensaml {
         public:
             SAML1POSTEncoder(const DOMElement* e, const XMLCh* ns);
             virtual ~SAML1POSTEncoder() {}
-            
+
+            const XMLCh* getProtocolFamily() const {
+                return samlconstants::SAML11_PROTOCOL_ENUM;
+            }
+
             long encode(
                 GenericResponse& genericResponse,
                 XMLObject* xmlObject,
index b41f196..4aef15f 100644 (file)
@@ -54,6 +54,10 @@ namespace opensaml {
                 return false;
             }
 
+            const XMLCh* getProtocolFamily() const {
+                return samlconstants::SAML11_PROTOCOL_ENUM;
+            }
+
             long encode(
                 GenericResponse& genericResponse,
                 XMLObject* xmlObject,
index 7932735..2790ab3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2009 Internet2
+ *  Copyright 2001-2010 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -38,6 +38,7 @@ namespace opensaml {
             virtual ~SAML2MessageDecoder();
 
         public:
+            const XMLCh* getProtocolFamily() const;
             void extractMessageDetails (
                 const xmltooling::XMLObject& message,
                 const xmltooling::GenericRequest& genericRequest,
index a6b7454..138fbd2 100644 (file)
@@ -55,7 +55,11 @@ namespace opensaml {
         public:
             SAML2ArtifactEncoder(const DOMElement* e, const XMLCh* ns);
             virtual ~SAML2ArtifactEncoder() {}
-            
+
+            const XMLCh* getProtocolFamily() const {
+                return samlconstants::SAML20P_NS;
+            }
+
             long encode(
                 GenericResponse& genericResponse,
                 XMLObject* xmlObject,
index 10e6252..36c0fce 100644 (file)
@@ -64,6 +64,10 @@ namespace opensaml {
                 delete m_idpList;
             }
 
+            const XMLCh* getProtocolFamily() const {
+                return samlconstants::SAML20P_NS;
+            }
+
             long encode(
                 GenericResponse& genericResponse,
                 XMLObject* xmlObject,
index 23191df..05253b2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2009 Internet2
+ *  Copyright 2001-2010 Internet2
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -46,6 +46,11 @@ SAML2MessageDecoder::~SAML2MessageDecoder()
 {
 }
 
+const XMLCh* SAML2MessageDecoder::getProtocolFamily() const
+{
+    return samlconstants::SAML20P_NS;
+}
+
 void SAML2MessageDecoder::extractMessageDetails(
     const XMLObject& message, const GenericRequest& request, const XMLCh* protocol, SecurityPolicy& policy
     ) const
index fde133c..53f08cf 100644 (file)
@@ -55,7 +55,11 @@ namespace opensaml {
         public:
             SAML2POSTEncoder(const DOMElement* e, const XMLCh* ns, bool simple=false);
             virtual ~SAML2POSTEncoder() {}
-            
+
+            const XMLCh* getProtocolFamily() const {
+                return samlconstants::SAML20P_NS;
+            }
+
             long encode(
                 GenericResponse& genericResponse,
                 XMLObject* xmlObject,
index b40cb8b..616d98f 100644 (file)
@@ -57,7 +57,11 @@ namespace opensaml {
             bool isCompact() const {
                 return true;
             }
-            
+
+            const XMLCh* getProtocolFamily() const {
+                return samlconstants::SAML20P_NS;
+            }
+
             long encode(
                 GenericResponse& genericResponse,
                 XMLObject* xmlObject,
index e136d92..f9a2e1c 100644 (file)
@@ -54,6 +54,10 @@ namespace opensaml {
                 return false;
             }
 
+            const XMLCh* getProtocolFamily() const {
+                return samlconstants::SAML20P_NS;
+            }
+
             long encode(
                 GenericResponse& genericResponse,
                 XMLObject* xmlObject,