Suppress VS warning.
[shibboleth/sp.git] / shibsp / Application.cpp
index 8e41cab..d962cf1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2007 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.
@@ -28,6 +28,7 @@
 #include "remoting/ListenerService.h"
 
 #include <algorithm>
+#include <xmltooling/util/Threads.h>
 
 using namespace shibsp;
 using namespace xmltooling;
@@ -42,6 +43,17 @@ Application::~Application()
     delete m_lock;
 }
 
+const ServiceProvider& Application::getServiceProvider() const
+{
+    return *m_sp;
+}
+
+const char* Application::getId() const
+{
+    pair<bool,const char*> ret = getString("id");
+    return ret.first ? ret.second : "default";
+}
+
 pair<string,const char*> Application::getCookieNameProps(const char* prefix, time_t* lifetime) const
 {
     static const char* defProps="; path=/";
@@ -68,6 +80,21 @@ pair<string,const char*> Application::getCookieNameProps(const char* prefix, tim
     return pair<string,const char*>(prefix,defProps);
 }
 
+void Application::clearHeader(SPRequest& request, const char* rawname, const char* cginame) const
+{
+    request.clearHeader(rawname, cginame);
+}
+
+void Application::setHeader(SPRequest& request, const char* name, const char* value) const
+{
+    request.setHeader(name, value);
+}
+
+string Application::getSecureHeader(const SPRequest& request, const char* name) const
+{
+    return request.getSecureHeader(name);
+}
+
 void Application::clearAttributeHeaders(SPRequest& request) const
 {
     if (SPConfig::getConfig().isEnabled(SPConfig::OutOfProcess)) {
@@ -106,3 +133,10 @@ void Application::clearAttributeHeaders(SPRequest& request) const
     for (vector< pair<string,string> >::const_iterator i = m_unsetHeaders.begin(); i!=m_unsetHeaders.end(); ++i)
         request.clearHeader(i->first.c_str(), i->second.c_str());
 }
+
+const Handler* Application::getAssertionConsumerServiceByProtocol(const XMLCh* protocol, const char* binding) const
+{
+    auto_ptr_XMLCh b(binding);
+    const vector<const Handler*>& handlers = getAssertionConsumerServicesByBinding(b.get());
+    return handlers.empty() ? nullptr : handlers.front();
+}