16 #ifndef HAZELCAST_CLIENT_CONFIG
17 #define HAZELCAST_CLIENT_CONFIG
23 #include "hazelcast/client/Address.h"
24 #include "hazelcast/client/GroupConfig.h"
25 #include "hazelcast/client/SerializationConfig.h"
26 #include "hazelcast/client/Credentials.h"
27 #include "hazelcast/client/SocketInterceptor.h"
28 #include "hazelcast/client/LoadBalancer.h"
29 #include "hazelcast/client/impl/RoundRobinLB.h"
30 #include "hazelcast/util/ILogger.h"
31 #include "hazelcast/client/config/ReliableTopicConfig.h"
32 #include "hazelcast/client/config/NearCacheConfig.h"
33 #include "hazelcast/client/config/ClientNetworkConfig.h"
34 #include "hazelcast/util/SynchronizedMap.h"
36 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
38 #pragma warning(disable: 4251) //for dll export
43 class MembershipListener;
45 class InitialMembershipListener;
47 class LifecycleListener;
81 ClientConfig &addAddresses(
const std::vector<Address> &addresses);
89 std::set<Address, addressComparator> &getAddresses();
126 ClientConfig &setConnectionAttemptLimit(
int connectionAttemptLimit);
135 int getConnectionAttemptLimit()
const;
141 ClientConfig &setConnectionTimeout(
int connectionTimeoutInMillis);
147 int getConnectionTimeout()
const;
155 ClientConfig &setAttemptPeriod(
int attemptPeriodInMillis);
162 int getAttemptPeriod()
const;
182 bool isRedoOperation()
const;
188 bool isSmart()
const;
230 const std::set<LifecycleListener *> &getLifecycleListeners()
const;
249 const std::set<MembershipListener *> &getMembershipListeners()
const;
264 const std::set<InitialMembershipListener *> &getInitialMembershipListeners()
const;
317 std::map<std::string, std::string> &getProperties();
328 ClientConfig &setProperty(
const std::string &name,
const std::string &value);
355 template <
typename K,
typename V>
357 nearCacheConfigMap.put(nearCacheConfig->getName(), nearCacheConfig);
368 template <
typename K,
typename V>
370 boost::shared_ptr<config::NearCacheConfigBase> nearCacheConfig = lookupByPattern(name);
371 if (nearCacheConfig.get() == NULL) {
372 nearCacheConfig = nearCacheConfigMap.get(
"default");
404 std::set<Address, addressComparator> addressList;
408 std::auto_ptr<impl::RoundRobinLB> defaultLoadBalancer;
410 std::set<MembershipListener *> membershipListeners;
412 std::set<InitialMembershipListener *> initialMembershipListeners;
414 std::set<LifecycleListener *> lifecycleListeners;
416 std::map<std::string, std::string> properties;
422 int connectionAttemptLimit;
430 std::map<std::string, config::ReliableTopicConfig> reliableTopicConfigMap;
432 util::SynchronizedMap<std::string, config::NearCacheConfigBase> nearCacheConfigMap;
434 const boost::shared_ptr<config::NearCacheConfigBase> lookupByPattern(
const std::string &name) {
436 return nearCacheConfigMap.get(name);
443 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
Credentials is a container object for endpoint (Members and Clients) security attributes.
Definition: Credentials.h:35
Contains configuration parameters for client network related behaviour.
Definition: ClientNetworkConfig.h:37
Contains the configuration for a Near Cache.
Definition: NearCacheConfig.h:42
Base class for socketInterceptor classes to inherit from.
Definition: SocketInterceptor.h:33
Contains the configuration for Hazelcast groups.
Definition: GroupConfig.h:36
Cluster membership listener.
Definition: MembershipListener.h:51
IP Address.
Definition: Address.h:36
ClientConfig & addNearCacheConfig(const boost::shared_ptr< config::NearCacheConfig< K, V > > nearCacheConfig)
Helper method to add a new NearCacheConfig.
Definition: ClientConfig.h:356
SerializationConfig is used to.
Definition: SerializationConfig.h:44
Listener object for listening lifecycle events of hazelcast instance.
Definition: LifecycleListener.h:44
const config::NearCacheConfig< K, V > * getNearCacheConfig(const std::string &name)
Gets the NearCacheConfig configured for the map / cache with name.
Definition: ClientConfig.h:369
The InitializingMembershipListener is a MembershipListener that will first receives a InitialMembersh...
Definition: InitialMembershipListener.h:50
LoadBalancer allows you to send operations to one of a number of endpoints(Members).
Definition: LoadBalancer.h:40
HazelcastClient configuration class.
Definition: ClientConfig.h:52
Definition: ReliableTopicConfig.h:30