19#include <unordered_set>
20#include <unordered_map>
22#include <boost/optional.hpp>
24#include "hazelcast/client/address.h"
25#include "hazelcast/client/serialization_config.h"
26#include "hazelcast/client/socket_interceptor.h"
27#include "hazelcast/client/load_balancer.h"
28#include "hazelcast/util/SynchronizedMap.h"
29#include "hazelcast/client/config/reliable_topic_config.h"
30#include "hazelcast/client/config/near_cache_config.h"
31#include "hazelcast/client/config/client_network_config.h"
32#include "hazelcast/client/config/client_connection_strategy_config.h"
33#include "hazelcast/client/config/client_flake_id_generator_config.h"
34#include "hazelcast/client/config/matcher/matching_point_config_pattern_matcher.h"
35#include "hazelcast/client/internal/config/ConfigUtils.h"
36#include "hazelcast/client/config/logger_config.h"
37#include "hazelcast/client/serialization/serialization.h"
38#include "hazelcast/client/lifecycle_listener.h"
39#include "hazelcast/client/membership_listener.h"
41#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
43#pragma warning(disable : 4251)
51class ClientConnectionManagerImpl;
55class HAZELCAST_API credentials
64 credentials(
const std::string& name);
66 virtual ~credentials();
68 const std::string& name()
const;
70 virtual credential_type type()
const = 0;
76class HAZELCAST_API username_password_credentials :
public credentials
79 username_password_credentials(
const std::string& name,
80 const std::string& password);
82 const std::string& password()
const;
84 credential_type type()
const override;
87 std::string password_;
90class HAZELCAST_API token_credentials :
public credentials
93 token_credentials(
const std::vector<byte>& token);
95 const std::vector<byte>& token()
const;
97 credential_type type()
const override;
100 std::vector<byte> token_;
109 friend class spi::impl::ClientClusterServiceImpl;
110 friend class connection::ClientConnectionManagerImpl;
139 client_config& set_cluster_name(
const std::string& cluster_name);
148 const std::shared_ptr<security::credentials>& credential);
150 const std::shared_ptr<security::credentials>& get_credentials()
const;
266 const std::unordered_map<std::string, std::string>&
get_properties()
const;
278 const std::string& value);
297 const std::string& name);
319 const std::string& name)
const;
340 const boost::optional<std::string>& get_instance_name()
const;
342 client_config& set_instance_name(
const std::string& instance_name);
363 connection_strategy_config);
425 const std::unordered_set<std::string>& get_labels()
const;
427 client_config& set_labels(
const std::unordered_set<std::string>& labels);
451 friend class reliable_topic;
454 const std::string& name)
const;
456 std::string cluster_name_;
462 boost::optional<load_balancer> load_balancer_;
464 std::vector<membership_listener> membership_listeners_;
466 std::vector<lifecycle_listener> lifecycle_listeners_;
468 std::unordered_map<std::string, std::string> properties_;
470 bool redo_operation_;
474 std::shared_ptr<security::credentials> credentials_;
476 std::unordered_map<std::string, config::reliable_topic_config>
477 reliable_topic_config_map_;
479 std::unordered_map<std::string, config::near_cache_config>
480 near_cache_config_map_;
482 boost::optional<std::string> instance_name_;
487 int32_t executor_pool_size_;
491 std::unordered_map<std::string, config::client_flake_id_generator_config>
492 flake_id_generator_config_map_;
495 config_pattern_matcher_;
499 std::unordered_set<std::string> labels_;
501 bool backup_acks_enabled_ =
true;
507#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
client_config & set_serialization_config(serialization_config const &serialization_config)
SerializationConfig is used to.
serialization_config & get_serialization_config()
const config::reliable_topic_config & get_reliable_topic_config(const std::string &name)
Gets the ClientReliableTopicConfig for a given reliable topic name.
client_config & set_socket_interceptor(socket_interceptor &&interceptor)
Will be called with the Socket, each time client creates a connection to any Member.
client_config & set_redo_operation(bool redo_operation)
If true, client will redo the operations that were executing on the server and client lost the connec...
void set_executor_pool_size(int32_t executor_pool_size)
Sets Client side Executor pool size.
const config::near_cache_config * get_near_cache_config(const std::string &name) const
Gets the NearCacheConfig configured for the map / cache with name.
client_config & add_listener(lifecycle_listener &&listener)
Adds a listener to configuration to be registered when hazelcast_client starts.
client_config & set_credentials(const std::shared_ptr< security::credentials > &credential)
There are two types of credentials you can provide, \username_password_credentials and \token_credent...
const std::unordered_map< std::string, std::string > & get_properties() const
Gets a reference to properties map.
const socket_interceptor & get_socket_interceptor() const
Will be called with the Socket, each time client creates a connection to any Member.
client_config()
Constructor with default values.
config::client_network_config & get_network_config()
Gets {}.
int32_t get_executor_pool_size() const
Pool size for internal ExecutorService which handles responses etc.
client_config & add_reliable_topic_config(const config::reliable_topic_config &reliable_topic_config)
Adds a ClientReliableTopicConfig.
bool is_redo_operation() const
see setRedoOperation returns redoOperation
const std::vector< membership_listener > & get_membership_listeners() const
Returns registered membershipListeners.
client_config & backup_acks_enabled(bool enabled)
This feature reduces number of hops and increase performance for smart clients.
client_config & add_flake_id_generator_config(const config::client_flake_id_generator_config &config)
Adds a flake ID generator configuration.
const std::string & get_cluster_name() const
Returns the configured cluster name.
config::logger_config & get_logger_config()
client_config & set_load_balancer(load_balancer &&load_balancer)
Used to distribute the operations to multiple connections.
load_balancer & get_load_balancer()
Used to distribute the operations to multiple Endpoints.
client_config & set_network_config(const config::client_network_config &network_config)
Sets {}.
const config::client_flake_id_generator_config * get_flake_id_generator_config(const std::string &name)
Returns the {} for the given name, creating one if necessary and adding it to the collection of known...
client_config & add_near_cache_config(const config::near_cache_config &near_cache_config)
Helper method to add a new NearCacheConfig.
const config::client_flake_id_generator_config * find_flake_id_generator_config(const std::string &name)
Returns a {} configuration for the given flake ID generator name.
client_config & set_property(const std::string &name, const std::string &value)
Sets the value of a named property.
const std::vector< lifecycle_listener > & get_lifecycle_listeners() const
Client connection strategy configuration is used for setting custom strategies and configuring strate...
The ClientFlakeIdGeneratorConfig contains the configuration for the client regarding Flake ID Generat...
Contains configuration parameters for client network related behaviour.
This ConfigPatternMatcher supports a simplified wildcard matching.
Contains the configuration for a Near Cache.
A event that is sent when a MembershipListener is registered.
Listener object for listening lifecycle events of hazelcast instance.
load_balancer allows you to send operations to one of a number of endpoints(Members).
Cluster membership listener.
SerializationConfig is used to.
An interface that provides the ability to intercept the creation of sockets.