16 #ifndef HAZELCAST_CLIENT_CONFIG 17 #define HAZELCAST_CLIENT_CONFIG 21 #include <boost/shared_ptr.hpp> 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/util/SynchronizedMap.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/client/config/ClientConnectionStrategyConfig.h" 36 #include "hazelcast/client/config/ClientFlakeIdGeneratorConfig.h" 37 #include "hazelcast/client/config/matcher/MatchingPointConfigPatternMatcher.h" 38 #include "hazelcast/client/internal/config/ConfigUtils.h" 39 #include "hazelcast/client/config/LoggerConfig.h" 41 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 43 #pragma warning(disable: 4251) //for dll export 48 class MembershipListener;
50 class InitialMembershipListener;
52 class LifecycleListener;
54 class InitialMembershipEvent;
60 friend class spi::impl::ClientClusterServiceImpl;
93 ClientConfig &addAddresses(
const std::vector<Address> &addresses);
103 std::set<Address> getAddresses();
142 ClientConfig &setConnectionAttemptLimit(
int connectionAttemptLimit);
153 int getConnectionAttemptLimit()
const;
159 ClientConfig &setConnectionTimeout(
int connectionTimeoutInMillis);
165 int getConnectionTimeout()
const;
175 ClientConfig &setAttemptPeriod(
int attemptPeriodInMillis);
184 int getAttemptPeriod()
const;
204 bool isRedoOperation()
const;
212 bool isSmart()
const;
256 const std::set<LifecycleListener *> &getLifecycleListeners()
const;
282 ClientConfig &addListener(
const boost::shared_ptr<MembershipListener> &listener);
289 const std::set<MembershipListener *> &getMembershipListeners()
const;
297 const std::set<boost::shared_ptr<MembershipListener> > &getManagedMembershipListeners()
const;
315 ClientConfig &addListener(
const boost::shared_ptr<InitialMembershipListener> &listener);
368 std::map<std::string, std::string> &getProperties();
379 ClientConfig &setProperty(
const std::string &name,
const std::string &value);
406 template <
typename K,
typename V>
408 nearCacheConfigMap.put(nearCacheConfig->getName(), nearCacheConfig);
422 nearCacheConfigMap.put(nearCacheConfig->getName(), nearCacheConfig);
433 template <
typename K,
typename V>
434 const boost::shared_ptr<config::NearCacheConfig<K, V> >
getNearCacheConfig(
const std::string &name) {
435 boost::shared_ptr<config::NearCacheConfigBase> nearCacheConfig = internal::config::ConfigUtils::lookupByPattern<config::NearCacheConfigBase>(
436 configPatternMatcher, nearCacheConfigMap, name);
437 if (nearCacheConfig.get() == NULL) {
438 nearCacheConfig = nearCacheConfigMap.get(
"default");
445 const boost::shared_ptr<mixedtype::config::MixedNearCacheConfig> getMixedNearCacheConfig(
const std::string &name);
464 const boost::shared_ptr<std::string> &getInstanceName()
const;
466 void setInstanceName(
const boost::shared_ptr<std::string> &instanceName);
473 int32_t getExecutorPoolSize()
const;
481 void setExecutorPoolSize(int32_t executorPoolSize);
503 boost::shared_ptr<config::ClientFlakeIdGeneratorConfig> findFlakeIdGeneratorConfig(
const std::string &name);
530 boost::shared_ptr<config::ClientFlakeIdGeneratorConfig> getFlakeIdGeneratorConfig(
const std::string &name);
540 ClientConfig &addFlakeIdGeneratorConfig(
const boost::shared_ptr<config::ClientFlakeIdGeneratorConfig> &config);
558 impl::RoundRobinLB defaultLoadBalancer;
560 std::set<MembershipListener *> membershipListeners;
561 std::set<boost::shared_ptr<MembershipListener> > managedMembershipListeners;
563 std::set<LifecycleListener *> lifecycleListeners;
565 std::map<std::string, std::string> properties;
573 std::map<std::string, config::ReliableTopicConfig> reliableTopicConfigMap;
575 util::SynchronizedMap<std::string, config::NearCacheConfigBase> nearCacheConfigMap;
577 boost::shared_ptr<std::string> instanceName;
582 int32_t executorPoolSize;
586 util::SynchronizedMap<std::string, config::ClientFlakeIdGeneratorConfig> flakeIdGeneratorConfigMap;
596 #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:38
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:407
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:434
SerializationConfig is used to.
Definition: SerializationConfig.h:49
Definition: LoggerConfig.h:45
ClientConfig & addMixedNearCacheConfig(const boost::shared_ptr< mixedtype::config::MixedNearCacheConfig > nearCacheConfig)
Helper method to add a new NearCacheConfig.
Definition: ClientConfig.h:421
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
PN (Positive-Negative) CRDT counter.
Definition: MapEntryView.h:32
HazelcastClient configuration class.
Definition: ClientConfig.h:59
Definition: ReliableTopicConfig.h:30
This.
Definition: MatchingPointConfigPatternMatcher.h:35