Hazelcast C++ Client
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 <memory>
19 #include <stdint.h>
20 
21 #include "hazelcast/util/export.h"
22 #include "hazelcast/client/config/ssl_config.h"
23 #include "hazelcast/client/config/client_aws_config.h"
24 #include "hazelcast/client/config/socket_options.h"
25 
26 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
27 #pragma warning(push)
28 #pragma warning(disable: 4251) //for dll export
29 #endif
30 
31 namespace hazelcast {
32  namespace client {
33  namespace config {
37  class HAZELCAST_API client_network_config {
38  public:
39 
45 
52  ssl_config &get_ssl_config();
53 
61  client_network_config &set_ssl_config(const config::ssl_config &config);
62 
70  client_network_config &set_connection_timeout(const std::chrono::milliseconds &timeout);
71 
77  std::chrono::milliseconds get_connection_timeout() const;
78 
86 
92  client_aws_config &get_aws_config();
93 
99  bool is_smart_routing() const;
100 
115  client_network_config &set_smart_routing(bool smart_routing);
116 
122  std::vector<address> get_addresses() const;
123 
130  client_network_config &add_addresses(const std::vector<address> &addresses);
131 
138  client_network_config &set_addresses(const std::vector<address> &addresses);
139 
146  client_network_config &add_address(const address &address);
147 
148  socket_options &get_socket_options();
149 
150  private:
151  config::ssl_config ssl_config_;
152  config::client_aws_config client_aws_config_;
153 
154  std::chrono::milliseconds connection_timeout_;
155  bool smart_routing_;
156 
157  std::vector<address> address_list_;
158 
159  socket_options socket_options_;
160  };
161  }
162  }
163 }
164 
165 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
166 #pragma warning(pop)
167 #endif
168 
169 
Contains configuration parameters for client network related behaviour.
Definition: client_network_config.h:37
The client_aws_config contains the configuration for client to connect to nodes in aws environment...
Definition: client_aws_config.h:52
TCP Socket options.
Definition: socket_options.h:31
Represents an address of a client or member in the cluster.
Definition: address.h:36
Definition: address.h:30
Contains configuration parameters for client network related behaviour.
Definition: ssl_config.h:56