Hazelcast C++ Client
Hazelcast C++ Client Library
client_network_config.h
1 /*
2  * Copyright (c) 2008-2021, Hazelcast, Inc. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 
18 #include "hazelcast/util/export.h"
19 #include "hazelcast/client/config/ssl_config.h"
20 #include "hazelcast/client/config/client_aws_config.h"
21 #include "hazelcast/client/config/socket_options.h"
22 #include "hazelcast/client/config/cloud_config.h"
23 
24 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
25 #pragma warning(push)
26 #pragma warning(disable: 4251) //for dll export
27 #endif
28 
29 namespace hazelcast {
30  namespace client {
31  namespace config {
35  class HAZELCAST_API client_network_config {
36  public:
37 
43 
50  ssl_config &get_ssl_config();
51 
59  client_network_config &set_ssl_config(const config::ssl_config &config);
60 
68  client_network_config &set_connection_timeout(const std::chrono::milliseconds &timeout);
69 
75  std::chrono::milliseconds get_connection_timeout() const;
76 
84 
90  client_aws_config &get_aws_config();
91 
97  cloud_config &get_cloud_config();
98 
104  bool is_smart_routing() const;
105 
120  client_network_config &set_smart_routing(bool smart_routing);
121 
127  std::vector<address> get_addresses() const;
128 
135  client_network_config &add_addresses(const std::vector<address> &addresses);
136 
143  client_network_config &set_addresses(const std::vector<address> &addresses);
144 
151  client_network_config &add_address(const address &address);
152 
153  socket_options &get_socket_options();
154 
155  private:
156  config::ssl_config ssl_config_;
157  config::client_aws_config client_aws_config_;
158  config::cloud_config cloud_config_;
159 
160  std::chrono::milliseconds connection_timeout_;
161  bool smart_routing_;
162 
163  std::vector<address> address_list_;
164 
165  socket_options socket_options_;
166  };
167  }
168  }
169 }
170 
171 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
172 #pragma warning(pop)
173 #endif
174 
175 
Represents an address of a client or member in the cluster.
Definition: address.h:36
The client_aws_config contains the configuration for client to connect to nodes in aws environment.
Contains configuration parameters for client network related behaviour.
Contains configuration parameters for ssl related behaviour.
Definition: ssl_config.h:61
hazelcast.cloud configuration to let the client connect the cluster via hazelcast....
Definition: cloud_config.h:31