MySQL 9.3.0
Source Code Documentation
handler_string.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2021, 2025, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is designed to work with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 */
25
26#ifndef ROUTER_SRC_MYSQL_REST_SERVICE_SRC_MRS_ENDPOINT_HANDLER_HANDLER_STRING_H_
27#define ROUTER_SRC_MYSQL_REST_SERVICE_SRC_MRS_ENDPOINT_HANDLER_HANDLER_STRING_H_
28
30#include "mrs/rest/handler.h"
31
32namespace mrs {
33namespace endpoint {
34namespace handler {
35
37 public:
38 HandlerString(const Protocol protocol, const UniversalId &service_id,
39 const std::string &service_path, bool requires_authentication,
40 const std::string &path, const std::string &file_name,
41 const std::string &file_content, const bool is_index,
43
44 UniversalId get_service_id() const override;
45 UniversalId get_db_object_id() const override;
46 UniversalId get_schema_id() const override;
47 const std::string &get_service_path() const override;
48 const std::string &get_schema_path() const override;
49 const std::string &get_db_object_path() const override;
50
51 uint32_t get_access_rights() const override;
53
54 void authorization(rest::RequestContext *ctxt) override;
55
59 const std::vector<uint8_t> &document) override;
61
62 private:
65 std::string service_path_;
67 std::string path_;
68 std::string file_name_;
69 std::string file_content_;
70};
71
72} // namespace handler
73} // namespace endpoint
74} // namespace mrs
75
76#endif // ROUTER_SRC_MYSQL_REST_SERVICE_SRC_MRS_ENDPOINT_HANDLER_HANDLER_STRING_H_
Definition: protocol.h:33
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4618
Definition: handler_string.h:36
UniversalId get_db_object_id() const override
Definition: handler_string.cc:89
HttpResult handle_put(rest::RequestContext *ctxt) override
Definition: handler_string.cc:127
HttpResult handle_get(rest::RequestContext *ctxt) override
Definition: handler_string.cc:114
std::string service_path_
Definition: handler_string.h:65
std::string file_name_
Definition: handler_string.h:68
HandlerString(const Protocol protocol, const UniversalId &service_id, const std::string &service_path, bool requires_authentication, const std::string &path, const std::string &file_name, const std::string &file_content, const bool is_index, mrs::interface::AuthorizeManager *auth_manager)
Definition: handler_string.cc:55
HttpResult handle_delete(rest::RequestContext *ctxt) override
Definition: handler_string.cc:118
const std::string & get_service_path() const override
Definition: handler_string.cc:91
const std::string & get_schema_path() const override
Definition: handler_string.cc:95
const std::string & get_db_object_path() const override
Definition: handler_string.cc:99
UniversalId get_service_id() const override
Definition: handler_string.cc:85
UniversalId service_id_
Definition: handler_string.h:64
HttpResult handle_post(rest::RequestContext *ctxt, const std::vector< uint8_t > &document) override
Definition: handler_string.cc:122
uint32_t get_access_rights() const override
Definition: handler_string.cc:108
void authorization(rest::RequestContext *ctxt) override
Definition: handler_string.cc:112
std::string path_
Definition: handler_string.h:67
bool requires_authentication_
Definition: handler_string.h:66
Authorization requires_authentication() const override
Definition: handler_string.cc:103
std::string file_content_
Definition: handler_string.h:69
mrs::interface::RestHandler::HttpResult::Type type_
Definition: handler_string.h:63
UniversalId get_schema_id() const override
Definition: handler_string.cc:87
Definition: authorize_manager.h:58
Authorization
Definition: rest_handler.h:142
Definition: handler.h:42
static char * path
Definition: mysqldump.cc:150
MediaType
Definition: media_type.h:33
std::string file_name(Log_file_id file_id)
Provides name of the log file with the given file id, e.g.
Definition: log0pre_8_0_30.cc:94
ContentFileEndpoint::UniversalId UniversalId
Definition: content_file_endpoint.cc:39
Definition: authorize_manager.h:48
Definition: http_result.h:37
Definition: request_context.h:47