Adjust caching support so Last-Modified-Date and ETag can both be used.
[shibboleth/cpp-xmltooling.git] / xmltooling / util / ReloadableXMLFile.h
index 70aca5a..a990f5e 100644 (file)
@@ -100,7 +100,22 @@ namespace xmltooling {
          *      the document, and the root element of the tree to load
          */
         virtual std::pair<bool,xercesc::DOMElement*> load();
-        
+
+        /**
+         * Accesses a lock interface protecting use of backup file associated with the
+         * object.
+         *
+         * <p>The lock is <strong>NOT</strong> acquired automatically.
+         *
+         * @return  pointer to a lock interface, or NULL if unnecessary
+         */
+        virtual Lockable* getBackupLock();
+
+        /**
+         * Shuts down reload thread, should be called from subclass destructor.
+         */
+        void shutdown();
+
         /** Root of the original DOM element passed into constructor. */
         const xercesc::DOMElement* m_root;
         
@@ -115,7 +130,13 @@ namespace xmltooling {
 
         /** Path to backup copy for remote resource. */
         std::string m_backing;
-        
+
+        /**
+         * Before load, indicates whether the backup is handled by the base class,
+         * after load, will be true iff it started false and a backup needs to be done.
+         */
+        bool m_backupIndicator;
+
         /** Last modification of local resource. */
         time_t m_filestamp;