Another reorganization
diff --git a/daemon/daemon.cc b/daemon/daemon.cc
index fad4017..97fee4f 100644
--- a/daemon/daemon.cc
+++ b/daemon/daemon.cc
@@ -19,7 +19,7 @@
* Zhenkai Zhu <zhenkai@cs.ucla.edu>
*/
-#include "db-helper.h"
+#include "action-log.h"
#include <iostream>
#include <Ice/Service.h>
#include <Ice/Identity.h>
@@ -61,7 +61,8 @@
try
{
- DbHelper db ("./");
+ // DbHelper db ("./", "/ndn/ucla.edu/alex");
+ ActionLog bla ("./", "/ndn/ucla.edu/alex");
MyService svc;
status = svc.main (argc, argv);
diff --git a/daemon/notify-i.cc b/daemon/notify-i.cc
index 48ac56c..0f8b004 100644
--- a/daemon/notify-i.cc
+++ b/daemon/notify-i.cc
@@ -20,26 +20,46 @@
*/
#include "notify-i.h"
+#include <hash-helper.h>
using namespace std;
+// NotifyI::NotifyI (DbHelperPtr &db)
+// : m_db (db)
+// {
+// }
+
void
NotifyI::updateFile (const ::std::string &filename,
- const ::ChronoshareClient::HashBytes &hash,
+ const ::std::pair<const Ice::Byte*, const Ice::Byte*> &hashRaw,
const ::std::string &atime,
const ::std::string &mtime,
const ::std::string &ctime,
::Ice::Int mode,
const ::Ice::Current&)
{
- cout << "updateFile " << filename << endl;
+ Hash hash (hashRaw.first, hashRaw.second-hashRaw.first);
+
+ // m_db->AddActionUpdate (filename, hash, atime, mtime, ctime, mode);
+
+ // cout << "updateFile " << filename << " with hash " << hash << endl;
}
+void
+NotifyI::moveFile (const ::std::string &oldFilename,
+ const ::std::string &newFilename,
+ const ::Ice::Current&)
+{
+ // cout << "moveFile from " << oldFilename << " to " << newFilename << endl;
+ // m_db->AddActionMove (filename, oldFilename);
+}
void
NotifyI::deleteFile (const ::std::string &filename,
const ::Ice::Current&)
{
- cout << "deleteFile " << filename << endl;
+ // m_db->AddActionDelete (filename, oldFilename);
+
+ // cout << "deleteFile " << filename << endl;
}
diff --git a/daemon/notify-i.h b/daemon/notify-i.h
index 7afb0dd..a2cea97 100644
--- a/daemon/notify-i.h
+++ b/daemon/notify-i.h
@@ -27,9 +27,11 @@
class NotifyI : public ChronoshareClient::Notify
{
public:
+ // NotifyI (DbHelperPtr &db);
+
virtual void
updateFile (const ::std::string &filename,
- const ::ChronoshareClient::HashBytes &hash,
+ const ::std::pair<const Ice::Byte*, const Ice::Byte*> &hash,
const ::std::string &atime,
const ::std::string &mtime,
const ::std::string &ctime,
@@ -37,9 +39,16 @@
const ::Ice::Current& = ::Ice::Current());
virtual void
+ moveFile (const ::std::string &oldFilename,
+ const ::std::string &newFilename,
+ const ::Ice::Current& = ::Ice::Current());
+
+ virtual void
deleteFile (const ::std::string &filename,
const ::Ice::Current& = ::Ice::Current());
+private:
+ // DbHelperPtr m_db;
};
#endif // NOTIFY_I_H