23#ifndef NETWORK_PROVIDER_MANAGER_H
24#define NETWORK_PROVIDER_MANAGER_H
28#include <unordered_map>
81 std::shared_ptr<Network_provider> provider)
override;
90 std::shared_ptr<Network_provider> provider);
376 std::unordered_map<enum_transport_protocol, std::shared_ptr<Network_provider>,
432 std::shared_ptr<Network_provider> provider)
override {
449 return m_get_manager().remove_network_provider(provider_key);
463 return m_get_manager().configure_active_provider_secure_connections(params);
493 return m_get_manager().finalize_secure_connections_context();
Proxy class to access funcionality in Network_provider_manager.
Definition: network_provider_manager.h:403
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:440
bool configure_active_provider(Network_configuration_parameters ¶ms) override
Configures the active provider.
Definition: network_provider_manager.h:456
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:420
bool stop_active_network_provider() override
Stops the active provider.
Definition: network_provider_manager.h:444
int xcom_get_ssl_fips_mode() override
Returns the configured FIPS mode.
Definition: network_provider_manager.h:485
void add_network_provider(std::shared_ptr< Network_provider > provider) override
Add a new Gcs_network_provider instance.
Definition: network_provider_manager.h:431
bool start_active_network_provider() override
Start the active provider.
Definition: network_provider_manager.h:436
enum_transport_protocol get_running_protocol() const override
Gets the configured running protocol.
Definition: network_provider_manager.h:424
int is_xcom_using_ssl() const override
Return whether the SSL will be used to encrypt data or not.
Definition: network_provider_manager.h:466
int xcom_set_ssl_mode(int mode) override
Set the operation mode which might be the following:
Definition: network_provider_manager.h:470
void remove_network_provider(enum_transport_protocol provider_key) override
Definition: network_provider_manager.h:448
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:482
void cleanup_secure_connections_context() override
Cleans up SSL context.
Definition: network_provider_manager.h:488
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:473
int xcom_set_ssl_fips_mode(int mode) override
Set the operation fips mode which might be the following:
Definition: network_provider_manager.h:479
Network_Management_Interface()
Definition: network_provider_manager.h:405
std::function< Network_provider_manager &()> m_get_manager
Definition: network_provider_manager.h:497
int xcom_get_ssl_mode() override
Return the configured value into SSL mode.
Definition: network_provider_manager.h:476
enum_transport_protocol get_incoming_connections_protocol() const override
Get the incoming connections Communication Stack.
Definition: network_provider_manager.h:428
bool finalize() override
Finalize the network manager.
Definition: network_provider_manager.h:418
bool initialize() override
Initialize the network manager.
Definition: network_provider_manager.h:416
void remove_all_network_provider() override
Definition: network_provider_manager.h:452
bool configure_active_provider_secure_connections(Network_configuration_parameters ¶ms) override
COnfigures the active provider SSL parameters.
Definition: network_provider_manager.h:461
void finalize_secure_connections_context() override
Destroys all things SSL related.
Definition: network_provider_manager.h:492
Inversion of Control interface to manage Network providers.
Definition: network_management_interface.h:33
Manages all running instances of a network provider.
Definition: network_provider_manager.h:42
static Network_provider_manager & getInstance()
Definition: network_provider_manager.h:44
bool start_network_provider(enum_transport_protocol provider_key)
Starts an already added network provider.
Definition: network_provider_manager.cc:96
enum_transport_protocol get_incoming_connections_protocol() const override
Get the incoming connections Communication Stack.
Definition: network_provider_manager.h:172
bool finalize() override
Finalize the network manager.
Definition: network_provider_manager.cc:58
bool stop_network_provider(enum_transport_protocol provider_key)
Stops a running network provider.
Definition: network_provider_manager.cc:117
bool stop_active_network_provider() override
Stops the active provider.
Definition: network_provider_manager.cc:150
void cleanup_secure_connections_context() override
Cleans up SSL context.
Definition: network_provider_manager.cc:345
int xcom_get_ssl_mode() override
Return the configured value into SSL mode.
Definition: network_provider_manager.cc:343
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:288
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:316
void remove_all_network_provider() override
Removes all configured network providers.
Definition: network_provider_manager.cc:92
connection_descriptor * incoming_connection()
Method to call to get Server Connections that are waiting to be accepted.
Definition: network_provider_manager.cc:264
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:247
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:79
enum_transport_protocol m_running_protocol
Definition: network_provider_manager.h:380
enum_transport_protocol m_incoming_connections_protocol
Definition: network_provider_manager.h:381
std::unordered_map< enum_transport_protocol, std::shared_ptr< Network_provider >, std::hash< int > > m_network_providers
Definition: network_provider_manager.h:378
const std::shared_ptr< Network_provider > get_incoming_connections_provider()
Retrieves the active provider for incoming connections.
Definition: network_provider_manager.cc:130
void add_network_provider(std::shared_ptr< Network_provider > provider) override
Add a new Gcs_network_provider instance.
Definition: network_provider_manager.cc:68
Network_configuration_parameters m_active_provider_secure_connections_configuration
Definition: network_provider_manager.h:388
const std::shared_ptr< Network_provider > get_provider(enum_transport_protocol provider)
Gets a configured provider.
Definition: network_provider_manager.cc:206
Network_provider_manager(Network_provider_manager &&)=delete
void set_incoming_connections_protocol(enum_transport_protocol value)
Definition: network_provider_manager.h:372
int m_ssl_fips_mode
Definition: network_provider_manager.h:384
bool stop_all_network_providers() override
Stops all network providers.
Definition: network_provider_manager.cc:103
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:178
void remove_network_provider(enum_transport_protocol provider_key) override
Remove an active network provider.
Definition: network_provider_manager.cc:87
virtual ~Network_provider_manager() override
Definition: network_provider_manager.h:370
bool configure_active_provider(Network_configuration_parameters ¶ms) override
Configures the active provider.
Definition: network_provider_manager.cc:160
bool start_active_network_provider() override
Start the active provider.
Definition: network_provider_manager.cc:134
bool initialize() override
Initialize the network manager.
Definition: network_provider_manager.cc:50
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:144
int xcom_set_ssl_mode(int mode) override
Set the operation mode which might be the following:
Definition: network_provider_manager.cc:334
const std::shared_ptr< Network_provider > get_active_provider()
Retrieves the active provider.
Definition: network_provider_manager.cc:125
Network_provider_manager()
Definition: network_provider_manager.h:365
Network_configuration_parameters m_active_provider_configuration
Definition: network_provider_manager.h:386
connection_descriptor * open_xcom_connection(const char *server, xcom_port port, bool use_ssl, int connection_timeout=Network_provider::default_connection_timeout())
Opens a new connection to another XCom endpoint served by the same Network provider.
Definition: network_provider_manager.cc:215
int xcom_set_ssl_fips_mode(int mode) override
Set the operation fips mode which might be the following:
Definition: network_provider_manager.cc:292
enum_transport_protocol get_running_protocol() const override
Gets the configured running protocol.
Definition: network_provider_manager.h:160
void finalize_secure_connections_context() override
Destroys all things SSL related.
Definition: network_provider_manager.cc:354
Network_provider_manager & operator=(Network_provider_manager const &)=delete
int m_ssl_mode
Definition: network_provider_manager.h:383
std::shared_ptr< Xcom_network_provider > m_xcom_network_provider
Definition: network_provider_manager.h:391
Inversion of Control proxy interface to operate Network providers.
Definition: network_management_interface.h:203
static constexpr int default_connection_timeout()
Definition: network_provider.h:412
mode
Definition: file_handle.h:59
@ FIPS_MODE_OFF
Definition: network_provider.h:68
enum_transport_protocol
Enum that describes the available XCom Communication Stacks.
Definition: network_provider.h:42
@ XCOM_PROTOCOL
Definition: network_provider.h:44
@ SSL_DISABLED
Definition: network_provider.h:54
required uint64 port
Definition: replication_asynchronous_connection_failover.proto:32
Possible configuration parameters.
Definition: network_provider.h:151
Definition: node_connection.h:46
Definition: server_struct.h:38
unsigned short xcom_port
Definition: xcom_common.h:45