-
Notifications
You must be signed in to change notification settings - Fork 0
/
Configure.h
199 lines (155 loc) · 5.07 KB
/
Configure.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
#ifndef LIVESERVER_CONFIGURE_H
#define LIVESERVER_CONFIGURE_H
#include <Core/Utils/Singleton.h>
#include <Core/Common/ConfigureBase.h>
#include <Core/Storage/Sql.h>
class SslConfigureItem : public Common::ModuleConfigure
{
public:
int m_nSslType;
bool m_bVerifyPeer;
std::string m_strRootCACertFile;
std::string m_strUserCertFile;
std::string m_strUserPriKeyFile;
std::string m_strUserPriKeyPassword;
std::string m_strDomain;
std::string m_strSslControlType;
std::string m_strConfigureName;
SslConfigureItem();
~SslConfigureItem();
virtual bool Load( const Utils::XmlNodePtr pXmlNode, Common::ConfigureBase &nConfig );
};
typedef std::map<std::string , SslConfigureItem> SslConfigureItemMap;
class SslConfigure : public Common::ModuleConfigure
{
public:
SslConfigureItemMap m_nSslItemConfigure;
SslConfigure();
~SslConfigure();
virtual bool Load( const Utils::XmlNodePtr pXmlNode, Common::ConfigureBase &nConfig );
};
typedef std::map<int32 , std::string> ResoveCodeMap;
class ResoveCodeConfigure : public Common::ModuleConfigure
{
public:
ResoveCodeMap m_nResoveCodeMap;
ResoveCodeConfigure();
~ResoveCodeConfigure();
virtual bool Load( const Utils::XmlNodePtr pXmlNode, Common::ConfigureBase &nConfig );
};
class AgentServerConfigure : public Common::ModuleConfigure
{
public:
std::string m_strListenAddress;
int m_nMaxClient;
std::string m_nPacketName;
std::string m_nAgentListenPort;
AgentServerConfigure();
virtual ~AgentServerConfigure();
virtual bool Load( const Utils::XmlNodePtr pXmlNode );
};
class TestColumnConfigure
{
public:
std::string m_strName;
std::string m_strThresholdOperator;
bool m_bPseudo;
bool m_bIndex;
bool m_bQuerySwitch;
bool m_bPrimary;
int m_nIndexType;
bool m_bLob;
std::string m_strTypeSwitch;
std::string m_strLevelSwitch;
std::string m_strLocationSwitch;
bool m_bIpSwitch;
TestColumnConfigure();
virtual ~TestColumnConfigure();
virtual bool Load( const Utils::XmlNodePtr pXmlNode );
};
class WebServerConfigure : public Common::ModuleConfigure
{
public:
bool m_bKeepAlive;
bool m_bSslEnable;
size_t m_nMaxClients;
size_t m_nMaxHeaderSize;
int m_nReceiveTimeout;
int m_nCacheExpireTime;
int m_nConnectionIdleTime;
int m_nConnectionThreadCount;
size_t m_nConnectionServiceTimes;
Utils::InetAddressList m_nListenAddresses;
std::string m_strListenAddress;
int m_nListenPort;
std::string m_strDirectory;
std::string m_strDefFileName;
std::string m_strDefContentType;
Utils::StringMap m_nDefFileNames;
Utils::StringMap m_nHttpContentTypes;
Utils::StringList m_nNoCompressUserAgents;
std::set<uint16> m_nSslMapPorts;
Utils::StringList m_nAllowedAutoLoginAddress;
bool m_bCompressContent;
size_t m_nCompressMinSize;
bool m_bAllowSameIpLogin;
bool m_bValidateLoginIp;
int64 m_nSessionTimeout;
int64 m_nQueryMaxLimit;
int64 m_nExportMaxLimit;
int64 m_nExportCsvLimit;
std::string m_strInterfaceDescribeFile;
std::string m_strAuthorizationUrl;
bool m_bAuthorizationAble;
std::string m_strJsonWebTokenIss;
std::string m_strSystemIdentification;
std::string m_strJsonWebTokenIssueds;
int64 m_nJsonWebTokenTimeout;
WebServerConfigure();
virtual ~WebServerConfigure();
virtual bool Load( const Utils::XmlNodePtr pXmlNode, Common::ConfigureBase &nConfig );
bool IsCompressNotSupported( const std::string &strUserAgent ) const;
};
class DatabaseConfigure : public Common::ModuleConfigure
{
public:
std::string m_strUrl;
std::string m_strUser;
std::string m_strPassword;
std::string m_strResultStatTopSql;
std::string m_strOptimizeTableSql;
std::string m_strLimitDeleteSql;
std::string m_strHistoryPath;
bool m_bShowSqlLog;
bool m_bOptimizeTable;
int m_nHistoryCacheSeconds;
bool m_bMultiTableEnabled;
int64 m_nMultiTableTime;
bool m_bPartitionEnabled;
bool m_bPartitionForHourlyAndDailyTable;
bool m_bNeedTablePartition;
size_t m_nResultConnectionCount;
bool m_bTestResultImport;
Utils::StringMap m_nStatTypeNames;
std::string m_strSystemStatusResult;
Storage::LobColumnMap m_nLobColumns;
DatabaseConfigure();
virtual ~DatabaseConfigure();
virtual bool Load( const Utils::XmlNodePtr pXmlNode );
};
class Configure : public Common::ConfigureBase, public Utils::Singleton<Configure>
{
friend class Utils::Singleton<Configure>;
private:
Configure();
virtual ~Configure();
public:
WebServerConfigure m_nWebServer;
SslConfigure m_nSslConfigure;
ResoveCodeConfigure m_nResoveCodeMeaning;
DatabaseConfigure m_nDatabase;
AgentServerConfigure m_nAgentServer;
virtual bool LoadDoc();
virtual void TraceSummary();
};
#endif //LIVESERVER_CONFIGURE_H