Alexander Afanasyev | 5e9e46e | 2013-01-02 14:12:50 -0800 | [diff] [blame] | 1 | /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2013 University of California, Los Angeles |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License version 2 as |
| 7 | * published by the Free Software Foundation; |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | * |
| 18 | * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu> |
| 19 | * Zhenkai Zhu <zhenkai@cs.ucla.edu> |
| 20 | */ |
| 21 | |
| 22 | #include "notify-i.h" |
Alexander Afanasyev | a199f97 | 2013-01-02 19:37:26 -0800 | [diff] [blame] | 23 | #include <hash-helper.h> |
Alexander Afanasyev | 5e9e46e | 2013-01-02 14:12:50 -0800 | [diff] [blame] | 24 | |
| 25 | using namespace std; |
| 26 | |
Alexander Afanasyev | a199f97 | 2013-01-02 19:37:26 -0800 | [diff] [blame] | 27 | // NotifyI::NotifyI (DbHelperPtr &db) |
| 28 | // : m_db (db) |
| 29 | // { |
| 30 | // } |
| 31 | |
Alexander Afanasyev | 5e9e46e | 2013-01-02 14:12:50 -0800 | [diff] [blame] | 32 | void |
| 33 | NotifyI::updateFile (const ::std::string &filename, |
Alexander Afanasyev | a199f97 | 2013-01-02 19:37:26 -0800 | [diff] [blame] | 34 | const ::std::pair<const Ice::Byte*, const Ice::Byte*> &hashRaw, |
Alexander Afanasyev | 433ecda | 2013-01-02 22:13:45 -0800 | [diff] [blame^] | 35 | ::Ice::Long atime, |
| 36 | ::Ice::Long mtime, |
| 37 | ::Ice::Long ctime, |
Alexander Afanasyev | 5e9e46e | 2013-01-02 14:12:50 -0800 | [diff] [blame] | 38 | ::Ice::Int mode, |
| 39 | const ::Ice::Current&) |
| 40 | { |
Alexander Afanasyev | a199f97 | 2013-01-02 19:37:26 -0800 | [diff] [blame] | 41 | Hash hash (hashRaw.first, hashRaw.second-hashRaw.first); |
| 42 | |
| 43 | // m_db->AddActionUpdate (filename, hash, atime, mtime, ctime, mode); |
| 44 | |
| 45 | // cout << "updateFile " << filename << " with hash " << hash << endl; |
Alexander Afanasyev | 5e9e46e | 2013-01-02 14:12:50 -0800 | [diff] [blame] | 46 | } |
| 47 | |
Alexander Afanasyev | a199f97 | 2013-01-02 19:37:26 -0800 | [diff] [blame] | 48 | void |
| 49 | NotifyI::moveFile (const ::std::string &oldFilename, |
| 50 | const ::std::string &newFilename, |
| 51 | const ::Ice::Current&) |
| 52 | { |
| 53 | // cout << "moveFile from " << oldFilename << " to " << newFilename << endl; |
| 54 | // m_db->AddActionMove (filename, oldFilename); |
| 55 | } |
Alexander Afanasyev | 5e9e46e | 2013-01-02 14:12:50 -0800 | [diff] [blame] | 56 | |
| 57 | void |
| 58 | NotifyI::deleteFile (const ::std::string &filename, |
| 59 | const ::Ice::Current&) |
| 60 | { |
Alexander Afanasyev | a199f97 | 2013-01-02 19:37:26 -0800 | [diff] [blame] | 61 | // m_db->AddActionDelete (filename, oldFilename); |
| 62 | |
| 63 | // cout << "deleteFile " << filename << endl; |
Alexander Afanasyev | 5e9e46e | 2013-01-02 14:12:50 -0800 | [diff] [blame] | 64 | } |
| 65 | |