-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDBMainManager.h
64 lines (44 loc) · 1.56 KB
/
DBMainManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef DBMAINMANAGER_H
#define DBMAINMANAGER_H
#include "configmgr/include/ConfigManager.h"
#include "IDbClient.h"
#include <thread>
//#include "watchdog_worker/IWatchDogClient.h"
#include "watchdog_worker/WatchDogWorker.h"
#include "watchdog_worker/systemd_client/SystemdClient.h"
#include "watchdog_worker/modmon_client/ModMonClient.h"
#include "message_transport/include/BaseTransportServer.h"
#include "RequestParser.h"
struct DBClientSettings
{
std::map<std::string, BrokerDescription_t> inChannels;
std::map<std::string, BrokerDescription_t> outChannels;
WatchDogSettings_t watchDog;
DBSettings db;
bool isUseAuthentication;
};
class DBMainManager
{
public:
DBMainManager(IDBClient* dbClient, ConfigManager* pConfManager, bool *isWorking);
~DBMainManager();
void startMonitoringConfig();
void startProcess();
private:
IDBClient *p_dbClient = nullptr;
ConfigManager *p_confManager = nullptr;
BaseTransportServer *m_pTransportServer = nullptr;
IWatchDogClient *m_pWdClient = nullptr;
WatchDogWorker *m_pWatchDogWorker = nullptr;
RequestParser *m_pReqParser = nullptr;
std::thread m_thrConfigMgr;
DBClientSettings m_newParams;
DBClientSettings m_oldParams;
bool *p_isWorking = nullptr;
private:
bool parseConfig(const ConfigManager *cfg);
void checkInput(DBClientSettings &sNew, DBClientSettings &sOld);
void slotRequestProc(JSON jsonPack, std::string urlSender);
void checkAlive();
};
#endif // MAINMANAGER_H