| Apache Ignite C++

ignite_client_configuration.h
Go to the documentation of this file.
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
23 #ifndef _IGNITE_THIN_IGNITE_CLIENT_CONFIGURATION
24 #define _IGNITE_THIN_IGNITE_CLIENT_CONFIGURATION
25
26 #include <string>
27
28 #include <ignite/thin/ssl_mode.h>
29
30 namespace ignite
31 {
32 namespace thin
33 {
39 class IgniteClientConfiguration
40 {
41 public:
43 enum { DEFAULT_CONNECTION_TIMEOUT = 20000 };
44
50 IgniteClientConfiguration() :
51 sslMode(SslMode::DISABLE),
52 partitionAwareness(true),
53 connectionsLimit(0),
54 connectionTimeout(DEFAULT_CONNECTION_TIMEOUT)
55 {
56 // No-op.
57 }
58
64 const std::string& GetEndPoints() const
65 {
66 return endPoints;
67 }
68
79 void SetEndPoints(const std::string& endPoints)
80 {
81 this->endPoints = endPoints;
82 }
83
89 const std::string& GetUser() const
90 {
91 return user;
92 }
93
99 void SetUser(const std::string& user)
100 {
101 this->user = user;
102 }
103
109 const std::string& GetPassword() const
110 {
111 return password;
112 }
113
119 void SetPassword(const std::string& password)
120 {
121 this->password = password;
122 }
123
131 SslMode::Type GetSslMode() const
132 {
133 return sslMode;
134 }
135
143 void SetSslMode(SslMode::Type sslMode)
144 {
145 this->sslMode = sslMode;
146 }
147
153 const std::string& GetSslCertFile() const
154 {
155 return sslCertFile;
156 }
157
163 void SetSslCertFile(const std::string& sslCertFile)
164 {
165 this->sslCertFile = sslCertFile;
166 }
167
173 const std::string& GetSslKeyFile() const
174 {
175 return sslKeyFile;
176 }
177
183 void SetSslKeyFile(const std::string& sslKeyFile)
184 {
185 this->sslKeyFile = sslKeyFile;
186 }
187
194 const std::string& GetSslCaFile() const
195 {
196 return sslCaFile;
197 }
198
205 void SetSslCaFile(const std::string& sslCaFile)
206 {
207 this->sslCaFile = sslCaFile;
208 }
209
221 void SetPartitionAwareness(bool enable)
222 {
223 partitionAwareness = enable;
224 }
225
233 bool IsPartitionAwareness() const
234 {
235 return partitionAwareness;
236 }
237
252 uint32_t GetConnectionsLimit() const
253 {
254 return connectionsLimit;
255 }
256
264 void SetConnectionsLimit(uint32_t limit)
265 {
266 connectionsLimit = limit;
267 }
268
280 int32_t GetConnectionTimeout() const
281 {
282 return connectionTimeout;
283 }
284
292 void SetConnectionTimeout(int32_t timeout)
293 {
294 connectionTimeout = timeout;
295 }
296
297 private:
299 std::string endPoints;
300
302 std::string user;
303
305 std::string password;
306
308 SslMode::Type sslMode;
309
311 std::string sslCertFile;
312
314 std::string sslKeyFile;
315
317 std::string sslCaFile;
318
320 bool partitionAwareness;
321
323 uint32_t connectionsLimit;
324
326 int32_t connectionTimeout;
327 };
328 }
329 }
330 #endif // _IGNITE_THIN_IGNITE_CLIENT_CONFIGURATION
ignite::thin::IgniteClientConfiguration::SetConnectionsLimit
void SetConnectionsLimit(uint32_t limit)
Set connection limit.
Definition: ignite_client_configuration.h:264
ignite
Apache Ignite API.
Definition: cache.h:48
ignite::thin::IgniteClientConfiguration::GetEndPoints
const std::string & GetEndPoints() const
Get server end points.
Definition: ignite_client_configuration.h:64
ignite::thin::IgniteClientConfiguration::GetSslCaFile
const std::string & GetSslCaFile() const
Get file path to SSL certificate authority to authenticate server certificate during connection estab...
Definition: ignite_client_configuration.h:194
ignite::thin::SslMode
SSL Mode.
Definition: ssl_mode.h:31
ignite::thin::IgniteClientConfiguration::GetConnectionsLimit
uint32_t GetConnectionsLimit() const
Get connection limit.
Definition: ignite_client_configuration.h:252
ignite::thin::IgniteClientConfiguration::SetEndPoints
void SetEndPoints(const std::string &endPoints)
Set addresses of the remote servers to connect.
Definition: ignite_client_configuration.h:79
ignite::thin::IgniteClientConfiguration::GetConnectionTimeout
int32_t GetConnectionTimeout() const
Get connection timeout.
Definition: ignite_client_configuration.h:280
ignite::thin::IgniteClientConfiguration::GetSslCertFile
const std::string & GetSslCertFile() const
Get file path to SSL certificate to use during connection establishment.
Definition: ignite_client_configuration.h:153
ignite::thin::IgniteClientConfiguration::SetConnectionTimeout
void SetConnectionTimeout(int32_t timeout)
Set connection timeout.
Definition: ignite_client_configuration.h:292
ignite::thin::IgniteClientConfiguration::SetUser
void SetUser(const std::string &user)
Set user name to use for the authentication.
Definition: ignite_client_configuration.h:99
ignite::thin::IgniteClientConfiguration::SetPassword
void SetPassword(const std::string &password)
Set password to use for the authentication.
Definition: ignite_client_configuration.h:119
ignite::thin::IgniteClientConfiguration::SetSslMode
void SetSslMode(SslMode::Type sslMode)
Set SSL mode.
Definition: ignite_client_configuration.h:143
ignite::thin::IgniteClientConfiguration::GetSslKeyFile
const std::string & GetSslKeyFile() const
Get file path to SSL private key to use during connection establishment.
Definition: ignite_client_configuration.h:173
ignite::thin::IgniteClientConfiguration::GetUser
const std::string & GetUser() const
Get user name used for the authentication.
Definition: ignite_client_configuration.h:89
ignite::thin::SslMode::Type
Type
Definition: ssl_mode.h:33
ignite::thin::IgniteClientConfiguration::IgniteClientConfiguration
IgniteClientConfiguration()
Default constructor.
Definition: ignite_client_configuration.h:50
ignite::thin::IgniteClientConfiguration::SetSslCaFile
void SetSslCaFile(const std::string &sslCaFile)
Set file path to SSL certificate authority to authenticate server certificate during connection estab...
Definition: ignite_client_configuration.h:205
ignite::thin::IgniteClientConfiguration::SetSslKeyFile
void SetSslKeyFile(const std::string &sslKeyFile)
Set file path to SSL private key to use during connection establishment.
Definition: ignite_client_configuration.h:183
ignite::thin::IgniteClientConfiguration::IsPartitionAwareness
bool IsPartitionAwareness() const
Get Partition Awareness flag.
Definition: ignite_client_configuration.h:233
ignite::thin::IgniteClientConfiguration::GetPassword
const std::string & GetPassword() const
Get password used for the authentication.
Definition: ignite_client_configuration.h:109
ignite::thin::IgniteClientConfiguration::GetSslMode
SslMode::Type GetSslMode() const
Get SSL mode.
Definition: ignite_client_configuration.h:131
ignite::thin::IgniteClientConfiguration
Ignite thin client configuration.
Definition: ignite_client_configuration.h:39
ssl_mode.h
ignite::thin::IgniteClientConfiguration::SetSslCertFile
void SetSslCertFile(const std::string &sslCertFile)
Set file path to SSL certificate to use during connection establishment.
Definition: ignite_client_configuration.h:163
ignite::thin::IgniteClientConfiguration::SetPartitionAwareness
void SetPartitionAwareness(bool enable)
Set Partition Awareness.
Definition: ignite_client_configuration.h:221