MySQL 8.3.0
Source Code Documentation
keyring_metadata_query_service_definition.h
Go to the documentation of this file.
1/* Copyright (c) 2021, 2023, 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 also distributed 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 included with MySQL.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License, version 2.0, for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef KEYRING_METADATA_QUERY_SERVICE_IMPL_INCLUDED
24#define KEYRING_METADATA_QUERY_SERVICE_IMPL_INCLUDED
25
28
30
31namespace keyring_common {
32namespace service_definition {
33
35 public:
36 /** Returns status of the keyring component */
38 /**
39 Initialize metadata iterator
40
41 @param [out] metadata_iterator Metadata iterator handle
42
43 @returns Status of iterator initialization
44 @retval false Success
45 @retval true Failure
46 */
48 metadata_iterator));
49
50 /**
51 Deinitialize metadata iterator
52
53 @param [in, out] metadata_iterator Metadata iterator handle
54
55 @returns Status of iterator deinitialization
56 @retval false Success
57 @retval true Failure
58 */
59 static DEFINE_BOOL_METHOD(
61
62 /**
63 Check validity of iterator
64
65 @param [in] metadata_iterator Metadata iterator handle
66
67 @returns Validity of the the iterator
68 @retval true Iterator valid
69 @retval false Iterator invalid
70 */
71 static DEFINE_BOOL_METHOD(
73
74 /**
75 Move iterator forward
76
77 @param [in, out] metadata_iterator Metadata iterator handle
78
79 @returns Status of operation
80 @retval false Success
81 @retval true Failure
82 */
83 static DEFINE_BOOL_METHOD(
85
86 /**
87 Get length information about metadata key and value
88
89 @param [in] metadata_iterator Metadata iterator handle
90 @param [out] key_buffer_length Length of the key buffer
91 @param [out] value_buffer_length Length of the value buffer
92
93 @returns Get length information about key and value
94 @retval false Success check out parameters
95 @retval true Failure
96 */
97 static DEFINE_BOOL_METHOD(
99 size_t *key_buffer_length, size_t *value_buffer_length));
100
101 /**
102 Get name and value of metadata at current position
103
104 @param [in] metadata_iterator Metadata iterator handle
105 @param [out] key_buffer Output buffer for key
106 @param [in] key_buffer_length Length of key buffer
107 @param [out] value_buffer Output buffer for value
108 @param [in] value_buffer_length Length of value buffer
109
110 @returns Status of fetch operation
111 @retval false Success
112 @retval true Failure
113 */
114 static DEFINE_BOOL_METHOD(
116 char *key_buffer, size_t key_buffer_length, char *value_buffer,
117 size_t value_buffer_length));
118};
119
120} // namespace service_definition
121} // namespace keyring_common
122
123#define KEYRING_COMPONENT_STATUS_IMPLEMENTOR(component_name) \
124 BEGIN_SERVICE_IMPLEMENTATION(component_name, keyring_component_status) \
125 keyring_common::service_definition::Keyring_metadata_query_service_impl:: \
126 is_initialized \
127 END_SERVICE_IMPLEMENTATION()
128
129#define KEYRING_COMPONENT_METADATA_QUERY_IMPLEMENTOR(component_name) \
130 BEGIN_SERVICE_IMPLEMENTATION(component_name, \
131 keyring_component_metadata_query) \
132 keyring_common::service_definition::Keyring_metadata_query_service_impl:: \
133 init, \
134 keyring_common::service_definition:: \
135 Keyring_metadata_query_service_impl::deinit, \
136 keyring_common::service_definition:: \
137 Keyring_metadata_query_service_impl::is_valid, \
138 keyring_common::service_definition:: \
139 Keyring_metadata_query_service_impl::next, \
140 keyring_common::service_definition:: \
141 Keyring_metadata_query_service_impl::get_length, \
142 keyring_common::service_definition:: \
143 Keyring_metadata_query_service_impl::get \
144 END_SERVICE_IMPLEMENTATION()
145
146#endif // KEYRING_METADATA_QUERY_SERVICE_IMPL_INCLUDED
Definition: keyring_metadata_query_service_definition.h:34
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:64
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:82
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:104
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:50
static mysql_service_status_t is_initialized() noexcept
Returns status of the keyring component.
Definition: keyring_metadata_query_service_definition.cc:43
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:92
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:72
Specifies macros to define Components.
struct my_h_keyring_component_metadata_iterator_imp * my_h_keyring_component_metadata_iterator
Definition: keyring_metadata_query.h:28
Definition: keyring_encryption_service_definition.h:31
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:87