2005-11-26 22:16:03 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2005 Patrick Ohly
|
|
|
|
*
|
|
|
|
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef INCL_EVOLUTIONSYNCCLIENT
|
|
|
|
#define INCL_EVOLUTIONSYNCCLIENT
|
|
|
|
|
2006-04-06 19:02:43 +02:00
|
|
|
#include <config.h>
|
2005-11-26 22:16:03 +01:00
|
|
|
#include <common/client/Sync4jClient.h>
|
|
|
|
|
|
|
|
#include <string>
|
2006-04-09 13:48:11 +02:00
|
|
|
#include <set>
|
2005-11-26 22:16:03 +01:00
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This is the main class inside sync4jevolution which
|
|
|
|
* looks at the configuration, activates all enabled
|
|
|
|
* sources and executes the synchronization.
|
|
|
|
*
|
|
|
|
* Despite the name it is not a Sync4jClient, but rather
|
|
|
|
* uses one.
|
|
|
|
*/
|
|
|
|
class EvolutionSyncClient {
|
|
|
|
Sync4jClient& m_client;
|
|
|
|
const string m_server;
|
|
|
|
const string m_configPath;
|
2006-04-09 13:48:11 +02:00
|
|
|
const set<string> m_sources;
|
2005-11-26 22:16:03 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* @param server identifies the server config to be used
|
|
|
|
*/
|
2006-04-09 13:48:11 +02:00
|
|
|
EvolutionSyncClient(const string &server, const set<string> &sources = set<string>());
|
2005-11-26 22:16:03 +01:00
|
|
|
~EvolutionSyncClient();
|
|
|
|
|
|
|
|
/**
|
2006-03-19 22:37:30 +01:00
|
|
|
* Executes the sync, throws an exception in case of failure.
|
|
|
|
* Handles automatic backups and report generation.
|
|
|
|
*
|
2005-12-11 18:13:36 +01:00
|
|
|
* @param syncMode setting this overrides the sync mode from the config
|
2006-03-19 22:37:30 +01:00
|
|
|
* @param doLogging write additional log and datatbase files about the sync
|
2005-11-26 22:16:03 +01:00
|
|
|
*/
|
2006-03-19 22:37:30 +01:00
|
|
|
void sync(SyncMode syncMode = SYNC_NONE, bool doLogging = false);
|
2005-11-26 22:16:03 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // INCL_EVOLUTIONSYNCCLIENT
|