Added ODBC cache elements.
authorcantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Tue, 24 Jan 2006 18:18:18 +0000 (18:18 +0000)
committercantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Tue, 24 Jan 2006 18:18:18 +0000 (18:18 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@1951 cb58f699-b61c-0410-a6fe-9272a202ed29

schemas/shibboleth-targetconfig-1.0.xsd
shib-target/XML.cpp
shib-target/shib-ini.cpp
shib-target/shib-target.h

index 201bd57..633f9f2 100644 (file)
                        <anyAttribute namespace="##other" processContents="lax"/>
                </complexType>
        </element>
+       <element name="ODBCSessionCache">
+               <complexType>
+                       <sequence>
+                               <element name="ConnectionString" type="string"/>
+                       </sequence>
+                       <attributeGroup ref="conf:SessionCacheProperties"/>
+                       <attribute name="odbcTimeout" type="unsignedInt" use="optional" default="14400"/>
+                       <attribute name="storeAttributes" type="boolean" use="optional" default="false"/>
+                       <anyAttribute namespace="##other" processContents="lax"/>
+               </complexType>
+       </element>
        <element name="MySQLSessionCache">
                <complexType>
                        <sequence>
                        </choice>
                        <choice>
                                <element ref="conf:MemorySessionCache"/>
+                               <element ref="conf:ODBCSessionCache"/>
                                <element ref="conf:MySQLSessionCache"/>
                                <element ref="conf:SessionCache"/>
                        </choice>
                        <element ref="conf:Extensions" minOccurs="0"/>
                        <choice minOccurs="0">
                                <element ref="conf:MemorySessionCache"/>
-                               <element ref="conf:MySQLSessionCache"/>
                                <element ref="conf:SessionCache"/>
                        </choice>
                        <element name="RequestMapProvider" type="conf:PluggableType" minOccurs="0"/>
index c97975a..8ed9427 100644 (file)
@@ -28,8 +28,10 @@ using namespace shibtarget;
 
 const char XML::MemorySessionCacheType[] =  "edu.internet2.middleware.shibboleth.sp.provider.MemorySessionCacheProvider";
 const char XML::MySQLSessionCacheType[] =   "edu.internet2.middleware.shibboleth.sp.provider.MySQLSessionCacheProvider";
+const char XML::ODBCSessionCacheType[] =    "edu.internet2.middleware.shibboleth.sp.provider.ODBCSessionCacheProvider";
 
 const char XML::MySQLReplayCacheType[] =    "edu.internet2.middleware.shibboleth.sp.provider.MySQLReplayCacheProvider";
+const char XML::ODBCReplayCacheType[] =     "edu.internet2.middleware.shibboleth.sp.provider.ODBCReplayCacheProvider";
 
 const char XML::XMLRequestMapType[] =       "edu.internet2.middleware.shibboleth.sp.provider.XMLRequestMapProvider";
 const char XML::NativeRequestMapType[] =    "edu.internet2.middleware.shibboleth.sp.provider.NativeRequestMapProvider";
@@ -228,6 +230,18 @@ const XMLCh XML::Literals::name[]= { chLatin_n, chLatin_a, chLatin_m, chLatin_e,
 
 const XMLCh XML::Literals::Name[]= { chLatin_N, chLatin_a, chLatin_m, chLatin_e, chNull };
 
+const XMLCh XML::Literals::ODBCReplayCache[] =
+{ chLatin_O, chLatin_D, chLatin_B, chLatin_C,
+  chLatin_R, chLatin_e, chLatin_p, chLatin_l, chLatin_a, chLatin_y,
+  chLatin_C, chLatin_a, chLatin_c, chLatin_h, chLatin_e, chNull
+};
+
+const XMLCh XML::Literals::ODBCSessionCache[] =
+{ chLatin_O, chLatin_D, chLatin_B, chLatin_C,
+  chLatin_S, chLatin_e, chLatin_s, chLatin_s, chLatin_i, chLatin_o, chLatin_n,
+  chLatin_C, chLatin_a, chLatin_c, chLatin_h, chLatin_e, chNull
+};
+
 const XMLCh XML::Literals::OutOfProcess[] =
 { chLatin_O, chLatin_u, chLatin_t, chLatin_O, chLatin_f,
   chLatin_P, chLatin_r, chLatin_o, chLatin_c, chLatin_e, chLatin_s, chLatin_s, chNull
index 5de2baf..ad18c00 100644 (file)
@@ -1158,21 +1158,28 @@ void XMLConfigImpl::init(bool first)
                     plugin=shibConf.getPlugMgr().newPlugin(shibtarget::XML::MemorySessionCacheType,exts);
                 }
                 else {
-                    exts=saml::XML::getFirstChildElement(container,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(MySQLSessionCache));
+                    exts=saml::XML::getFirstChildElement(container,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(ODBCSessionCache));
                     if (exts) {
-                        log.info("building Session Cache of type %s...",shibtarget::XML::MySQLSessionCacheType);
-                        plugin=shibConf.getPlugMgr().newPlugin(shibtarget::XML::MySQLSessionCacheType,exts);
+                        log.info("building Session Cache of type %s...",shibtarget::XML::ODBCSessionCacheType);
+                        plugin=shibConf.getPlugMgr().newPlugin(shibtarget::XML::ODBCSessionCacheType,exts);
                     }
                     else {
-                        exts=saml::XML::getFirstChildElement(container,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(SessionCache));
+                        exts=saml::XML::getFirstChildElement(container,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(MySQLSessionCache));
                         if (exts) {
-                            auto_ptr_char type(exts->getAttributeNS(NULL,SHIBT_L(type)));
-                            log.info("building Session Cache of type %s...",type.get());
-                            plugin=shibConf.getPlugMgr().newPlugin(type.get(),exts);
+                            log.info("building Session Cache of type %s...",shibtarget::XML::MySQLSessionCacheType);
+                            plugin=shibConf.getPlugMgr().newPlugin(shibtarget::XML::MySQLSessionCacheType,exts);
                         }
                         else {
-                            log.info("session cache not specified, building Session Cache of type %s...",shibtarget::XML::MemorySessionCacheType);
-                            plugin=shibConf.getPlugMgr().newPlugin(shibtarget::XML::MemorySessionCacheType,exts);
+                            exts=saml::XML::getFirstChildElement(container,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(SessionCache));
+                            if (exts) {
+                                auto_ptr_char type(exts->getAttributeNS(NULL,SHIBT_L(type)));
+                                log.info("building Session Cache of type %s...",type.get());
+                                plugin=shibConf.getPlugMgr().newPlugin(type.get(),exts);
+                            }
+                            else {
+                                log.info("session cache not specified, building Session Cache of type %s...",shibtarget::XML::MemorySessionCacheType);
+                                plugin=shibConf.getPlugMgr().newPlugin(shibtarget::XML::MemorySessionCacheType,exts);
+                            }
                         }
                     }
                 }
@@ -1188,22 +1195,29 @@ void XMLConfigImpl::init(bool first)
                 }
                 
                 // Replay cache.
-                exts=saml::XML::getFirstChildElement(SHAR,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(MySQLReplayCache));
+                exts=saml::XML::getFirstChildElement(SHAR,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(ODBCReplayCache));
                 if (exts) {
-                    log.info("building Replay Cache of type %s...",shibtarget::XML::MySQLReplayCacheType);
-                    m_outer->m_replayCache=IReplayCache::getInstance(shibtarget::XML::MySQLReplayCacheType,exts);
+                    log.info("building Replay Cache of type %s...",shibtarget::XML::ODBCReplayCacheType);
+                    m_outer->m_replayCache=IReplayCache::getInstance(shibtarget::XML::ODBCReplayCacheType,exts);
                 }
                 else {
-                    exts=saml::XML::getFirstChildElement(SHAR,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(ReplayCache));
+                    exts=saml::XML::getFirstChildElement(SHAR,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(MySQLReplayCache));
                     if (exts) {
-                        auto_ptr_char type(exts->getAttributeNS(NULL,SHIBT_L(type)));
-                        log.info("building Replay Cache of type %s...",type.get());
-                        m_outer->m_replayCache=IReplayCache::getInstance(type.get(),exts);
+                        log.info("building Replay Cache of type %s...",shibtarget::XML::MySQLReplayCacheType);
+                        m_outer->m_replayCache=IReplayCache::getInstance(shibtarget::XML::MySQLReplayCacheType,exts);
                     }
                     else {
-                        // OpenSAML default provider.
-                        log.info("building default Replay Cache...");
-                        m_outer->m_replayCache=IReplayCache::getInstance();
+                        exts=saml::XML::getFirstChildElement(SHAR,shibtarget::XML::SHIBTARGET_NS,SHIBT_L(ReplayCache));
+                        if (exts) {
+                            auto_ptr_char type(exts->getAttributeNS(NULL,SHIBT_L(type)));
+                            log.info("building Replay Cache of type %s...",type.get());
+                            m_outer->m_replayCache=IReplayCache::getInstance(type.get(),exts);
+                        }
+                        else {
+                            // OpenSAML default provider.
+                            log.info("building default Replay Cache...");
+                            m_outer->m_replayCache=IReplayCache::getInstance();
+                        }
                     }
                 }
             }
index ac531a3..6e1cac0 100644 (file)
@@ -606,9 +606,11 @@ namespace shibtarget {
         // Session cache implementations
         static const char MemorySessionCacheType[];
         static const char MySQLSessionCacheType[];
+        static const char ODBCSessionCacheType[];
         
         // Replay cache implementations
         static const char MySQLReplayCacheType[];
+        static const char ODBCReplayCacheType[];
         
         // Request mapping/settings implementations
         static const char XMLRequestMapType[];      // portable XML-based map
@@ -663,6 +665,8 @@ namespace shibtarget {
             static const XMLCh name[];
             static const XMLCh Name[];
             static const XMLCh NOT[];
+            static const XMLCh ODBCReplayCache[];
+            static const XMLCh ODBCSessionCache[];
             static const XMLCh OR[];
             static const XMLCh OutOfProcess[];
             static const XMLCh Path[];