Hazelcast C++ Client
ClientNetworkConfig.h
1 /*
2  * Copyright (c) 2008-2018, 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 #ifndef HAZELCAST_CLIENT_CONFIG_CLIENTNETWORKCONFIG_H_
17 #define HAZELCAST_CLIENT_CONFIG_CLIENTNETWORKCONFIG_H_
18 
19 #include <memory>
20 #include <stdint.h>
21 
22 #include "hazelcast/util/HazelcastDll.h"
23 #include "hazelcast/client/config/SSLConfig.h"
24 #include "hazelcast/client/config/ClientAwsConfig.h"
25 #include "hazelcast/client/config/SocketOptions.h"
26 
27 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
28 #pragma warning(push)
29 #pragma warning(disable: 4251) //for dll export
30 #endif
31 
32 namespace hazelcast {
33  namespace client {
34  namespace config {
38  class HAZELCAST_API ClientNetworkConfig {
39  public:
40 
46 
53  SSLConfig &getSSLConfig();
54 
62  ClientNetworkConfig &setSSLConfig(const config::SSLConfig &sslConfig);
63 
70  ClientNetworkConfig &setConnectionTimeout(int64_t connectionTimeoutInMillis);
71 
77  int64_t getConnectionTimeout() const;
78 
85  ClientNetworkConfig &setAwsConfig(const ClientAwsConfig &clientAwsConfig);
86 
92  ClientAwsConfig &getAwsConfig();
93 
99  bool isSmartRouting() const;
100 
115  ClientNetworkConfig &setSmartRouting(bool smartRouting);
116 
122  int32_t getConnectionAttemptLimit() const;
123 
134  ClientNetworkConfig &setConnectionAttemptLimit(int32_t connectionAttemptLimit);
135 
143  int32_t getConnectionAttemptPeriod() const;
144 
151  ClientNetworkConfig &setConnectionAttemptPeriod(int32_t connectionAttemptPeriod);
152 
158  std::vector<Address> getAddresses() const;
159 
166  ClientNetworkConfig &addAddresses(const std::vector<Address> &addresses);
167 
174  ClientNetworkConfig &setAddresses(const std::vector<Address> &addresses);
175 
182  ClientNetworkConfig &addAddress(const Address &address);
183 
184  SocketOptions &getSocketOptions();
185 
186  private:
187  static int32_t CONNECTION_ATTEMPT_PERIOD;
188 
189  config::SSLConfig sslConfig;
190  config::ClientAwsConfig clientAwsConfig;
191 
192  int64_t connectionTimeout;
193  bool smartRouting;
194 
195  int32_t connectionAttemptLimit;
196  int32_t connectionAttemptPeriod;
197 
198  std::vector<Address> addressList;
199 
200  SocketOptions socketOptions;
201  };
202  }
203  }
204 }
205 
206 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
207 #pragma warning(pop)
208 #endif
209 
210 #endif /* HAZELCAST_CLIENT_CONFIG_CLIENTNETWORKCONFIG_H_ */
Contains configuration parameters for client network related behaviour.
Definition: ClientNetworkConfig.h:38
The ClientAwsConfig contains the configuration for client to connect to nodes in aws environment...
Definition: ClientAwsConfig.h:53
IP Address.
Definition: Address.h:41
Contains configuration parameters for client network related behaviour.
Definition: SSLConfig.h:61
TCP Socket options.
Definition: SocketOptions.h:32
PN (Positive-Negative) CRDT counter.
Definition: MapEntryView.h:32