Method to add protocol to a role.
[shibboleth/opensaml2.git] / saml / saml2 / metadata / impl / MetadataImpl.cpp
index f6503ec..d6f4ce9 100644 (file)
@@ -23,7 +23,6 @@
 #include "internal.h"
 #include "exceptions.h"
 #include "saml2/metadata/Metadata.h"
-#include "saml2/metadata/MetadataKeyInfoIterator.h"
 
 #include <xmltooling/AbstractComplexElement.h>
 #include <xmltooling/AbstractSimpleElement.h>
@@ -956,23 +955,6 @@ namespace opensaml {
                     m_Signature->setContentReference(new opensaml::ContentReference(*this));
             }
             
-            KeyInfoIterator* getKeyInfoIterator() const {
-                return new MetadataKeyInfoIterator(*this);
-            }
-
-            std::string getName() const {
-                const EntityDescriptor* parent = dynamic_cast<const EntityDescriptor*>(getParent());
-                if (parent) {
-                    char* ch = toUTF8(parent->getEntityID());
-                    if (ch) {
-                        string s(ch);
-                        delete[] ch;
-                        return s;
-                    }
-                }
-                return "";
-            }
-            
             IMPL_ID_ATTRIB(ID);
             IMPL_STRING_ATTRIB(ProtocolSupportEnumeration);
             IMPL_STRING_ATTRIB(ErrorURL);
@@ -1014,6 +996,27 @@ namespace opensaml {
                 }
                 return false;
             }
+
+            void addSupport(const XMLCh* protocol) {
+                if (hasSupport(protocol))
+                    return;
+                if (m_ProtocolSupportEnumeration && *m_ProtocolSupportEnumeration) {
+#ifdef HAVE_GOOD_STL
+                    xstring pse(m_ProtocolSupportEnumeration);
+                    pse = pse + chSpace + protocol;
+                    setProtocolSupportEnumeration(pse.c_str());
+#else
+                    auto_ptr_char temp(m_ProtocolSupportEnumeration);
+                    string pse(temp.get());
+                    pse = pse + ' ' + protocol;
+                    auto_ptr_XMLCh temp2(pse.c_str());
+                    setProtocolSupportEnumeration(temp2.get());
+#endif
+                }
+                else {
+                    setProtocolSupportEnumeration(protocol);
+                }
+            }
     
             void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) {
                 if (!qualifiedName.hasNamespaceURI()) {