Simplify access to records and prevent reads of expired data.
[shibboleth/cpp-xmltooling.git] / xmltooling / util / StorageService.h
index fe6318f..571b86d 100644 (file)
@@ -62,14 +62,13 @@ namespace xmltooling {
          * \r
          * @param context       a storage context label\r
          * @param key           null-terminated unique key of up to 255 bytes\r
-         * @param value         location in which to return the record value\r
-         * @param modifiedSince the record should not be returned if unmodified since this time,\r
-         *  or 0 to always return\r
-         * @return  true iff the record exists and was returned (based on the modifiedSince value)   \r
+         * @param pvalue        location in which to return the record value\r
+         * @param pexpiration   location in which to return the expiration timestamp\r
+         * @return  true iff a valid record exists and was returned   \r
          * \r
          * @throws IOException  raised if errors occur in the read process \r
          */\r
-        virtual bool readString(const char* context, const char* key, std::string& value, time_t modifiedSince=0)=0;\r
+        virtual bool readString(const char* context, const char* key, std::string* pvalue=NULL, time_t* pexpiration=NULL)=0;\r
 \r
         /**\r
          * Updates an existing "short" record in the storage service.\r
@@ -112,14 +111,13 @@ namespace xmltooling {
          * \r
          * @param context       a storage context label\r
          * @param key           null-terminated unique key of up to 255 bytes\r
-         * @param value         location in which to return the record value\r
-         * @param modifiedSince the record should not be returned if unmodified since this time,\r
-         *  or 0 to always return\r
-         * @return  true iff the record exists and was returned (based on the modifiedSince value)\r
-         *    \r
+         * @param pvalue        location in which to return the record value\r
+         * @param pexpiration   location in which to return the expiration timestamp\r
+         * @return  true iff a valid record exists and was returned   \r
+         * \r
          * @throws IOException  raised if errors occur in the read process \r
          */\r
-        virtual bool readText(const char* context, const char* key, std::string& value, time_t modifiedSince=0)=0;\r
+        virtual bool readText(const char* context, const char* key, std::string* pvalue=NULL, time_t* pexpiration=NULL)=0;\r
 \r
         /**\r
          * Updates an existing "long" record in the storage service.\r