Hazelcast C++ Client
 All Classes Functions Variables Enumerations Enumerator Pages
ClientProperties.h
1 /*
2  * Copyright (c) 2008-2017, 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 //
17 // Created by sancar koyunlu on 21/08/14.
18 //
19 
20 
21 #ifndef HAZELCAST_ClientProperties
22 #define HAZELCAST_ClientProperties
23 
24 #include "hazelcast/util/HazelcastDll.h"
25 #include <string>
26 #include <map>
27 
28 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
29 #pragma warning(push)
30 #pragma warning(disable: 4251) //for dll export
31 #endif
32 
33 namespace hazelcast {
34  namespace client {
35  class ClientConfig;
36 
42  class HAZELCAST_API ClientProperty {
43  public:
44  ClientProperty(ClientConfig& config, const std::string& name, const std::string& defaultValue);
45 
46  std::string getName() const;
47 
48  std::string getValue() const;
49 
50  int getInteger() const;
51 
52  byte getByte() const;
53 
54  bool getBoolean() const;
55 
56  std::string getString() const;
57 
58  long getLong() const;
59 
60  private:
61  std::string name;
62  std::string value;
63  };
64 
65 
71  class HAZELCAST_API ClientProperties {
72  public:
73  ClientProperties(ClientConfig& clientConfig);
74 
75  const ClientProperty& getHeartbeatTimeout() const;
76 
77  const ClientProperty& getHeartbeatInterval() const;
78 
79  const ClientProperty& getRetryCount() const;
80 
81  const ClientProperty& getRetryWaitTime() const;
82 
83  const ClientProperty& getAwsMemberPort() const;
84 
93  static const std::string PROP_HEARTBEAT_TIMEOUT;
94  static const std::string PROP_HEARTBEAT_TIMEOUT_DEFAULT;
95 
102  static const std::string PROP_HEARTBEAT_INTERVAL;
103  static const std::string PROP_HEARTBEAT_INTERVAL_DEFAULT;
104 
114  static const std::string PROP_REQUEST_RETRY_COUNT;
115  static const std::string PROP_REQUEST_RETRY_COUNT_DEFAULT;
116 
126  static const std::string PROP_REQUEST_RETRY_WAIT_TIME;
127  static const std::string PROP_REQUEST_RETRY_WAIT_TIME_DEFAULT;
128 
134  static const std::string PROP_AWS_MEMBER_PORT;
135  static const std::string PROP_AWS_MEMBER_PORT_DEFAULT;
136  private:
137  ClientProperty heartbeatTimeout;
138  ClientProperty heartbeatInterval;
139  ClientProperty retryCount;
140  ClientProperty retryWaitTime;
141  ClientProperty awsMemberPort;
142  };
143 
144  }
145 }
146 
147 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
148 #pragma warning(pop)
149 #endif
150 
151 #endif //HAZELCAST_ClientProperties
static const std::string PROP_REQUEST_RETRY_COUNT
Client will retry requests which either inherently retryable(idempotent client) or ClientNetworkConfi...
Definition: ClientProperties.h:114
static const std::string PROP_HEARTBEAT_TIMEOUT
Client will be sending heartbeat messages to members and this is the timeout.
Definition: ClientProperties.h:93
static const std::string PROP_AWS_MEMBER_PORT
The discovery mechanism will discover only IP addresses.
Definition: ClientProperties.h:134
static const std::string PROP_HEARTBEAT_INTERVAL
Time interval in seconds between heartbeats to nodes from client.
Definition: ClientProperties.h:102
A client property is a configuration for hazelcast client.
Definition: ClientProperties.h:42
Client Properties is an internal class.
Definition: ClientProperties.h:71
static const std::string PROP_REQUEST_RETRY_WAIT_TIME
Client will retry requests which either inherently retryable(idempotent client) or ClientNetworkConfi...
Definition: ClientProperties.h:126
HazelcastClient configuration class.
Definition: ClientConfig.h:52