Implement basic methods, add subclass for the guts.
authorcantor <cantor@3ebe4818-3638-0410-822d-ece5924dabe2>
Sat, 18 Sep 2010 22:27:46 +0000 (22:27 +0000)
committercantor <cantor@3ebe4818-3638-0410-822d-ece5924dabe2>
Sat, 18 Sep 2010 22:27:46 +0000 (22:27 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/shib-extension/cpp-sp-resolver/trunk@265 3ebe4818-3638-0410-822d-ece5924dabe2

shibresolver/resolver.cpp
shibresolver/resolver.h

index dbe3968..9a95fe8 100644 (file)
 
 #include "internal.h"
 
 
 #include "internal.h"
 
+#include <shibsp/ServiceProvider.h>
+#include <shibsp/attribute/Attribute.h>
+#include <shibsp/remoting/ListenerService.h>
+
+using namespace shibresolver;
 using namespace shibsp;
 #ifndef SHIBSP_LITE
 using namespace opensaml;
 using namespace shibsp;
 #ifndef SHIBSP_LITE
 using namespace opensaml;
@@ -29,6 +34,92 @@ using namespace opensaml;
 using namespace xmltooling;
 using namespace std;
 
 using namespace xmltooling;
 using namespace std;
 
+namespace shibresolver {
+    class SHIBRESOLVER_DLLLOCAL ResolverImpl : public ShibbolethResolver, public Remoted {
+    public:
+        ResolverImpl() {}
+        ~ResolverImpl() {}
+
+        void resolve();
+        void receive(DDF& in, ostream& out);
+    };
+};
+
+ShibbolethResolver* ShibbolethResolver::create()
+{
+    return new ResolverImpl();
+}
+
+ShibbolethResolver::ShibbolethResolver()
+{
+}
+
+ShibbolethResolver::~ShibbolethResolver()
+{
+    for_each(m_resolvedAttributes.begin(), m_resolvedAttributes.end(), xmltooling::cleanup<Attribute>());
+    if (m_mapper)
+        m_mapper->unlock();
+    if (m_sp)
+        m_sp->unlock();
+}
+
+void ShibbolethResolver::setServiceURI(const char* uri)
+{
+    m_serviceURI.erase();
+    if (uri)
+        m_serviceURI = uri;
+}
+
+void ShibbolethResolver::setApplicationID(const char* appID)
+{
+    m_appID.erase();
+    if (appID)
+        m_appID = appID;
+}
+
+void ShibbolethResolver::setIssuer(const char* issuer)
+{
+    m_issuer.erase();
+    if (issuer)
+        m_issuer = issuer;
+}
+
+void ShibbolethResolver::addToken(
+#ifdef SHIBSP_LITE
+        const XMLObject* token
+#else
+        const saml2::Assertion* token
+#endif
+    )
+{
+    if (token)
+        m_tokens.push_back(token);
+}
+
+void ShibbolethResolver::addAttribute(Attribute* attr)
+{
+    if (attr)
+        m_inputAttributes.push_back(attr);
+}
+
+vector<Attribute*>& ShibbolethResolver::getResolvedAttributes()
+{
+    return m_resolvedAttributes;
+}
+
+RequestMapper::Settings ShibbolethResolver::getSettings() const
+{
+    return m_settings;
+}
+
+void ResolverImpl::resolve()
+{
+}
+
+void ResolverImpl::receive(DDF& in, ostream& out)
+{
+}
+
 extern "C" int SHIBRESOLVER_EXPORTS xmltooling_extension_init(void*)
 {
     // Register factory functions with appropriate plugin managers in the XMLTooling/SAML/SPConfig objects.
 extern "C" int SHIBRESOLVER_EXPORTS xmltooling_extension_init(void*)
 {
     // Register factory functions with appropriate plugin managers in the XMLTooling/SAML/SPConfig objects.
index 610ea46..947e8ab 100644 (file)
@@ -125,7 +125,7 @@ namespace shibresolver {
          *
          * @return  array of resolved Attributes
          */
          *
          * @return  array of resolved Attributes
          */
-        std::vector<shibsp::Attribute*>& getResolvedAttributes() const;
+        std::vector<shibsp::Attribute*>& getResolvedAttributes();
 
         /**
          * Returns mapped PropertySet and AccessControl objects, if any.
 
         /**
          * Returns mapped PropertySet and AccessControl objects, if any.