16 #ifndef HAZELCAST_CLIENT_CONFIG 17 #define HAZELCAST_CLIENT_CONFIG 21 #include <boost/shared_ptr.hpp> 23 #include "hazelcast/client/config/ClientConnectionStrategyConfig.h" 24 #include "hazelcast/client/Address.h" 25 #include "hazelcast/client/GroupConfig.h" 26 #include "hazelcast/client/SerializationConfig.h" 27 #include "hazelcast/client/Credentials.h" 28 #include "hazelcast/client/SocketInterceptor.h" 29 #include "hazelcast/client/LoadBalancer.h" 30 #include "hazelcast/client/impl/RoundRobinLB.h" 31 #include "hazelcast/util/ILogger.h" 32 #include "hazelcast/client/config/ReliableTopicConfig.h" 33 #include "hazelcast/client/config/NearCacheConfig.h" 34 #include "hazelcast/client/config/ClientNetworkConfig.h" 35 #include "hazelcast/util/SynchronizedMap.h" 37 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 39 #pragma warning(disable: 4251) //for dll export 44 class MembershipListener;
46 class InitialMembershipListener;
48 class LifecycleListener;
50 class InitialMembershipEvent;
56 friend class spi::impl::ClientClusterServiceImpl;
89 ClientConfig &addAddresses(
const std::vector<Address> &addresses);
99 std::set<Address> getAddresses();
138 ClientConfig &setConnectionAttemptLimit(
int connectionAttemptLimit);
149 int getConnectionAttemptLimit()
const;
155 ClientConfig &setConnectionTimeout(
int connectionTimeoutInMillis);
161 int getConnectionTimeout()
const;
171 ClientConfig &setAttemptPeriod(
int attemptPeriodInMillis);
180 int getAttemptPeriod()
const;
200 bool isRedoOperation()
const;
208 bool isSmart()
const;
252 const std::set<LifecycleListener *> &getLifecycleListeners()
const;
278 ClientConfig &addListener(
const boost::shared_ptr<MembershipListener> &listener);
285 const std::set<MembershipListener *> &getMembershipListeners()
const;
293 const std::set<boost::shared_ptr<MembershipListener> > &getManagedMembershipListeners()
const;
311 ClientConfig &addListener(
const boost::shared_ptr<InitialMembershipListener> &listener);
364 std::map<std::string, std::string> &getProperties();
375 ClientConfig &setProperty(
const std::string &name,
const std::string &value);
402 template <
typename K,
typename V>
404 nearCacheConfigMap.put(nearCacheConfig->getName(), nearCacheConfig);
418 nearCacheConfigMap.put(nearCacheConfig->getName(), nearCacheConfig);
429 template <
typename K,
typename V>
430 const boost::shared_ptr<config::NearCacheConfig<K, V> >
getNearCacheConfig(
const std::string &name) {
431 boost::shared_ptr<config::NearCacheConfigBase> nearCacheConfig = lookupByPattern(name);
432 if (nearCacheConfig.get() == NULL) {
433 nearCacheConfig = nearCacheConfigMap.get(
"default");
440 const boost::shared_ptr<mixedtype::config::MixedNearCacheConfig> getMixedNearCacheConfig(
const std::string &name);
459 const boost::shared_ptr<std::string> &getInstanceName()
const;
461 void setInstanceName(
const boost::shared_ptr<std::string> &instanceName);
468 int32_t getExecutorPoolSize()
const;
476 void setExecutorPoolSize(int32_t executorPoolSize);
492 impl::RoundRobinLB defaultLoadBalancer;
494 std::set<MembershipListener *> membershipListeners;
495 std::set<boost::shared_ptr<MembershipListener> > managedMembershipListeners;
497 std::set<LifecycleListener *> lifecycleListeners;
499 std::map<std::string, std::string> properties;
507 std::map<std::string, config::ReliableTopicConfig> reliableTopicConfigMap;
509 util::SynchronizedMap<std::string, config::NearCacheConfigBase> nearCacheConfigMap;
511 boost::shared_ptr<std::string> instanceName;
516 int32_t executorPoolSize;
520 const boost::shared_ptr<config::NearCacheConfigBase> lookupByPattern(
const std::string &name);
526 #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:44
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:64
IP Address.
Definition: Address.h:41
Client connection strategy configuration is used for setting custom strategies and configuring strate...
Definition: ClientConnectionStrategyConfig.h:32
ClientConfig & addNearCacheConfig(const boost::shared_ptr< config::NearCacheConfig< K, V > > nearCacheConfig)
Helper method to add a new NearCacheConfig.
Definition: ClientConfig.h:403
const boost::shared_ptr< config::NearCacheConfig< K, V > > getNearCacheConfig(const std::string &name)
Gets the NearCacheConfig configured for the map / cache with name.
Definition: ClientConfig.h:430
SerializationConfig is used to.
Definition: SerializationConfig.h:49
ClientConfig & addMixedNearCacheConfig(const boost::shared_ptr< mixedtype::config::MixedNearCacheConfig > nearCacheConfig)
Helper method to add a new NearCacheConfig.
Definition: ClientConfig.h:417
Listener object for listening lifecycle events of hazelcast instance.
Definition: LifecycleListener.h:44
The InitializingMembershipListener is a MembershipListener that will first receives a InitialMembersh...
Definition: InitialMembershipListener.h:57
LoadBalancer allows you to send operations to one of a number of endpoints(Members).
Definition: LoadBalancer.h:38
Definition: MapEntryView.h:32
HazelcastClient configuration class.
Definition: ClientConfig.h:55
Definition: ReliableTopicConfig.h:30