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 
92  static const std::string PROP_HEARTBEAT_TIMEOUT;
93  static const std::string PROP_HEARTBEAT_TIMEOUT_DEFAULT;
94 
101  static const std::string PROP_HEARTBEAT_INTERVAL;
102  static const std::string PROP_HEARTBEAT_INTERVAL_DEFAULT;
103 
113  static const std::string PROP_REQUEST_RETRY_COUNT;
114  static const std::string PROP_REQUEST_RETRY_COUNT_DEFAULT;
115 
125  static const std::string PROP_REQUEST_RETRY_WAIT_TIME;
126  static const std::string PROP_REQUEST_RETRY_WAIT_TIME_DEFAULT;
127  private:
128  ClientProperty heartbeatTimeout;
129  ClientProperty heartbeatInterval;
130  ClientProperty retryCount;
131  ClientProperty retryWaitTime;
132  };
133 
134  }
135 }
136 
137 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
138 #pragma warning(pop)
139 #endif
140 
141 #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:113
static const std::string PROP_HEARTBEAT_TIMEOUT
Client will be sending heartbeat messages to members and this is the timeout.
Definition: ClientProperties.h:92
static const std::string PROP_HEARTBEAT_INTERVAL
Time interval in seconds between heartbeats to nodes from client.
Definition: ClientProperties.h:101
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:125
HazelcastClient configuration class.
Definition: ClientConfig.h:51