Merge session cache implementations.
[shibboleth/cpp-sp.git] / shibsp / SessionCache.h
index 91de942..bb32ae7 100644 (file)
@@ -51,6 +51,27 @@ namespace shibsp {
         virtual const char* getID() const=0;
 
         /**
+         * Returns the session's application ID.
+         *
+         * @return unique ID of application bound to session
+         */
+        virtual const char* getApplicationID() const=0;
+
+        /**
+         * Returns the session expiration.
+         *
+         * @return  the session's expiration time or 0 for none
+         */
+        virtual time_t getExpiration() const=0;
+
+        /**
+         * Returns the last access time of the session.
+         *
+         * @return  the session's last access time
+         */
+        virtual time_t getLastAccess() const=0;
+
+        /**
          * Returns the address of the client associated with the session.
          * 
          * @return  the client's network address
@@ -173,23 +194,7 @@ namespace shibsp {
     {
         MAKE_NONCOPYABLE(SessionCache);
     protected:
-    
-        /**
-         * Constructor
-         * 
-         * <p>The following XML content is supported to configure the cache:
-         * <dl>
-         *  <dt>cacheTimeout</dt>
-         *  <dd>attribute containing maximum lifetime in seconds for unused sessions to remain in cache</dd>
-         * </dl>
-         * 
-         * @param e root of DOM tree to configure the cache
-         */
-        SessionCache(const xercesc::DOMElement* e);
-        
-        /** maximum lifetime in seconds for unused sessions to be cached */
-        unsigned long m_cacheTimeout;
-        
+        SessionCache() {}
     public:
         virtual ~SessionCache() {}
         
@@ -272,6 +277,11 @@ namespace shibsp {
             const std::set<std::string>* indexes,
             const Application& application
             )=0;
+
+        /**
+         * Executes a test of the cache's general health.
+         */
+        virtual void test()=0;
 #endif
 
         /**
@@ -299,13 +309,8 @@ namespace shibsp {
         virtual void remove(const char* key, const Application& application)=0;
     };
 
-#ifndef SHIBSP_LITE
     /** SessionCache implementation backed by a StorageService. */
     #define STORAGESERVICE_SESSION_CACHE    "StorageService"
-#endif
-
-    /** SessionCache implementation for lite builds that delegates to a remoted version. */
-    #define REMOTED_SESSION_CACHE    "Remoted"
 
     /**
      * Registers SessionCache classes into the runtime.