]>
Commit | Line | Data |
---|---|---|
9f95a23c TL |
1 | |
2 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- | |
3 | // vim: ts=8 sw=2 smarttab ft=cpp | |
4 | ||
5 | /* | |
6 | * Ceph - scalable distributed file system | |
7 | * | |
8 | * Copyright (C) 2019 Red Hat, Inc. | |
9 | * | |
10 | * This is free software; you can redistribute it and/or | |
11 | * modify it under the terms of the GNU Lesser General Public | |
12 | * License version 2.1, as published by the Free Software | |
13 | * Foundation. See file COPYING. | |
14 | * | |
15 | */ | |
16 | ||
17 | ||
18 | #pragma once | |
19 | ||
20 | #include "cls/otp/cls_otp_types.h" | |
21 | ||
22 | #include "rgw/rgw_service.h" | |
23 | ||
24 | #include "svc_otp_types.h" | |
25 | #include "svc_meta_be_otp.h" | |
26 | ||
27 | class RGWSI_Zone; | |
28 | ||
29 | class RGWSI_OTP : public RGWServiceInstance | |
30 | { | |
31 | RGWSI_OTP_BE_Handler be_handler; | |
32 | std::unique_ptr<RGWSI_MetaBackend::Module> be_module; | |
33 | ||
b3b6e05e | 34 | int do_start(optional_yield, const DoutPrefixProvider *dpp) override; |
9f95a23c TL |
35 | |
36 | public: | |
37 | struct Svc { | |
38 | RGWSI_OTP *otp{nullptr}; | |
39 | RGWSI_Zone *zone{nullptr}; | |
40 | RGWSI_Meta *meta{nullptr}; | |
41 | RGWSI_MetaBackend *meta_be{nullptr}; | |
42 | } svc; | |
43 | ||
44 | RGWSI_OTP(CephContext *cct); | |
45 | ~RGWSI_OTP(); | |
46 | ||
47 | RGWSI_OTP_BE_Handler& get_be_handler() { | |
48 | return be_handler; | |
49 | } | |
50 | ||
51 | void init(RGWSI_Zone *_zone_svc, | |
52 | RGWSI_Meta *_meta_svc, | |
53 | RGWSI_MetaBackend *_meta_be_svc); | |
54 | ||
55 | int read_all(RGWSI_OTP_BE_Ctx& ctx, | |
56 | const string& key, | |
57 | otp_devices_list_t *devices, | |
58 | real_time *pmtime, | |
59 | RGWObjVersionTracker *objv_tracker, | |
b3b6e05e TL |
60 | optional_yield y, |
61 | const DoutPrefixProvider *dpp); | |
9f95a23c TL |
62 | int read_all(RGWSI_OTP_BE_Ctx& ctx, |
63 | const rgw_user& uid, | |
64 | otp_devices_list_t *devices, | |
65 | real_time *pmtime, | |
66 | RGWObjVersionTracker *objv_tracker, | |
b3b6e05e TL |
67 | optional_yield y, |
68 | const DoutPrefixProvider *dpp); | |
69 | int store_all(const DoutPrefixProvider *dpp, | |
70 | RGWSI_OTP_BE_Ctx& ctx, | |
9f95a23c TL |
71 | const string& key, |
72 | const otp_devices_list_t& devices, | |
73 | real_time mtime, | |
74 | RGWObjVersionTracker *objv_tracker, | |
75 | optional_yield y); | |
b3b6e05e TL |
76 | int store_all(const DoutPrefixProvider *dpp, |
77 | RGWSI_OTP_BE_Ctx& ctx, | |
9f95a23c TL |
78 | const rgw_user& uid, |
79 | const otp_devices_list_t& devices, | |
80 | real_time mtime, | |
81 | RGWObjVersionTracker *objv_tracker, | |
82 | optional_yield y); | |
b3b6e05e TL |
83 | int remove_all(const DoutPrefixProvider *dpp, |
84 | RGWSI_OTP_BE_Ctx& ctx, | |
9f95a23c TL |
85 | const string& key, |
86 | RGWObjVersionTracker *objv_tracker, | |
87 | optional_yield y); | |
b3b6e05e TL |
88 | int remove_all(const DoutPrefixProvider *dpp, |
89 | RGWSI_OTP_BE_Ctx& ctx, | |
9f95a23c TL |
90 | const rgw_user& uid, |
91 | RGWObjVersionTracker *objv_tracker, | |
92 | optional_yield y); | |
93 | }; | |
94 | ||
95 |