| 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:
47 IgniteClientConfiguration() :
48 sslMode(SslMode::DISABLE),
49 partitionAwareness(true),
50 connectionsLimit(0)
51 {
52 // No-op.
53 }
54
60 const std::string& GetEndPoints() const
61 {
62 return endPoints;
63 }
64
75 void SetEndPoints(const std::string& endPoints)
76 {
77 this->endPoints = endPoints;
78 }
79
85 const std::string& GetUser() const
86 {
87 return user;
88 }
89
95 void SetUser(const std::string& user)
96 {
97 this->user = user;
98 }
99
105 const std::string& GetPassword() const
106 {
107 return password;
108 }
109
115 void SetPassword(const std::string& password)
116 {
117 this->password = password;
118 }
119
127 SslMode::Type GetSslMode() const
128 {
129 return sslMode;
130 }
131
139 void SetSslMode(SslMode::Type sslMode)
140 {
141 this->sslMode = sslMode;
142 }
143
149 const std::string& GetSslCertFile() const
150 {
151 return sslCertFile;
152 }
153
159 void SetSslCertFile(const std::string& sslCertFile)
160 {
161 this->sslCertFile = sslCertFile;
162 }
163
169 const std::string& GetSslKeyFile() const
170 {
171 return sslKeyFile;
172 }
173
179 void SetSslKeyFile(const std::string& sslKeyFile)
180 {
181 this->sslKeyFile = sslKeyFile;
182 }
183
190 const std::string& GetSslCaFile() const
191 {
192 return sslCaFile;
193 }
194
201 void SetSslCaFile(const std::string& sslCaFile)
202 {
203 this->sslCaFile = sslCaFile;
204 }
205
217 void SetPartitionAwareness(bool enable)
218 {
219 partitionAwareness = enable;
220 }
221
229 bool IsPartitionAwareness() const
230 {
231 return partitionAwareness;
232 }
233
248 uint32_t GetConnectionsLimit() const
249 {
250 return connectionsLimit;
251 }
252
260 void SetConnectionsLimit(uint32_t limit)
261 {
262 connectionsLimit = limit;
263 }
264
265 private:
267 std::string endPoints;
268
270 std::string user;
271
273 std::string password;
274
276 SslMode::Type sslMode;
277
279 std::string sslCertFile;
280
282 std::string sslKeyFile;
283
285 std::string sslCaFile;
286
288 bool partitionAwareness;
289
291 uint32_t connectionsLimit;
292 };
293 }
294 }
295 #endif // _IGNITE_THIN_IGNITE_CLIENT_CONFIGURATION
ignite::thin::IgniteClientConfiguration::SetConnectionsLimit
void SetConnectionsLimit(uint32_t limit)
Set connection limit.
Definition: ignite_client_configuration.h:260
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:60
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:190
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:248
ignite::thin::IgniteClientConfiguration::SetEndPoints
void SetEndPoints(const std::string &endPoints)
Set addresses of the remote servers to connect.
Definition: ignite_client_configuration.h:75
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:149
ignite::thin::IgniteClientConfiguration::SetUser
void SetUser(const std::string &user)
Set user name to use for the authentication.
Definition: ignite_client_configuration.h:95
ignite::thin::IgniteClientConfiguration::SetPassword
void SetPassword(const std::string &password)
Set password to use for the authentication.
Definition: ignite_client_configuration.h:115
ignite::thin::IgniteClientConfiguration::SetSslMode
void SetSslMode(SslMode::Type sslMode)
Set SSL mode.
Definition: ignite_client_configuration.h:139
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:169
ignite::thin::IgniteClientConfiguration::GetUser
const std::string & GetUser() const
Get user name used for the authentication.
Definition: ignite_client_configuration.h:85
ignite::thin::SslMode::Type
Type
Definition: ssl_mode.h:33
ignite::thin::IgniteClientConfiguration::IgniteClientConfiguration
IgniteClientConfiguration()
Default constructor.
Definition: ignite_client_configuration.h:47
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:201
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:179
ignite::thin::IgniteClientConfiguration::IsPartitionAwareness
bool IsPartitionAwareness() const
Get Partition Awareness flag.
Definition: ignite_client_configuration.h:229
ignite::thin::IgniteClientConfiguration::GetPassword
const std::string & GetPassword() const
Get password used for the authentication.
Definition: ignite_client_configuration.h:105
ignite::thin::IgniteClientConfiguration::GetSslMode
SslMode::Type GetSslMode() const
Get SSL mode.
Definition: ignite_client_configuration.h:127
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:159
ignite::thin::IgniteClientConfiguration::SetPartitionAwareness
void SetPartitionAwareness(bool enable)
Set Partition Awareness.
Definition: ignite_client_configuration.h:217