00001 00004 /* Copyright 2008 Lemur Consulting Ltd 00005 * Copyright 2009,2010 Olly Betts 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License as 00009 * published by the Free Software Foundation; either version 2 of the 00010 * License, or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 00020 * USA 00021 */ 00022 00023 #ifndef XAPIAN_INCLUDED_BRASS_DATABASEREPLICATOR_H 00024 #define XAPIAN_INCLUDED_BRASS_DATABASEREPLICATOR_H 00025 00026 #include "databasereplicator.h" 00027 00028 class BrassDatabaseReplicator : public Xapian::DatabaseReplicator { 00029 private: 00032 std::string db_dir; 00033 00036 void process_changeset_chunk_base(const std::string & tablename, 00037 std::string & buf, 00038 RemoteConnection & conn, 00039 double end_time) const; 00040 00044 void process_changeset_chunk_blocks(const std::string & tablename, 00045 std::string & buf, 00046 RemoteConnection & conn, 00047 double end_time) const; 00048 00049 public: 00050 BrassDatabaseReplicator(const std::string & db_dir_); 00051 00054 bool check_revision_at_least(const std::string & rev, 00055 const std::string & target) const; 00056 std::string apply_changeset_from_conn(RemoteConnection & conn, 00057 double end_time, 00058 bool valid) const; 00059 std::string get_uuid() const; 00061 }; 00062 00063 #endif /* XAPIAN_INCLUDED_BRASS_DATABASEREPLICATOR_H */