MySQL 8.0.39
Source Code Documentation
Network_Management_Interface Class Reference

Proxy class to access funcionality in Network_provider_manager. More...

#include <network_provider_manager.h>

Inheritance diagram for Network_Management_Interface:
[legend]

Public Member Functions

 Network_Management_Interface ()
 
virtual ~Network_Management_Interface () override=default
 
 Network_Management_Interface (Network_Management_Interface const &)=delete
 
Network_Management_Interfaceoperator= (Network_Management_Interface const &)=delete
 
bool initialize () override
 Initialize the network manager. More...
 
bool finalize () override
 Finalize the network manager. More...
 
void set_running_protocol (enum_transport_protocol new_value) override
 Sets the running Communication Stack, thus defining the active provider. More...
 
enum_transport_protocol get_running_protocol () const override
 Gets the configured running protocol. More...
 
enum_transport_protocol get_incoming_connections_protocol () const override
 Get the incoming connections Communication Stack. More...
 
void add_network_provider (std::shared_ptr< Network_provider > provider) override
 Add a new Gcs_network_provider instance. More...
 
bool start_active_network_provider () override
 Start the active provider. More...
 
bool stop_all_network_providers () override
 Stops all network providers. More...
 
bool stop_active_network_provider () override
 Stops the active provider. More...
 
void remove_network_provider (enum_transport_protocol provider_key) override
 
void remove_all_network_provider () override
 
bool configure_active_provider (Network_configuration_parameters &params) override
 Configures the active provider. More...
 
bool configure_active_provider_secure_connections (Network_configuration_parameters &params) override
 COnfigures the active provider SSL parameters. More...
 
int is_xcom_using_ssl () const override
 Return whether the SSL will be used to encrypt data or not. More...
 
int xcom_set_ssl_mode (int mode) override
 Set the operation mode which might be the following: More...
 
int xcom_get_ssl_mode (const char *mode) override
 Return the operation mode as an integer from an operation mode provided as a string. More...
 
int xcom_get_ssl_mode () override
 Return the configured value into SSL mode. More...
 
int xcom_set_ssl_fips_mode (int mode) override
 Set the operation fips mode which might be the following: More...
 
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. More...
 
int xcom_get_ssl_fips_mode () override
 Returns the configured FIPS mode. More...
 
void cleanup_secure_connections_context () override
 Cleans up SSL context directly into the active network provider. More...
 
void delayed_cleanup_secure_connections_context () override
 Cleans up SSL context indirectly from the last active network provider. More...
 
void finalize_secure_connections_context () override
 Destroys all things SSL related. More...
 
- Public Member Functions inherited from Network_provider_management_interface
 Network_provider_management_interface ()
 
virtual ~Network_provider_management_interface ()
 
 Network_provider_management_interface (Network_provider_management_interface const &)=delete
 
Network_provider_management_interfaceoperator= (Network_provider_management_interface const &)=delete
 
 Network_provider_management_interface (Network_provider_management_interface &&)=default
 
Network_provider_management_interfaceoperator= (Network_provider_management_interface &&)=default
 
- Public Member Functions inherited from Network_provider_operations_interface
 Network_provider_operations_interface ()
 
virtual ~Network_provider_operations_interface ()
 
 Network_provider_operations_interface (Network_provider_operations_interface const &)=delete
 
Network_provider_operations_interfaceoperator= (Network_provider_operations_interface const &)=delete
 

Private Attributes

std::function< Network_provider_manager &()> m_get_manager
 

Detailed Description

Proxy class to access funcionality in Network_provider_manager.

This way, we avoid spreading singleton calls in all the code, thus encapsulting all calls.

Constructor & Destructor Documentation

◆ Network_Management_Interface() [1/2]

Network_Management_Interface::Network_Management_Interface ( )
inline

◆ ~Network_Management_Interface()

virtual Network_Management_Interface::~Network_Management_Interface ( )
overridevirtualdefault

◆ Network_Management_Interface() [2/2]

Network_Management_Interface::Network_Management_Interface ( Network_Management_Interface const &  )
delete

Member Function Documentation

◆ add_network_provider()

void Network_Management_Interface::add_network_provider ( std::shared_ptr< Network_provider provider)
inlineoverridevirtual

Add a new Gcs_network_provider instance.

Parameters
provideran already instantiated shared_ptr object of a Gcs_network_provider

Implements Network_provider_management_interface.

◆ cleanup_secure_connections_context()

void Network_Management_Interface::cleanup_secure_connections_context ( )
inlineoverridevirtual

Cleans up SSL context directly into the active network provider.

Implements Network_provider_management_interface.

◆ configure_active_provider()

bool Network_Management_Interface::configure_active_provider ( Network_configuration_parameters params)
inlineoverridevirtual

Configures the active provider.

Parameters
paramsconfiguration parameters.
Returns
true In case of success.
false In case of failure.

Implements Network_provider_operations_interface.

◆ configure_active_provider_secure_connections()

bool Network_Management_Interface::configure_active_provider_secure_connections ( Network_configuration_parameters params)
inlineoverridevirtual

COnfigures the active provider SSL parameters.

Parameters
paramsthe security parameters.
Returns
true in case of error. false otherwise.

Implements Network_provider_operations_interface.

◆ delayed_cleanup_secure_connections_context()

void Network_Management_Interface::delayed_cleanup_secure_connections_context ( )
inlineoverridevirtual

Cleans up SSL context indirectly from the last active network provider.

Implements Network_provider_management_interface.

◆ finalize()

bool Network_Management_Interface::finalize ( )
inlineoverridevirtual

Finalize the network manager.

It removes the default XCom provider,

Returns
true in case of error. false otherwise.

Implements Network_provider_management_interface.

◆ finalize_secure_connections_context()

void Network_Management_Interface::finalize_secure_connections_context ( )
inlineoverridevirtual

Destroys all things SSL related.

Implements Network_provider_management_interface.

◆ get_incoming_connections_protocol()

enum_transport_protocol Network_Management_Interface::get_incoming_connections_protocol ( ) const
inlineoverridevirtual

Get the incoming connections Communication Stack.

This is the value that is used to report upwards the protocol in * which we are currently accepting connections.

Returns
CommunicationStack

Implements Network_provider_management_interface.

◆ get_running_protocol()

enum_transport_protocol Network_Management_Interface::get_running_protocol ( ) const
inlineoverridevirtual

Gets the configured running protocol.

It returns the value that is currently configured in the Running Communication Stack

Since this value is dynamic, it can cause a mismatch from the provider that we are actively receiving connections and the provider that we use to establish new connections

Returns
CommunicationStack value.

Implements Network_provider_management_interface.

◆ initialize()

bool Network_Management_Interface::initialize ( )
inlineoverridevirtual

Initialize the network manager.

It also creates the default XCom provider and adds it to the manager.

Returns
true in case of error. false otherwise.

Implements Network_provider_management_interface.

◆ is_xcom_using_ssl()

int Network_Management_Interface::is_xcom_using_ssl ( ) const
inlineoverridevirtual

Return whether the SSL will be used to encrypt data or not.

Return 1 if it is enabled 0 otherwise.

Implements Network_provider_management_interface.

◆ operator=()

Network_Management_Interface & Network_Management_Interface::operator= ( Network_Management_Interface const &  )
delete

◆ remove_all_network_provider()

void Network_Management_Interface::remove_all_network_provider ( )
inlineoverridevirtual

◆ remove_network_provider()

void Network_Management_Interface::remove_network_provider ( enum_transport_protocol  provider_key)
inlineoverridevirtual

◆ set_running_protocol()

void Network_Management_Interface::set_running_protocol ( enum_transport_protocol  new_value)
inlineoverridevirtual

Sets the running Communication Stack, thus defining the active provider.

In runtime, this is will change the way we establish connections.

Parameters
new_valuevalue of the Communication Stack

Implements Network_provider_management_interface.

◆ start_active_network_provider()

bool Network_Management_Interface::start_active_network_provider ( )
inlineoverridevirtual

Start the active provider.

Returns
true In case of success.
false In case of failure.

Implements Network_provider_operations_interface.

◆ stop_active_network_provider()

bool Network_Management_Interface::stop_active_network_provider ( )
inlineoverridevirtual

Stops the active provider.

Returns
true In case of success.
false In case of failure.

Implements Network_provider_operations_interface.

◆ stop_all_network_providers()

bool Network_Management_Interface::stop_all_network_providers ( )
inlineoverridevirtual

Stops all network providers.

Returns
true In case of success stopping ALL network providers
false In case of failure in stopping AT LEAST ONE network provider

Implements Network_provider_operations_interface.

◆ xcom_get_ssl_fips_mode() [1/2]

int Network_Management_Interface::xcom_get_ssl_fips_mode ( )
inlineoverridevirtual

Returns the configured FIPS mode.

Implements Network_provider_management_interface.

◆ xcom_get_ssl_fips_mode() [2/2]

int Network_Management_Interface::xcom_get_ssl_fips_mode ( const char *  mode)
inlineoverridevirtual

Return the operation fips mode as an integer from an operation fips mode provided as a string.

Note that the string must be provided in upper case letters and the possible values are: "OFF", "ON", "STRICT",

If a different value is provide, INVALID_SSL_MODE (-1) is returned.

Implements Network_provider_management_interface.

◆ xcom_get_ssl_mode() [1/2]

int Network_Management_Interface::xcom_get_ssl_mode ( )
inlineoverridevirtual

Return the configured value into SSL mode.

Implements Network_provider_management_interface.

◆ xcom_get_ssl_mode() [2/2]

int Network_Management_Interface::xcom_get_ssl_mode ( const char *  mode)
inlineoverridevirtual

Return the operation mode as an integer from an operation mode provided as a string.

Note that the string must be provided in upper case letters and the possible values are: "DISABLED", "PREFERRED", "REQUIRED", "VERIFY_CA" or "VERIFY_IDENTITY".

If a different value is provide, INVALID_SSL_MODE (-1) is returned.

Implements Network_provider_management_interface.

◆ xcom_set_ssl_fips_mode()

int Network_Management_Interface::xcom_set_ssl_fips_mode ( int  mode)
inlineoverridevirtual

Set the operation fips mode which might be the following:

. SSL_FIPS_MODE_OFF (0): This will set openssl fips mode value to 0

. SSL_FIPS_MODE_ON (1): This will set openssl fips mode value to 1

. SSL_FIPS_MODE_STRICT (2): This will set openssl fips mode value to 2

If a different value is provide, INVALID_SSL_FIPS_MODE (-1) is returned.

Implements Network_provider_management_interface.

◆ xcom_set_ssl_mode()

int Network_Management_Interface::xcom_set_ssl_mode ( int  mode)
inlineoverridevirtual

Set the operation mode which might be the following:

. SSL_DISABLED (1): The SSL mode will be disabled and this is the default value.

. SSL_PREFERRED (2): The SSL mode will be always disabled if this value is provided and is only allowed to keep the solution compatibility with MySQL server.

. SSL_REQUIRED (4): The SSL mode will be enabled but the verifications described in the next modes are not performed.

. SSL_VERIFY_CA (4) - Verify the server TLS certificate against the configured Certificate Authority (CA) certificates. The connection attempt fails if no valid matching CA certificates are found.

. SSL_VERIFY_IDENTITY (5): Like VERIFY_CA, but additionally verify that the server certificate matches the host to which the connection is attempted.

If a different value is provide, INVALID_SSL_MODE (-1) is returned.

Implements Network_provider_management_interface.

Member Data Documentation

◆ m_get_manager

std::function<Network_provider_manager &()> Network_Management_Interface::m_get_manager
private

The documentation for this class was generated from the following file: