Missing quote.
[shibboleth/sp.git] / shibsp / SPConfig.cpp
index 3df7a26..bba30cb 100644 (file)
  */
 
 #include "internal.h"
+
+#if defined(XMLTOOLING_LOG4SHIB)
+# ifndef SHIBSP_LOG4SHIB
+#  error "Logging library mismatch (XMLTooling is using log4shib)."
+# endif
+#elif defined(XMLTOOLING_LOG4CPP)
+# ifndef SHIBSP_LOG4CPP
+#  error "Logging library mismatch (XMLTooling is using log4cpp)."
+# endif
+#else
+# error "No supported logging library."
+#endif
+
 #include "AccessControl.h"
 #include "exceptions.h"
 #include "RequestMapper.h"
 # include "metadata/MetadataExt.h"
 # include "security/PKIXTrustEngine.h"
 # include <saml/SAMLConfig.h>
+# include <xmltooling/util/CurlNetAccessor.hpp>
 #else
 # include <xmltooling/XMLToolingConfig.h>
 #endif
 
-#include <log4cpp/Category.hh>
 #include <xmltooling/util/NDC.h>
 #include <xmltooling/util/TemplateEngine.h>
 
 using namespace shibsp;
 using namespace opensaml;
 using namespace xmltooling;
-using namespace log4cpp;
 
 DECL_XMLTOOLING_EXCEPTION_FACTORY(AttributeException,shibsp);
 DECL_XMLTOOLING_EXCEPTION_FACTORY(AttributeExtractionException,shibsp);
@@ -63,11 +75,12 @@ DECL_XMLTOOLING_EXCEPTION_FACTORY(ConfigurationException,shibsp);
 DECL_XMLTOOLING_EXCEPTION_FACTORY(ListenerException,shibsp);
 
 #ifdef SHIBSP_LITE
-DECL_XMLTOOLING_EXCEPTION_FACTORY(MetadataException,opensaml::saml2md);
+DECL_XMLTOOLING_EXCEPTION_FACTORY(BindingException,opensaml);
 DECL_XMLTOOLING_EXCEPTION_FACTORY(SecurityPolicyException,opensaml);
 DECL_XMLTOOLING_EXCEPTION_FACTORY(ProfileException,opensaml);
 DECL_XMLTOOLING_EXCEPTION_FACTORY(FatalProfileException,opensaml);
 DECL_XMLTOOLING_EXCEPTION_FACTORY(RetryableProfileException,opensaml);
+DECL_XMLTOOLING_EXCEPTION_FACTORY(MetadataException,opensaml::saml2md);
 #endif
 
 namespace shibsp {
@@ -96,7 +109,7 @@ bool SPInternalConfig::init(const char* catalog_path)
     NDC ndc("init");
 #endif
     Category& log=Category::getInstance(SHIBSP_LOGCAT".Config");
-    log.debug("library initialization started");
+    log.debug("%s library initialization started", PACKAGE_STRING);
 
     const char* loglevel=getenv("SHIBSP_LOGGING");
     if (!loglevel)
@@ -114,6 +127,7 @@ bool SPInternalConfig::init(const char* catalog_path)
         log.fatal("failed to initialize OpenSAML library");
         return false;
     }
+    XMLPlatformUtils::fgNetAccessor = new CurlNetAccessor();
 #else
     if (!XMLToolingConfig::getConfig().init()) {
         log.fatal("failed to initialize XMLTooling library");
@@ -132,6 +146,7 @@ bool SPInternalConfig::init(const char* catalog_path)
     REGISTER_XMLTOOLING_EXCEPTION_FACTORY(ListenerException,shibsp);
 
 #ifdef SHIBSP_LITE
+    REGISTER_XMLTOOLING_EXCEPTION_FACTORY(BindingException,opensaml);
     REGISTER_XMLTOOLING_EXCEPTION_FACTORY(SecurityPolicyException,opensaml);
     REGISTER_XMLTOOLING_EXCEPTION_FACTORY(ProfileException,opensaml);
     REGISTER_XMLTOOLING_EXCEPTION_FACTORY(FatalProfileException,opensaml);
@@ -177,7 +192,7 @@ bool SPInternalConfig::init(const char* catalog_path)
         m_artifactResolver = new ArtifactResolver();
 #endif
 
-    log.info("library initialization complete");
+    log.info("%s library initialization complete", PACKAGE_STRING);
     return true;
 }
 
@@ -187,14 +202,16 @@ void SPInternalConfig::term()
     NDC ndc("term");
 #endif
     Category& log=Category::getInstance(SHIBSP_LOGCAT".Config");
-    log.info("shutting down the library");
+    log.info("%s library shutting down", PACKAGE_STRING);
 
     setServiceProvider(NULL);
 #ifndef SHIBSP_LITE
     setArtifactResolver(NULL);
 #endif
 
+    ArtifactResolutionServiceManager.deregisterFactories();
     AssertionConsumerServiceManager.deregisterFactories();
+    LogoutInitiatorManager.deregisterFactories();
     ManageNameIDServiceManager.deregisterFactories();
     SessionInitiatorManager.deregisterFactories();
     SingleLogoutServiceManager.deregisterFactories();
@@ -228,5 +245,5 @@ void SPInternalConfig::term()
 #else
     XMLToolingConfig::getConfig().term();
 #endif
-    log.info("library shutdown complete");
+    log.info("%s library shutdown complete", PACKAGE_STRING);
 }