MySQL 8.0.39
Source Code Documentation
keyring_metadata_query_service_definition.h
Go to the documentation of this file.
1/* Copyright (c) 2021, 2024, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef KEYRING_METADATA_QUERY_SERVICE_IMPL_INCLUDED
25#define KEYRING_METADATA_QUERY_SERVICE_IMPL_INCLUDED
26
29
31
32namespace keyring_common {
33namespace service_definition {
34
36 public:
37 /** Returns status of the keyring component */
39 /**
40 Initialize metadata iterator
41
42 @param [out] metadata_iterator Metadata iterator handle
43
44 @returns Status of iterator initialization
45 @retval false Success
46 @retval true Failure
47 */
49 metadata_iterator));
50
51 /**
52 Deinitialize metadata iterator
53
54 @param [in, out] metadata_iterator Metadata iterator handle
55
56 @returns Status of iterator deinitialization
57 @retval false Success
58 @retval true Failure
59 */
60 static DEFINE_BOOL_METHOD(
62
63 /**
64 Check validity of iterator
65
66 @param [in] metadata_iterator Metadata iterator handle
67
68 @returns Validity of the the iterator
69 @retval true Iterator valid
70 @retval false Iterator invalid
71 */
72 static DEFINE_BOOL_METHOD(
74
75 /**
76 Move iterator forward
77
78 @param [in, out] metadata_iterator Metadata iterator handle
79
80 @returns Status of operation
81 @retval false Success
82 @retval true Failure
83 */
84 static DEFINE_BOOL_METHOD(
86
87 /**
88 Get length information about metadata key and value
89
90 @param [in] metadata_iterator Metadata iterator handle
91 @param [out] key_buffer_length Length of the key buffer
92 @param [out] value_buffer_length Length of the value buffer
93
94 @returns Get length information about key and value
95 @retval false Success check out parameters
96 @retval true Failure
97 */
98 static DEFINE_BOOL_METHOD(
100 size_t *key_buffer_length, size_t *value_buffer_length));
101
102 /**
103 Get name and value of metadata at current position
104
105 @param [in] metadata_iterator Metadata iterator handle
106 @param [out] key_buffer Output buffer for key
107 @param [in] key_buffer_length Length of key buffer
108 @param [out] value_buffer Output buffer for value
109 @param [in] value_buffer_length Length of value buffer
110
111 @returns Status of fetch operation
112 @retval false Success
113 @retval true Failure
114 */
115 static DEFINE_BOOL_METHOD(
117 char *key_buffer, size_t key_buffer_length, char *value_buffer,
118 size_t value_buffer_length));
119};
120
121} // namespace service_definition
122} // namespace keyring_common
123
124#define KEYRING_COMPONENT_STATUS_IMPLEMENTOR(component_name) \
125 BEGIN_SERVICE_IMPLEMENTATION(component_name, keyring_component_status) \
126 keyring_common::service_definition::Keyring_metadata_query_service_impl:: \
127 is_initialized \
128 END_SERVICE_IMPLEMENTATION()
129
130#define KEYRING_COMPONENT_METADATA_QUERY_IMPLEMENTOR(component_name) \
131 BEGIN_SERVICE_IMPLEMENTATION(component_name, \
132 keyring_component_metadata_query) \
133 keyring_common::service_definition::Keyring_metadata_query_service_impl:: \
134 init, \
135 keyring_common::service_definition:: \
136 Keyring_metadata_query_service_impl::deinit, \
137 keyring_common::service_definition:: \
138 Keyring_metadata_query_service_impl::is_valid, \
139 keyring_common::service_definition:: \
140 Keyring_metadata_query_service_impl::next, \
141 keyring_common::service_definition:: \
142 Keyring_metadata_query_service_impl::get_length, \
143 keyring_common::service_definition:: \
144 Keyring_metadata_query_service_impl::get \
145 END_SERVICE_IMPLEMENTATION()
146
147#endif // KEYRING_METADATA_QUERY_SERVICE_IMPL_INCLUDED
Definition: keyring_metadata_query_service_definition.h:35
static mysql_service_status_t deinit(my_h_keyring_component_metadata_iterator metadata_iterator) noexcept
Deinitialize metadata iterator.
Definition: keyring_metadata_query_service_definition.cc:65
static mysql_service_status_t next(my_h_keyring_component_metadata_iterator metadata_iterator) noexcept
Move iterator forward.
Definition: keyring_metadata_query_service_definition.cc:83
static mysql_service_status_t get(my_h_keyring_component_metadata_iterator metadata_iterator, char *key_buffer, size_t key_buffer_length, char *value_buffer, size_t value_buffer_length) noexcept
Get name and value of metadata at current position.
Definition: keyring_metadata_query_service_definition.cc:105
static mysql_service_status_t init(my_h_keyring_component_metadata_iterator *metadata_iterator) noexcept
Initialize metadata iterator.
Definition: keyring_metadata_query_service_definition.cc:51
static mysql_service_status_t is_initialized() noexcept
Returns status of the keyring component.
Definition: keyring_metadata_query_service_definition.cc:44
static mysql_service_status_t get_length(my_h_keyring_component_metadata_iterator metadata_iterator, size_t *key_buffer_length, size_t *value_buffer_length) noexcept
Get length information about metadata key and value.
Definition: keyring_metadata_query_service_definition.cc:93
static mysql_service_status_t is_valid(my_h_keyring_component_metadata_iterator metadata_iterator) noexcept
Check validity of iterator.
Definition: keyring_metadata_query_service_definition.cc:73
Specifies macros to define Components.
struct my_h_keyring_component_metadata_iterator_imp * my_h_keyring_component_metadata_iterator
Definition: keyring_metadata_query.h:29
Definition: keyring_encryption_service_definition.h:32
Specifies macros to define Service Implementations.
#define DEFINE_BOOL_METHOD(name, args)
A short macro to define method that returns bool, which is the most common case.
Definition: service_implementation.h:88