source: src-qt4/life-preserver/LPBackend.h @ 284b216

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2
Last change on this file since 284b216 was 284b216, checked in by Ken Moore <ken@…>, 11 months ago

Add a new class to life-preserver that handles all the log/error/process tracking from lpreserver. Not implemented in the tray yet, still needs a bit more work before it is ready to replace a lot of the code in LPTray.
Also add the beginnings of a couple new device management functions to the LPBackend.

  • Property mode set to 100644
File size: 2.3 KB
Line 
1#ifndef _LP_BACKEND_H
2#define _LP_BACKEND_H
3
4#include <QProcess>
5#include <QString>
6#include <QStringList>
7#include <QDebug>
8#include <QDir>
9#include <QCoreApplication>
10
11//Class of static functions for using the "lpreserver" backend
12class LPBackend{
13
14public: 
15        //Informational
16        static QStringList listPossibleDatasets(); //list all possible datasets on the system
17        static QStringList listDatasets(); //list all current lifepreserver datasets
18        static QStringList listDatasetSubsets(QString dataset); //list all subsets of the main dataset
19        static QStringList listSnapshots(QString dsmountpoint); //list all snapshots for a particular dataset mountpoint
20        static QStringList listLPSnapshots(QString dataset); //list all snapshots created by life preserver
21        static QStringList listReplicationTargets(); //list all datasets with replication enabled
22        static QStringList listCurrentStatus(); //list the current snapshot/replication status
23        //Dataset Management
24        static bool setupDataset(QString dataset, int time, int numToKeep); //add or configure dataset
25        static bool removeDataset(QString dataset);
26        static bool datasetInfo(QString dataset, int& time, int& numToKeep); //get current settings for a dataset
27        //Snapshop Management
28        static void newSnapshot(QString dataset, QString snapshotname);
29        static bool removeSnapshot(QString dataset, QString snapshot);
30        static bool revertSnapshot(QString dataset, QString snapshot); //revert to given snapshot
31        static QString revertSnapshotFile(QString dataset, QString snapshot, QString filepath);
32        //Replication Management
33        static bool setupReplication(QString dataset, QString remotehost, QString user, int port, QString remotedataset, int time);
34        static bool removeReplication(QString dataset);
35        static bool replicationInfo(QString dataset, QString& remotehost, QString& user, int& port, QString& remotedataset, int& time);
36        //SSH Key Management
37        static bool setupSSHKey(QString remoteHost, QString remoteUser, int remotePort);
38        static QStringList findValidUSBDevices();
39        static bool copySSHKey(QString mountPath, QString localHost);
40        //Device Management
41        static QStringList listDevices();
42        static bool isMounted(QString device);
43        static bool unmountDevice(QString device);
44        //Mirroring Management
45
46       
47private:
48        static QStringList getCmdOutput(QString);
49        static int runCmd(QString);
50};
51#endif
Note: See TracBrowser for help on using the repository browser.