MySQL 9.1.0
Source Code Documentation
event_tracking_general_service.h
Go to the documentation of this file.
1/* Copyright (c) 2022, 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 MYSQL_COMPONENTS_SERVICES_EVENT_TRACKING_GENERAL_SERVICE_H
25#define MYSQL_COMPONENTS_SERVICES_EVENT_TRACKING_GENERAL_SERVICE_H
26
29
30/**
31 @file mysql/components/services/event_tracking_general_service.h
32 General event tracking.
33
34 @sa @ref EVENT_TRACKING_GENERAL_CONSUMER_EXAMPLE
35*/
36
37/** A handle to obtain details related to general event */
39
40/**
41 @ingroup event_tracking_services_inventory
42
43 @anchor EVENT_TRACKING_GENERAL_SERVICE
44
45 A service to track and consume general events.
46
47 Producer of the event will broadcast notify all interested
48 consumers of the event.
49
50 @sa @ref EVENT_TRACKING_GENERAL_CONSUMER_EXAMPLE
51*/
52
53BEGIN_SERVICE_DEFINITION(event_tracking_general)
54
55/**
56 Process a general event
57
58 @param [in] data Event specific data
59
60 @returns Status of processing the event
61 @retval false Success
62 @retval true Error
63*/
65
66END_SERVICE_DEFINITION(event_tracking_general)
67
68/**
69 @ingroup event_tracking_services_inventory
70
71 @anchor EVENT_TRACKING_GENERAL_INFORMATION
72
73 A service to fetch additional data about authentication event
74*/
75
76BEGIN_SERVICE_DEFINITION(event_tracking_general_information)
77
78/**
79 Initialize authentication event data handle
80
81 @param [out] handle Handle to authentication event data
82
83 @returns Status of handle creation
84 @retval false Success
85 @retval true Error
86*/
88
89/**
90 Deinitialize authentication event data handle
91
92 @param [in, out] handle Handle to be deinitialized
93
94 @returns Status of operation
95 @retval false Success
96 @retval true Error
97*/
99
100/**
101 Get information about given authentication event
102
103 Accepted names and corresponding value type
104
105 "external_user" -> mysql_cstring_with_length
106 "time" -> uint64_t
107 "rows" -> uint64_t
108
109 @param [in] handle Event tracking information handle
110 @param [in] name Data identifier
111 @param [out] value Value of the identifier
112
113 @returns status of the operation
114 @retval false Success
115 @retval true Error
116*/
118 const char *name, void *value));
119
120END_SERVICE_DEFINITION(event_tracking_general_information)
121
122#endif // !MYSQL_COMPONENTS_SERVICES_EVENT_TRACKING_GENERAL_SERVICE_H
static mysql_service_status_t deinit()
Component deinitialization.
Definition: audit_api_message_emit.cc:580
static mysql_service_status_t init()
Component initialization.
Definition: audit_api_message_emit.cc:571
Data for general event tracking.
struct event_tracking_general_information_handle_imp * event_tracking_general_information_handle
A handle to obtain details related to general event.
Definition: event_tracking_general_service.h:38
static mysql_service_status_t get(THD **thd) noexcept
Definition: mysql_current_thread_reader_all_empty.cc:31
static int handle(int sql_errno, const char *sqlstate, const char *message, void *state)
Bridge function between the C++ API offered by this module and the C API of the parser service.
Definition: services.cc:64
static bool notify(SvcTypes svc_type, Notification_context &ctx)
Auxiliary function to engage the service registry to notify a set of listeners.
Definition: notification.cc:87
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:91
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:86
#define DEFINE_SERVICE_HANDLE(name)
Defines an object type that is meant for carrying handles to the implementation-specific objects used...
Definition: service.h:129
#define DECLARE_BOOL_METHOD(name, args)
Declares a method that returns bool as a part of the Service definition.
Definition: service.h:112
case opt name
Definition: sslopt-case.h:29
Structure for General event tracking.
Definition: event_tracking_general_defs.h:59