MySQL 9.1.0
Source Code Documentation
|
Keyring operations A class to perform operations on keyring. More...
#include <operations.h>
Public Member Functions | |
Keyring_operations (bool cache_data, Backend *backend) | |
Constructor. More... | |
~Keyring_operations ()=default | |
bool | insert (const meta::Metadata &metadata, Data_extension secret_data) |
Insert API to populate cache. More... | |
bool | get (const meta::Metadata &metadata, data::Data &data) |
Search API. More... | |
bool | get_data_extension (const meta::Metadata &metadata, Data_extension &data) |
Get Backend-specific data extension. More... | |
bool | store (const meta::Metadata &metadata, const data::Data &data) |
Store API. More... | |
bool | erase (const meta::Metadata &metadata) |
Remove API. More... | |
bool | generate (const meta::Metadata &metadata, const data::Type type, size_t length) |
Generate API. More... | |
bool | init_read_iterator (std::unique_ptr< iterator::Iterator< Data_extension > > &it, const meta::Metadata &metadata) |
Iterator creation for read. More... | |
bool | init_forward_iterator (std::unique_ptr< iterator::Iterator< Data_extension > > &it, bool cached) |
Iterator creation. More... | |
void | deinit_forward_iterator (std::unique_ptr< iterator::Iterator< Data_extension > > &it) |
Iterator destruction. More... | |
bool | is_valid (std::unique_ptr< iterator::Iterator< Data_extension > > &it) |
Check iterator validity. More... | |
bool | next (std::unique_ptr< iterator::Iterator< Data_extension > > &it) |
Move iterator forward. More... | |
bool | get_iterator_data (std::unique_ptr< iterator::Iterator< Data_extension > > &it, meta::Metadata &metadata, Data_extension &data) |
Get data from iterator. More... | |
bool | get_iterator_metadata (std::unique_ptr< iterator::Iterator< Data_extension > > &it, meta::Metadata &metadata, Data_extension &data) |
Get metadata from iterator. More... | |
size_t | maximum_data_length () const |
Maximum data length supported. More... | |
size_t | keyring_size () |
Keyring size. More... | |
bool | valid () |
Validity. More... | |
Private Member Functions | |
void | load_cache () |
Private Attributes | |
cache::Datacache< Data_extension > | cache_ |
Metadata cache. More... | |
bool | cache_data_ |
Flag to cache data. More... | |
std::unique_ptr< Backend > | backend_ |
Keyring backend. More... | |
bool | valid_ |
Validity. More... | |
Keyring operations A class to perform operations on keyring.
If cache is enabled, operations uses it. Otherwise, backend is used.
Assumptions:
Please see "How to write a new keyring component" for details about Backend class.
|
inlineexplicit |
Constructor.
[in] | cache_data | Whether to cache data or not |
[in] | backend | Pointer to keyring backend |
Populates the cache from backend
|
default |
|
inline |
Iterator destruction.
[in,out] | it | Forward iterator to metadata |
|
inline |
Remove API.
[in] | metadata | Key to the data |
false | Success - data removed OR does not exist |
true | Failure |
|
inline |
Generate API.
[in] | metadata | Key for the data |
[in] | type | Type of data |
[in] | length | Length of data to be generated |
false | Success - data generated and stored in backend |
true | Failure |
|
inline |
Search API.
[in] | metadata | Key to the data |
[out] | data | Fetched data |
false | Success - data contains required information |
true | Failure - data is not valid |
|
inline |
Get Backend-specific data extension.
[in] | metadata | Key to the data |
[out] | data | Fetched data extension |
false | Success - data contains required information |
true | Failure - data is not valid |
NOTE: get_data_extension NEVER returns data. It only returns Data extension information.
|
inline |
Get data from iterator.
[in] | it | Forward iterator to metadata |
[out] | metadata | Metadata for given key |
[out] | data | Data for given key (Including extension) |
false | Success |
true | Failure |
|
inline |
Get metadata from iterator.
[in] | it | Forward iterator to metadata |
[out] | metadata | Metadata for given key |
[out] | data | Extension for given key |
false | Success |
true | Failure |
|
inline |
Iterator creation.
[out] | it | Forward iterator to metadata |
[in] | cached | Iterator type |
false | Success |
true | Failure |
|
inline |
Iterator creation for read.
If data is cached, iterator on cached data is returned. Otherwise iterator created by backend is returned.
[out] | it | Forward iterator to metadata |
[in] | metadata | Metadata for the record to be searched |
false | Success |
true | Failure |
|
inline |
Insert API to populate cache.
[in] | metadata | Key to the data |
[in] | secret_data | Actual data |
false | Success |
true | Failure |
|
inline |
Check iterator validity.
[in] | it | Forward iterator to metadata |
true | Valid |
false | Invalid |
|
inline |
Keyring size.
|
inlineprivate |
|
inline |
Maximum data length supported.
|
inline |
Move iterator forward.
[in] | it | Forward iterator to metadata |
false | Success |
true | Failure |
|
inline |
Store API.
[in] | metadata | Key to the data |
[in] | data | Data to be stored |
false | Success - data stored |
true | Failure |
|
inline |
Validity.
|
private |
Keyring backend.
|
private |
Metadata cache.
|
private |
Flag to cache data.
|
private |
Validity.