4 #include <QVariantHash> 6 #include <QSslCertificate> 19 static const uint DEFAULT_REDIS_PORT = 6379;
20 static const uint DEFAULT_SSH_PORT = 22;
21 static const uint DEFAULT_TIMEOUT_IN_MS = 60000;
31 const uint port = DEFAULT_REDIS_PORT,
const QString & name =
"");
40 void setName(QString name);
41 void setAuth(QString auth);
42 void setHost(QString host);
43 void setPort(uint port);
52 uint executeTimeout()
const;
53 uint connectionTimeout()
const;
55 void setExecutionTimeout(uint timeout);
56 void setConnectionTimeout(uint timeout);
57 void setTimeouts(uint connectionTimeout, uint commandExecutionTimeout);
64 void setSsl(
bool enabled);
65 QList<QSslCertificate> sslCaCertificates()
const;
66 QString sslCaCertPath()
const;
67 QString sslPrivateKeyPath()
const;
68 QString sslLocalCertPath()
const;
70 void setSslCaCertPath(QString path);
71 void setSslPrivateKeyPath(QString path);
72 void setSslLocalCertPath(QString path);
73 void setSslSettigns(QString sslCaCertPath,
74 QString sslPrivateKeyPath =
"",
75 QString sslLocalCertPath =
"");
80 bool useSshTunnel()
const;
81 bool isSshPasswordUsed()
const;
82 QString sshPassword()
const;
83 QString sshUser()
const;
84 QString sshHost()
const;
92 QString getSshPrivateKeyPath()
const;
94 void setSshPassword(QString pass);
95 void setSshHost(QString host);
96 void setSshPrivateKeyPath(QString path);
97 void setSshUser(QString user);
98 void setSshPort(uint port);
109 uint port = DEFAULT_SSH_PORT,
110 QString sshPrivatekeyPath =
"");
115 QJsonObject toJsonObject();
121 QWeakPointer<Connection> getOwner()
const;
122 void setOwner(QWeakPointer<Connection>);
124 QVariantHash getInternalParameters()
const;
132 template <
class T>
inline T param(
const QString& p)
const 134 if (m_parameters.contains(p))
return m_parameters[p].value<T>();
138 template <
class T>
inline void setParam(
const QString& key, T p)
140 m_parameters.insert(key, p);
143 QString getValidPathFromParameter(
const QString& param)
const;
146 QWeakPointer<Connection> m_owner;
147 QVariantHash m_parameters;
QString getSshPrivateKey() const
getSshPrivateKey from specified path
Definition: connectionconfig.cpp:230
The ConnectionConfig class Supports loading settigns from JSON objects.
Definition: connectionconfig.h:16
ConnectionConfig(const QString &host="", const QString &auth="", const uint port=DEFAULT_REDIS_PORT, const QString &name="")
Default constructor for local connections.
Definition: connectionconfig.cpp:5
void setSshTunnelSettings(QString host, QString user, QString pass, uint port=DEFAULT_SSH_PORT, QString sshPrivatekeyPath="")
setSshTunnelSettings - Set SSH settings
Definition: connectionconfig.cpp:174