24#ifndef NETWORK_PROVIDER_MANAGER_H
25#define NETWORK_PROVIDER_MANAGER_H
29#include <unordered_map>
82 std::shared_ptr<Network_provider> provider)
override;
91 std::shared_ptr<Network_provider> provider);
383 std::unordered_map<enum_transport_protocol, std::shared_ptr<Network_provider>,
443 std::shared_ptr<Network_provider> provider)
override {
474 return m_get_manager().configure_active_provider_secure_connections(params);
503 m_get_manager().delayed_cleanup_secure_connections_context();
Proxy class to access funcionality in Network_provider_manager.
Definition: network_provider_manager.h:414
virtual ~Network_Management_Interface() override=default
Network_Management_Interface(Network_Management_Interface const &)=delete
bool stop_all_network_providers() override
Stops all network providers.
Definition: network_provider_manager.h:451
bool configure_active_provider(Network_configuration_parameters ¶ms) override
Configures the active provider.
Definition: network_provider_manager.h:467
void set_running_protocol(enum_transport_protocol new_value) override
Sets the running Communication Stack, thus defining the active provider.
Definition: network_provider_manager.h:431
bool stop_active_network_provider() override
Stops the active provider.
Definition: network_provider_manager.h:455
void delayed_cleanup_secure_connections_context() override
Cleans up SSL context indirectly from the last active network provider.
Definition: network_provider_manager.h:502
int xcom_get_ssl_fips_mode() override
Returns the configured FIPS mode.
Definition: network_provider_manager.h:496
void add_network_provider(std::shared_ptr< Network_provider > provider) override
Add a new Gcs_network_provider instance.
Definition: network_provider_manager.h:442
bool start_active_network_provider() override
Start the active provider.
Definition: network_provider_manager.h:447
enum_transport_protocol get_running_protocol() const override
Gets the configured running protocol.
Definition: network_provider_manager.h:435
int is_xcom_using_ssl() const override
Return whether the SSL will be used to encrypt data or not.
Definition: network_provider_manager.h:477
int xcom_set_ssl_mode(int mode) override
Set the operation mode which might be the following:
Definition: network_provider_manager.h:481
void remove_network_provider(enum_transport_protocol provider_key) override
Definition: network_provider_manager.h:459
Network_Management_Interface & operator=(Network_Management_Interface const &)=delete
int xcom_get_ssl_fips_mode(const char *mode) override
Return the operation fips mode as an integer from an operation fips mode provided as a string.
Definition: network_provider_manager.h:493
void cleanup_secure_connections_context() override
Cleans up SSL context directly into the active network provider.
Definition: network_provider_manager.h:499
int xcom_get_ssl_mode(const char *mode) override
Return the operation mode as an integer from an operation mode provided as a string.
Definition: network_provider_manager.h:484
int xcom_set_ssl_fips_mode(int mode) override
Set the operation fips mode which might be the following:
Definition: network_provider_manager.h:490
Network_Management_Interface()
Definition: network_provider_manager.h:416
std::function< Network_provider_manager &()> m_get_manager
Definition: network_provider_manager.h:510
int xcom_get_ssl_mode() override
Return the configured value into SSL mode.
Definition: network_provider_manager.h:487
enum_transport_protocol get_incoming_connections_protocol() const override
Get the incoming connections Communication Stack.
Definition: network_provider_manager.h:439
bool finalize() override
Finalize the network manager.
Definition: network_provider_manager.h:429
bool initialize() override
Initialize the network manager.
Definition: network_provider_manager.h:427
void remove_all_network_provider() override
Definition: network_provider_manager.h:463
bool configure_active_provider_secure_connections(Network_configuration_parameters ¶ms) override
COnfigures the active provider SSL parameters.
Definition: network_provider_manager.h:472
void finalize_secure_connections_context() override
Destroys all things SSL related.
Definition: network_provider_manager.h:505
Inversion of Control interface to manage Network providers.
Definition: network_management_interface.h:34
Manages all running instances of a network provider.
Definition: network_provider_manager.h:43
static Network_provider_manager & getInstance()
Definition: network_provider_manager.h:45
bool start_network_provider(enum_transport_protocol provider_key)
Starts an already added network provider.
Definition: network_provider_manager.cc:97
enum_transport_protocol get_incoming_connections_protocol() const override
Get the incoming connections Communication Stack.
Definition: network_provider_manager.h:173
bool finalize() override
Finalize the network manager.
Definition: network_provider_manager.cc:59
bool stop_network_provider(enum_transport_protocol provider_key)
Stops a running network provider.
Definition: network_provider_manager.cc:121
bool stop_active_network_provider() override
Stops the active provider.
Definition: network_provider_manager.cc:163
void cleanup_secure_connections_context() override
Cleans up SSL context.
Definition: network_provider_manager.cc:363
int xcom_get_ssl_mode() override
Return the configured value into SSL mode.
Definition: network_provider_manager.cc:355
Network_provider_manager & operator=(Network_provider_manager &&)=delete
int is_xcom_using_ssl() const override
Return whether the SSL will be used to encrypt data or not.
Definition: network_provider_manager.cc:300
Network_provider_manager(Network_provider_manager const &)=delete
int xcom_get_ssl_fips_mode() override
Returns the configured FIPS mode.
Definition: network_provider_manager.cc:328
void remove_all_network_provider() override
Removes all configured network providers.
Definition: network_provider_manager.cc:93
connection_descriptor * incoming_connection()
Method to call to get Server Connections that are waiting to be accepted.
Definition: network_provider_manager.cc:276
int close_xcom_connection(connection_descriptor *connection_handle)
Closes an open connection to another XCom endpoint served by the a Network provider.
Definition: network_provider_manager.cc:259
void delayed_cleanup_secure_connections_context() override
Cleans up SSL context indirectly from the last active network provider.
Definition: network_provider_manager.cc:357
void add_and_start_network_provider(std::shared_ptr< Network_provider > provider)
Add a new Gcs_network_provider instance and start it.
Definition: network_provider_manager.cc:80
enum_transport_protocol m_running_protocol
Definition: network_provider_manager.h:387
enum_transport_protocol m_incoming_connections_protocol
Definition: network_provider_manager.h:388
void cleanup_incoming_connection(Network_provider &provider_ref)
Definition: network_provider_manager.cc:393
std::unordered_map< enum_transport_protocol, std::shared_ptr< Network_provider >, std::hash< int > > m_network_providers
Definition: network_provider_manager.h:385
const std::shared_ptr< Network_provider > get_incoming_connections_provider()
Retrieves the active provider for incoming connections.
Definition: network_provider_manager.cc:140
void add_network_provider(std::shared_ptr< Network_provider > provider) override
Add a new Gcs_network_provider instance.
Definition: network_provider_manager.cc:69
Network_configuration_parameters m_active_provider_secure_connections_configuration
Definition: network_provider_manager.h:395
const std::shared_ptr< Network_provider > get_provider(enum_transport_protocol provider)
Gets a configured provider.
Definition: network_provider_manager.cc:222
Network_provider_manager(Network_provider_manager &&)=delete
void set_incoming_connections_protocol(enum_transport_protocol value)
Definition: network_provider_manager.h:377
int m_ssl_fips_mode
Definition: network_provider_manager.h:391
connection_descriptor * open_xcom_connection(const char *server, xcom_port port, bool use_ssl, int connection_timeout=Network_provider::default_connection_timeout(), network_provider_dynamic_log_level log_level=network_provider_dynamic_log_level::PROVIDED)
Opens a new connection to another XCom endpoint served by the same Network provider.
Definition: network_provider_manager.cc:231
bool stop_all_network_providers() override
Stops all network providers.
Definition: network_provider_manager.cc:104
bool configure_active_provider_secure_connections(Network_configuration_parameters ¶ms) override
Configures the active provider with all things needed to establish SSL connections.
Definition: network_provider_manager.cc:194
void remove_network_provider(enum_transport_protocol provider_key) override
Remove an active network provider.
Definition: network_provider_manager.cc:88
virtual ~Network_provider_manager() override
Definition: network_provider_manager.h:375
bool configure_active_provider(Network_configuration_parameters ¶ms) override
Configures the active provider.
Definition: network_provider_manager.cc:176
bool start_active_network_provider() override
Start the active provider.
Definition: network_provider_manager.cc:144
bool initialize() override
Initialize the network manager.
Definition: network_provider_manager.cc:51
void set_running_protocol(enum_transport_protocol new_value) override
Sets the running Communication Stack, thus defining the active provider.
Definition: network_provider_manager.h:145
int xcom_set_ssl_mode(int mode) override
Set the operation mode which might be the following:
Definition: network_provider_manager.cc:346
const std::shared_ptr< Network_provider > get_active_provider()
Retrieves the active provider.
Definition: network_provider_manager.cc:135
Network_provider_manager()
Definition: network_provider_manager.h:370
Network_configuration_parameters m_active_provider_configuration
Definition: network_provider_manager.h:393
int xcom_set_ssl_fips_mode(int mode) override
Set the operation fips mode which might be the following:
Definition: network_provider_manager.cc:304
enum_transport_protocol get_running_protocol() const override
Gets the configured running protocol.
Definition: network_provider_manager.h:161
void finalize_secure_connections_context() override
Destroys all things SSL related.
Definition: network_provider_manager.cc:372
Network_provider_manager & operator=(Network_provider_manager const &)=delete
std::function< void()> m_ssl_data_context_cleaner
Definition: network_provider_manager.h:402
int m_ssl_mode
Definition: network_provider_manager.h:390
std::shared_ptr< Xcom_network_provider > m_xcom_network_provider
Definition: network_provider_manager.h:398
Inversion of Control proxy interface to operate Network providers.
Definition: network_management_interface.h:211
Base class for External Network Providers.
Definition: network_provider.h:295
static constexpr int default_connection_timeout()
Definition: network_provider.h:457
static loglevel log_level(const Sql_condition *condition)
Definition: histogram.cc:1644
mode
Definition: file_handle.h:61
@ FIPS_MODE_OFF
Definition: network_provider.h:71
enum_transport_protocol
Enum that describes the available XCom Communication Stacks.
Definition: network_provider.h:45
@ XCOM_PROTOCOL
Definition: network_provider.h:47
@ SSL_DISABLED
Definition: network_provider.h:57
network_provider_dynamic_log_level
Dynamic log level enum values.
Definition: network_provider.h:103
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:33
Possible configuration parameters.
Definition: network_provider.h:191
Definition: node_connection.h:47
Definition: server_struct.h:39
unsigned short xcom_port
Definition: xcom_common.h:46