Tweak some logging.
authorScott Cantor <cantor.2@osu.edu>
Mon, 11 Jun 2007 15:22:08 +0000 (15:22 +0000)
committerScott Cantor <cantor.2@osu.edu>
Mon, 11 Jun 2007 15:22:08 +0000 (15:22 +0000)
Remove unused remoted insert operation from cache.

shibsp/attribute/resolver/impl/QueryAttributeResolver.cpp
shibsp/impl/StorageServiceSessionCache.cpp

index a6d348a..2aa73f1 100644 (file)
@@ -255,7 +255,7 @@ bool QueryResolver::SAML1Query(QueryContext& ctx) const
         version = 0;
     }
     if (!AA) {
-        m_log.info("no SAML 1.x AttributeAuthority role found in metadata");
+        m_log.debug("no SAML 1.x AttributeAuthority role found in metadata");
         return false;
     }
 
@@ -365,7 +365,7 @@ bool QueryResolver::SAML2Query(QueryContext& ctx) const
 
     const AttributeAuthorityDescriptor* AA = ctx.getEntityDescriptor()->getAttributeAuthorityDescriptor(samlconstants::SAML20P_NS);
     if (!AA) {
-        m_log.info("no SAML 2 AttributeAuthority role found in metadata");
+        m_log.debug("no SAML 2 AttributeAuthority role found in metadata");
         return false;
     }
 
index bebd896..49574c6 100644 (file)
@@ -425,7 +425,6 @@ SSCache::SSCache(const DOMElement* e)
 \r
     ListenerService* listener=conf.getServiceProvider()->getListenerService(false);\r
     if (listener && conf.isEnabled(SPConfig::OutOfProcess)) {\r
-        listener->regListener("insert::"REMOTED_SESSION_CACHE"::SessionCache",this);\r
         listener->regListener("find::"REMOTED_SESSION_CACHE"::SessionCache",this);\r
         listener->regListener("remove::"REMOTED_SESSION_CACHE"::SessionCache",this);\r
         listener->regListener("touch::"REMOTED_SESSION_CACHE"::SessionCache",this);\r
@@ -441,7 +440,6 @@ SSCache::~SSCache()
     SPConfig& conf = SPConfig::getConfig();\r
     ListenerService* listener=conf.getServiceProvider()->getListenerService(false);\r
     if (listener && conf.isEnabled(SPConfig::OutOfProcess)) {\r
-        listener->unregListener("insert::"REMOTED_SESSION_CACHE"::SessionCache",this);\r
         listener->unregListener("find::"REMOTED_SESSION_CACHE"::SessionCache",this);\r
         listener->unregListener("remove::"REMOTED_SESSION_CACHE"::SessionCache",this);\r
         listener->unregListener("touch::"REMOTED_SESSION_CACHE"::SessionCache",this);\r
@@ -547,7 +545,7 @@ string SSCache::insert(
     }\r
 \r
     const char* pid = obj["entity_id"].string();\r
-    m_log.debug("new session created: SessionID (%s) IdP (%s) Address (%s)", key.get(), pid ? pid : "none", client_addr);\r
+    m_log.info("new session created: SessionID (%s) IdP (%s) Address (%s)", key.get(), pid ? pid : "none", client_addr);\r
 \r
     // Transaction Logging\r
     auto_ptr_char name(nameid ? nameid->getName() : NULL);\r
@@ -688,9 +686,8 @@ void SSCache::remove(const char* key, const Application& application, const char
     xmltooling::NDC ndc("remove");\r
 #endif\r
 \r
-    m_log.debug("removing session (%s)", key);\r
-\r
     m_storage->deleteContext(key);\r
+    m_log.info("removed session (%s)", key);\r
 \r
     TransactionLog* xlog = application.getServiceProvider().getTransactionLog();\r
     Locker locker(xlog);\r
@@ -703,39 +700,7 @@ void SSCache::receive(DDF& in, ostream& out)
     xmltooling::NDC ndc("receive");\r
 #endif\r
 \r
-    if (!strcmp(in.name(),"insert::"REMOTED_SESSION_CACHE"::SessionCache")) {\r
-        auto_ptr_char key(SAMLConfig::getConfig().generateIdentifier());\r
-        in.name(key.get());\r
-\r
-        DDF tokens = in["tokens"].remove();\r
-        DDFJanitor tjan(tokens);\r
-        \r
-        m_log.debug("storing new session...");\r
-        ostringstream record;\r
-        record << in;\r
-        time_t now = time(NULL);\r
-        m_storage->createText(key.get(), "session", record.str().c_str(), now + m_cacheTimeout);\r
-        if (tokens.islist()) {\r
-            try {\r
-                DDF token = tokens.first();\r
-                while (token.isstring()) {\r
-                    m_storage->createText(key.get(), token.name(), token.string(), now + m_cacheTimeout);\r
-                    token = tokens.next();\r
-                }\r
-            }\r
-            catch (IOException& ex) {\r
-                m_log.error("error storing assertion along with session: %s", ex.what());\r
-            }\r
-        }\r
-        const char* pid = in["entity_id"].string();\r
-        m_log.debug("new session created: SessionID (%s) IdP (%s) Address (%s)", key.get(), pid ? pid : "none", in["client_addr"].string());\r
-    \r
-        DDF ret = DDF(NULL).structure();\r
-        DDFJanitor jan(ret);\r
-        ret.addmember("key").string(key.get());\r
-        out << ret;\r
-    }\r
-    else if (!strcmp(in.name(),"find::"REMOTED_SESSION_CACHE"::SessionCache")) {\r
+    if (!strcmp(in.name(),"find::"REMOTED_SESSION_CACHE"::SessionCache")) {\r
         const char* key=in["key"].string();\r
         if (!key)\r
             throw ListenerException("Required parameters missing for session removal.");\r