xapian-core  1.4.27
databasereplicator.h
Go to the documentation of this file.
1 
4 /* Copyright (C) 2008 Lemur Consulting Ltd
5  * Copyright (C) 2009,2010 Olly Betts
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
20  * USA
21  */
22 
23 #ifndef XAPIAN_INCLUDED_DATABASEREPLICATOR_H
24 #define XAPIAN_INCLUDED_DATABASEREPLICATOR_H
25 
26 #include <string>
27 
28 #include "xapian/types.h"
29 
30 class RemoteConnection;
31 
32 namespace Xapian {
33 
41 
43  void operator=(const DatabaseReplicator &);
44 
45  protected:
50 
51  public:
54  virtual ~DatabaseReplicator();
55 
60  static DatabaseReplicator * open(const std::string & path);
61 
67  virtual bool check_revision_at_least(const std::string & rev,
68  const std::string & target) const = 0;
69 
80  virtual std::string apply_changeset_from_conn(RemoteConnection & conn,
81  double end_time,
82  bool db_valid) const = 0;
83 
90  virtual std::string get_uuid() const = 0;
91 };
92 
93 }
94 
95 #endif /* XAPIAN_INCLUDED_DATABASEREPLICATOR_H */
The Xapian namespace contains public interfaces for the Xapian library.
Definition: compactor.cc:80
A RemoteConnection object provides a bidirectional connection to another RemoteConnection object on a...
typedefs for Xapian
XAPIAN_REVISION_TYPE rev
Revision number of a database.
Definition: types.h:133
virtual std::string get_uuid() const =0
Get a UUID for the replica.
double end_time(double timeout)
Return the end time for a timeout in timeout seconds.
Definition: realtime.h:95
virtual bool check_revision_at_least(const std::string &rev, const std::string &target) const =0
Check if the revision of the database is at least that of a target.
Base class for database replicator objects.
virtual ~DatabaseReplicator()
Destroy the replicator.
virtual std::string apply_changeset_from_conn(RemoteConnection &conn, double end_time, bool db_valid) const =0
Read and apply the next changeset.
static DatabaseReplicator * open(const std::string &path)
Open a DatabaseReplicator for the given path.
DatabaseReplicator()
Constructor to allow construction of subclasses from the open() method.
void operator=(const DatabaseReplicator &)
Assignment is not allowed.