| 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 userThreadPoolSize(1)
56 {
57 // No-op.
58 }
59
65 const std::string& GetEndPoints() const
66 {
67 return endPoints;
68 }
69
80 void SetEndPoints(const std::string& endPoints)
81 {
82 this->endPoints = endPoints;
83 }
84
90 const std::string& GetUser() const
91 {
92 return user;
93 }
94
100 void SetUser(const std::string& user)
101 {
102 this->user = user;
103 }
104
110 const std::string& GetPassword() const
111 {
112 return password;
113 }
114
120 void SetPassword(const std::string& password)
121 {
122 this->password = password;
123 }
124
132 SslMode::Type GetSslMode() const
133 {
134 return sslMode;
135 }
136
144 void SetSslMode(SslMode::Type sslMode)
145 {
146 this->sslMode = sslMode;
147 }
148
154 const std::string& GetSslCertFile() const
155 {
156 return sslCertFile;
157 }
158
164 void SetSslCertFile(const std::string& sslCertFile)
165 {
166 this->sslCertFile = sslCertFile;
167 }
168
174 const std::string& GetSslKeyFile() const
175 {
176 return sslKeyFile;
177 }
178
184 void SetSslKeyFile(const std::string& sslKeyFile)
185 {
186 this->sslKeyFile = sslKeyFile;
187 }
188
195 const std::string& GetSslCaFile() const
196 {
197 return sslCaFile;
198 }
199
206 void SetSslCaFile(const std::string& sslCaFile)
207 {
208 this->sslCaFile = sslCaFile;
209 }
210
222 void SetPartitionAwareness(bool enable)
223 {
224 partitionAwareness = enable;
225 }
226
234 bool IsPartitionAwareness() const
235 {
236 return partitionAwareness;
237 }
238
253 uint32_t GetConnectionsLimit() const
254 {
255 return connectionsLimit;
256 }
257
265 void SetConnectionsLimit(uint32_t limit)
266 {
267 connectionsLimit = limit;
268 }
269
281 int32_t GetConnectionTimeout() const
282 {
283 return connectionTimeout;
284 }
285
293 void SetConnectionTimeout(int32_t timeout)
294 {
295 connectionTimeout = timeout;
296 }
297
304 void SetUserThreadPoolSize(uint32_t size)
305 {
306 userThreadPoolSize = size;
307 }
308
315 uint32_t GetUserThreadPoolSize() const
316 {
317 return userThreadPoolSize;
318 }
319
320 private:
322 std::string endPoints;
323
325 std::string user;
326
328 std::string password;
329
331 SslMode::Type sslMode;
332
334 std::string sslCertFile;
335
337 std::string sslKeyFile;
338
340 std::string sslCaFile;
341
343 bool partitionAwareness;
344
346 uint32_t connectionsLimit;
347
349 int32_t connectionTimeout;
350
352 uint32_t userThreadPoolSize;
353 };
354 }
355 }
356 #endif // _IGNITE_THIN_IGNITE_CLIENT_CONFIGURATION
ignite::thin::IgniteClientConfiguration::SetConnectionsLimit
void SetConnectionsLimit(uint32_t limit)
Set connection limit.
Definition: ignite_client_configuration.h:265
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:65
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:195
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:253
ignite::thin::IgniteClientConfiguration::SetEndPoints
void SetEndPoints(const std::string &endPoints)
Set addresses of the remote servers to connect.
Definition: ignite_client_configuration.h:80
ignite::thin::IgniteClientConfiguration::GetConnectionTimeout
int32_t GetConnectionTimeout() const
Get connection timeout.
Definition: ignite_client_configuration.h:281
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:154
ignite::thin::IgniteClientConfiguration::SetConnectionTimeout
void SetConnectionTimeout(int32_t timeout)
Set connection timeout.
Definition: ignite_client_configuration.h:293
ignite::thin::IgniteClientConfiguration::SetUser
void SetUser(const std::string &user)
Set user name to use for the authentication.
Definition: ignite_client_configuration.h:100
ignite::thin::IgniteClientConfiguration::SetPassword
void SetPassword(const std::string &password)
Set password to use for the authentication.
Definition: ignite_client_configuration.h:120
ignite::thin::IgniteClientConfiguration::SetSslMode
void SetSslMode(SslMode::Type sslMode)
Set SSL mode.
Definition: ignite_client_configuration.h:144
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:174
ignite::thin::IgniteClientConfiguration::GetUser
const std::string & GetUser() const
Get user name used for the authentication.
Definition: ignite_client_configuration.h:90
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:206
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:184
ignite::thin::IgniteClientConfiguration::IsPartitionAwareness
bool IsPartitionAwareness() const
Get Partition Awareness flag.
Definition: ignite_client_configuration.h:234
ignite::thin::IgniteClientConfiguration::GetPassword
const std::string & GetPassword() const
Get password used for the authentication.
Definition: ignite_client_configuration.h:110
ignite::thin::IgniteClientConfiguration::GetSslMode
SslMode::Type GetSslMode() const
Get SSL mode.
Definition: ignite_client_configuration.h:132
ignite::thin::IgniteClientConfiguration
Ignite thin client configuration.
Definition: ignite_client_configuration.h:39
ssl_mode.h
ignite::thin::IgniteClientConfiguration::GetUserThreadPoolSize
uint32_t GetUserThreadPoolSize() const
Get thread pool size.
Definition: ignite_client_configuration.h:315
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:164
ignite::thin::IgniteClientConfiguration::SetPartitionAwareness
void SetPartitionAwareness(bool enable)
Set Partition Awareness.
Definition: ignite_client_configuration.h:222
ignite::thin::IgniteClientConfiguration::SetUserThreadPoolSize
void SetUserThreadPoolSize(uint32_t size)
Set thread pool size.
Definition: ignite_client_configuration.h:304