diff --git a/include/Base_HostGroups_Manager.h b/include/Base_HostGroups_Manager.h index ca1b85bfe..22c8c6b43 100644 --- a/include/Base_HostGroups_Manager.h +++ b/include/Base_HostGroups_Manager.h @@ -450,74 +450,6 @@ class AWS_Aurora_Info { ~AWS_Aurora_Info(); }; -class Servers_SslParams { - public: - string hostname; - int port; - string username; - string ssl_ca; - string ssl_cert; - string ssl_key; - string ssl_capath; - string ssl_crl; - string ssl_crlpath; - string ssl_cipher; - string tls_version; - string comment; - string MapKey; - Servers_SslParams(string _h, int _p, string _u, - string ca, string cert, string key, string capath, - string crl, string crlpath, string cipher, string tls, - string c) { - hostname = _h; - port = _p; - username = _u; - ssl_ca = ca; - ssl_cert = cert; - ssl_key = key; - ssl_capath = capath; - ssl_crl = crl; - ssl_crlpath = crlpath; - ssl_cipher = cipher; - tls_version = tls; - comment = c; - MapKey = ""; - } - Servers_SslParams(char * _h, int _p, char * _u, - char * ca, char * cert, char * key, char * capath, - char * crl, char * crlpath, char * cipher, char * tls, - char * c) { - hostname = string(_h); - port = _p; - username = string(_u); - ssl_ca = string(ca); - ssl_cert = string(cert); - ssl_key = string(key); - ssl_capath = string(capath); - ssl_crl = string(crl); - ssl_crlpath = string(crlpath); - ssl_cipher = string(cipher); - tls_version = string(tls); - comment = string(c); - MapKey = ""; - } - Servers_SslParams(string _h, int _p, string _u) { - Servers_SslParams(_h, _p, _u, "", "", "", "", "", "", "", "", ""); - } - virtual ~Servers_SslParams() = default; - string getMapKey(const char *del) { - if (MapKey == "") { - MapKey = hostname + string(del) + to_string(port) + string(del) + username; - } - return MapKey; - } -}; - -class MySQLServers_SslParams : public Servers_SslParams { - public: - using Servers_SslParams::Servers_SslParams; -}; - struct p_hg_counter { enum metric { servers_table_version = 0, diff --git a/include/MySQL_HostGroups_Manager.h b/include/MySQL_HostGroups_Manager.h index 2b5bb46f8..0ba8c6cf8 100644 --- a/include/MySQL_HostGroups_Manager.h +++ b/include/MySQL_HostGroups_Manager.h @@ -360,11 +360,6 @@ class AWS_Aurora_Info { ~AWS_Aurora_Info(); }; -class MySQLServers_SslParams : public Servers_SslParams { - public: - using Servers_SslParams::Servers_SslParams; -}; - struct p_hg_counter { enum metric { servers_table_version = 0, diff --git a/include/PgSQL_HostGroups_Manager.h b/include/PgSQL_HostGroups_Manager.h index 13a11183b..2109dad2b 100644 --- a/include/PgSQL_HostGroups_Manager.h +++ b/include/PgSQL_HostGroups_Manager.h @@ -173,11 +173,6 @@ class PgSQL_SrvConnList { PgSQL_Connection *index(unsigned int); }; -class PgSQLServers_SslParams : public Servers_SslParams { - public: - using Servers_SslParams::Servers_SslParams; -}; - class PgSQL_SrvC { // MySQL Server Container public: PgSQL_HGC *myhgc; diff --git a/include/Servers_SslParams.h b/include/Servers_SslParams.h new file mode 100644 index 000000000..92edeb3d8 --- /dev/null +++ b/include/Servers_SslParams.h @@ -0,0 +1,82 @@ +#ifndef __CLASS_SERVERS_SSL_PARAMS_H +#define __CLASS_SERVERS_SSL_PARAMS_H + +#include + +using std::string; +using std::to_string; + +class Servers_SslParams { + public: + string hostname; + int port; + string username; + string ssl_ca; + string ssl_cert; + string ssl_key; + string ssl_capath; + string ssl_crl; + string ssl_crlpath; + string ssl_cipher; + string tls_version; + string comment; + string MapKey; + Servers_SslParams(string _h, int _p, string _u, + string ca, string cert, string key, string capath, + string crl, string crlpath, string cipher, string tls, + string c) { + hostname = _h; + port = _p; + username = _u; + ssl_ca = ca; + ssl_cert = cert; + ssl_key = key; + ssl_capath = capath; + ssl_crl = crl; + ssl_crlpath = crlpath; + ssl_cipher = cipher; + tls_version = tls; + comment = c; + MapKey = ""; + } + Servers_SslParams(char * _h, int _p, char * _u, + char * ca, char * cert, char * key, char * capath, + char * crl, char * crlpath, char * cipher, char * tls, + char * c) { + hostname = string(_h); + port = _p; + username = string(_u); + ssl_ca = string(ca); + ssl_cert = string(cert); + ssl_key = string(key); + ssl_capath = string(capath); + ssl_crl = string(crl); + ssl_crlpath = string(crlpath); + ssl_cipher = string(cipher); + tls_version = string(tls); + comment = string(c); + MapKey = ""; + } + Servers_SslParams(string _h, int _p, string _u) { + Servers_SslParams(_h, _p, _u, "", "", "", "", "", "", "", "", ""); + } + virtual ~Servers_SslParams() = default; + string getMapKey(const char *del) { + if (MapKey == "") { + MapKey = hostname + string(del) + to_string(port) + string(del) + username; + } + return MapKey; + } +}; + +class MySQLServers_SslParams : public Servers_SslParams { + public: + using Servers_SslParams::Servers_SslParams; +}; + +class PgSQLServers_SslParams : public Servers_SslParams { + public: + using Servers_SslParams::Servers_SslParams; +}; + +#endif // __CLASS_SERVERS_SSL_PARAMS_H diff --git a/include/mysql_connection.h b/include/mysql_connection.h index 2cfd8b9c8..d3d2d2159 100644 --- a/include/mysql_connection.h +++ b/include/mysql_connection.h @@ -26,7 +26,7 @@ #define STATUS_MYSQL_CONNECTION_HAS_SAVEPOINT 0x00000800 #define STATUS_MYSQL_CONNECTION_HAS_WARNINGS 0x00001000 -class MySQLServers_SslParams; +#include "Servers_SslParams.h" class Variable { public: