MySQL 8.4.2
Source Code Documentation
Migrate_keyring Class Reference

#include <migrate_keyring.h>

Public Member Functions

 Migrate_keyring ()
 Standard constructor. More...
 
bool init (int argc, char **argv, char *source_plugin, char *destination_plugin, char *user, char *host, char *password, char *socket, ulong port, bool migrate_to_component, bool migrate_from_component)
 Initialize all needed parameters to proceed with migration process. More...
 
bool execute ()
 Migrate keys from source keyring to destination keyring. More...
 
 ~Migrate_keyring ()
 Standard destructor. More...
 

Private Member Functions

bool load_plugin (enum_plugin_type plugin_type)
 Load source or destination plugin. More...
 
bool load_component ()
 Load component. More...
 
bool fetch_and_store_keys ()
 Fetch keys from source plugin and store in destination plugin. More...
 
bool disable_keyring_operations ()
 Disable @keyring_operations variable. More...
 
bool enable_keyring_operations ()
 Enable @keyring_operations variable. More...
 

Private Attributes

int m_argc
 
char ** m_argv
 
std::string m_source_plugin_option
 
std::string m_destination_plugin_option
 
std::string m_source_plugin_name
 
std::string m_destination_plugin_name
 
std::string m_internal_option [2]
 
st_mysql_keyringm_source_plugin_handle
 
st_mysql_keyringm_destination_plugin_handle
 
std::vector< Key_infom_source_keys
 
MYSQLmysql
 
NET_SERVER server_extn
 
bool m_migrate_to_component
 
bool m_migrate_from_component
 
Source_keyring_componentm_source_component
 
Destination_keyring_componentm_destination_component
 

Constructor & Destructor Documentation

◆ Migrate_keyring()

Migrate_keyring::Migrate_keyring ( )

Standard constructor.

◆ ~Migrate_keyring()

Migrate_keyring::~Migrate_keyring ( )

Standard destructor.

Standard destructor to close connection handle.

Member Function Documentation

◆ disable_keyring_operations()

bool Migrate_keyring::disable_keyring_operations ( )
private

Disable @keyring_operations variable.

Disable variable @keyring_operations.

Returns
0 Success
1 Failure

◆ enable_keyring_operations()

bool Migrate_keyring::enable_keyring_operations ( )
private

Enable @keyring_operations variable.

Enable variable @keyring_operations.

Returns
0 Success
1 Failure

◆ execute()

bool Migrate_keyring::execute ( )

Migrate keys from source keyring to destination keyring.

This function does the following in sequence:

  1. Disable access to keyring service APIs.
  2. Load source plugin.
  3. Load destination plugin.
  4. Fetch all keys from source plugin and upon success store in destination plugin.
  5. Enable access to keyring service APIs.
  6. Unload source plugin.
  7. Unload destination plugin.

NOTE: In case there is any error while fetching keys from source plugin, this function would remove all keys stored as part of fetch.

Returns
0 Success
1 Failure

◆ fetch_and_store_keys()

bool Migrate_keyring::fetch_and_store_keys ( )
private

Fetch keys from source plugin and store in destination plugin.

This function does the following in sequence:

  1. Initialize key iterator which will make iterator to position itself inorder to fetch a key.
  2. Using iterator get key ID and user name.
  3. Fetch the key information using key ID and user name.
  4. Store the fetched key into destination plugin.
  5. In case of errors remove keys from destination plugin.
Returns
0 Success
1 Failure

◆ init()

bool Migrate_keyring::init ( int  argc,
char **  argv,
char *  source_plugin,
char *  destination_plugin,
char *  user,
char *  host,
char *  password,
char *  socket,
ulong  port,
bool  migrate_to_component,
bool  migrate_from_component 
)

Initialize all needed parameters to proceed with migration process.

This function does the following:

  1. Read command line arguments specific to migration operation
  2. Get plugin_dir value.
  3. Get a connection handle by connecting to server.
Parameters
[in]argcPointer to argc of original program
[in]argvPointer to argv of original program
[in]source_pluginPointer to source plugin option
[in]destination_pluginPointer to destination plugin option
[in]userUser to login to server
[in]hostHost on which to connect to server
[in]passwordPassword used to connect to server
[in]socketThe socket file to use for connection
[in]portPort number to use for connection
[in]migrate_to_componentMigrate from plugin to component destination component
[in]migrate_from_componentMigrate from component to plugin
Returns
0 Success
1 Failure

◆ load_component()

bool Migrate_keyring::load_component ( )
private

Load component.

Returns
false Success
true Failure

◆ load_plugin()

bool Migrate_keyring::load_plugin ( enum_plugin_type  plugin_type)
private

Load source or destination plugin.

Load plugin.

Parameters
[in]plugin_typeIndicates what plugin to be loaded
Returns
0 Success
1 Failure

Member Data Documentation

◆ m_argc

int Migrate_keyring::m_argc
private

◆ m_argv

char** Migrate_keyring::m_argv
private

◆ m_destination_component

Destination_keyring_component* Migrate_keyring::m_destination_component
private

◆ m_destination_plugin_handle

st_mysql_keyring* Migrate_keyring::m_destination_plugin_handle
private

◆ m_destination_plugin_name

std::string Migrate_keyring::m_destination_plugin_name
private

◆ m_destination_plugin_option

std::string Migrate_keyring::m_destination_plugin_option
private

◆ m_internal_option

std::string Migrate_keyring::m_internal_option[2]
private

◆ m_migrate_from_component

bool Migrate_keyring::m_migrate_from_component
private

◆ m_migrate_to_component

bool Migrate_keyring::m_migrate_to_component
private

◆ m_source_component

Source_keyring_component* Migrate_keyring::m_source_component
private

◆ m_source_keys

std::vector<Key_info> Migrate_keyring::m_source_keys
private

◆ m_source_plugin_handle

st_mysql_keyring* Migrate_keyring::m_source_plugin_handle
private

◆ m_source_plugin_name

std::string Migrate_keyring::m_source_plugin_name
private

◆ m_source_plugin_option

std::string Migrate_keyring::m_source_plugin_option
private

◆ mysql

MYSQL* Migrate_keyring::mysql
private

◆ server_extn

NET_SERVER Migrate_keyring::server_extn
private

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