xapian-core  2.0.0
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, see
19  * <https://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef XAPIAN_INCLUDED_DATABASEREPLICATOR_H
23 #define XAPIAN_INCLUDED_DATABASEREPLICATOR_H
24 
25 #include <string>
26 
27 #include "xapian/types.h"
28 
29 class RemoteConnection;
30 
31 namespace Xapian {
32 
40 
43 
44  protected:
49 
50  public:
53  virtual ~DatabaseReplicator();
54 
59  static DatabaseReplicator * open(const std::string & path);
60 
66  virtual bool check_revision_at_least(const std::string & rev,
67  const std::string & target) const = 0;
68 
79  virtual std::string apply_changeset_from_conn(RemoteConnection & conn,
80  double end_time,
81  bool db_valid) const = 0;
82 
89  virtual std::string get_uuid() const = 0;
90 };
91 
92 }
93 
94 #endif /* XAPIAN_INCLUDED_DATABASEREPLICATOR_H */
A RemoteConnection object provides a bidirectional connection to another RemoteConnection object on a...
Base class for database replicator objects.
DatabaseReplicator(const DatabaseReplicator &)
Copies are not allowed.
virtual std::string apply_changeset_from_conn(RemoteConnection &conn, double end_time, bool db_valid) const =0
Read and apply the next changeset.
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.
void operator=(const DatabaseReplicator &)
Assignment is not allowed.
virtual ~DatabaseReplicator()
Destroy the replicator.
static DatabaseReplicator * open(const std::string &path)
Open a DatabaseReplicator for the given path.
virtual std::string get_uuid() const =0
Get a UUID for the replica.
DatabaseReplicator()
Constructor to allow construction of subclasses from the open() method.
double end_time(double timeout)
Return the end time for a timeout in timeout seconds.
Definition: realtime.h:95
The Xapian namespace contains public interfaces for the Xapian library.
Definition: compactor.cc:82
XAPIAN_REVISION_TYPE rev
Revision number of a database.
Definition: types.h:108
typedefs for Xapian