Debugging ActionLog. Corrections in dispatcher (filename in DB should be in a "generic" format)
diff --git a/src/action-log.h b/src/action-log.h
index ff3b4aa..27d0869 100644
--- a/src/action-log.h
+++ b/src/action-log.h
@@ -24,37 +24,56 @@
#include "db-helper.h"
#include "sync-log.h"
+#include "action-item.pb.h"
+#include "ccnx-wrapper.h"
+#include "ccnx-pco.h"
#include <boost/tuple/tuple.hpp>
-#include <action-item.pb.h>
-#include <ccnx-wrapper.h>
class ActionLog;
typedef boost::shared_ptr<ActionLog> ActionLogPtr;
+typedef boost::shared_ptr<ActionItem> ActionItemPtr;
class ActionLog : public DbHelper
{
public:
ActionLog (Ccnx::CcnxWrapperPtr ccnx, const boost::filesystem::path &path,
SyncLogPtr syncLog,
- const std::string &localName, const std::string &sharedFolder);
+ const std::string &sharedFolder);
void
- AddActionUpdate (const std::string &filename,
- const Hash &hash,
- time_t wtime,
- int mode,
- int seg_num);
+ AddLocalActionUpdate (const std::string &filename,
+ const Hash &hash,
+ time_t wtime,
+ int mode,
+ int seg_num);
+
+ // void
+ // AddActionMove (const std::string &oldFile, const std::string &newFile);
void
- AddActionMove (const std::string &oldFile, const std::string &newFile);
-
- void
- AddActionDelete (const std::string &filename);
+ AddLocalActionDelete (const std::string &filename);
bool
KnownFileState(const std::string &filename, const Hash &hash);
+ Ccnx::PcoPtr
+ LookupActionPco (const Ccnx::Name &deviceName, sqlite3_int64 seqno);
+
+ Ccnx::PcoPtr
+ LookupActionPco (const Ccnx::Name &actionName);
+
+ ActionItemPtr
+ LookupAction (const Ccnx::Name &deviceName, sqlite3_int64 seqno);
+
+ ActionItemPtr
+ LookupAction (const Ccnx::Name &actionName);
+
+public:
+ // for test purposes
+ sqlite3_int64
+ LogSize ();
+
private:
boost::tuple<sqlite3_int64 /*version*/, Ccnx::CcnxCharbufPtr /*device name*/, sqlite3_int64 /*seq_no*/>
GetLatestActionForFile (const std::string &filename);
@@ -66,7 +85,7 @@
SyncLogPtr m_syncLog;
Ccnx::CcnxWrapperPtr m_ccnx;
- Ccnx::Name m_sharedFolderName;
+ std::string m_sharedFolderName;
};
#endif // ACTION_LOG_H