X-Git-Url: http://git.vrable.net/?p=cumulus.git;a=blobdiff_plain;f=remote.h;h=10a0a960bc6d1b338aa10005ee4335498e342e59;hp=85de06ce3e6a808013d720477a620d6926dc4182;hb=HEAD;hpb=09533a1615813c343e1244275531f933d9b48ddf diff --git a/remote.h b/remote.h index 85de06c..10a0a96 100644 --- a/remote.h +++ b/remote.h @@ -1,7 +1,23 @@ -/* LBS: An LFS-inspired filesystem backup system - * Copyright (C) 2006 Michael Vrable +/* Cumulus: Efficient Filesystem Backup to the Cloud + * Copyright (C) 2008 The Cumulus Developers + * See the AUTHORS file for a list of contributors. * - * Backup data (segments and backup descriptors) may be stored on a remote + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/* Backup data (segments and backup descriptors) may be stored on a remote * fileserver instead of locally. The only local storage needed is for the * local database and some temporary space for staging files before they are * transferred to the remote server. @@ -22,11 +38,9 @@ class RemoteStore { public: static const size_t MAX_QUEUE_SIZE = 4; - RemoteStore(const std::string &stagedir); + RemoteStore(const std::string &stagedir, const std::string &script = ""); ~RemoteStore(); - void set_script(const std::string &script) - { backup_script = script; } - RemoteFile *alloc_file(const std::string &name); + RemoteFile *alloc_file(const std::string &name, const std::string &type); void enqueue(RemoteFile *file); void sync(); @@ -57,6 +71,7 @@ public: int get_fd() const { return fd; } const std::string &get_local_path() const { return local_path; } + const std::string &get_remote_path() const { return remote_path; } /* Called when the file is finished--request that it be sent to the remote * server. This will delete the RemoteFile object. */ @@ -65,12 +80,13 @@ private: friend class RemoteStore; RemoteFile(RemoteStore *remote, - const std::string &name, const std::string &local_path); + const std::string &name, const std::string &type, + const std::string &local_path); RemoteStore *remote_store; int fd; - std::string local_path; + std::string type, local_path; std::string remote_path; };