Add init/term methods.
authorcantor <cantor@3ebe4818-3638-0410-822d-ece5924dabe2>
Mon, 20 Sep 2010 14:19:18 +0000 (14:19 +0000)
committercantor <cantor@3ebe4818-3638-0410-822d-ece5924dabe2>
Mon, 20 Sep 2010 14:19:18 +0000 (14:19 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/shib-extension/cpp-sp-resolver/trunk@271 3ebe4818-3638-0410-822d-ece5924dabe2

shibresolver/resolver.cpp

index dfea7c3..f8acdc7 100644 (file)
@@ -121,6 +121,27 @@ void RemotedResolver::receive(DDF& in, ostream& out)
 {
 }
 
 {
 }
 
+bool ShibbolethResolver::init(unsigned long features, const char* config, bool rethrow)
+{
+    SPConfig::getConfig().setFeatures(features | SPConfig::AttributeResolution | SPConfig::Metadata | SPConfig::Trust);
+    if (!SPConfig::getConfig().init())
+        return false;
+    if (!SPConfig::getConfig().instantiate(config, rethrow))
+        return false;
+    return true;
+}
+
+/**
+    * Shuts down runtime.
+    *
+    * Each process using the library SHOULD call this function exactly once before terminating itself.
+    */
+void ShibbolethResolver::term()
+{
+    SPConfig::getConfig().term();
+}
+
+
 extern "C" int SHIBRESOLVER_EXPORTS xmltooling_extension_init(void*)
 {
 #ifdef SHIBRESOLVER_SHIBSP_HAS_REMOTING
 extern "C" int SHIBRESOLVER_EXPORTS xmltooling_extension_init(void*)
 {
 #ifdef SHIBRESOLVER_SHIBSP_HAS_REMOTING