summaryrefslogtreecommitdiffstats
path: root/src/rgw/services/svc_role.h
blob: c33da97c1b842671ab10541b2909b393ffbf07a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp

/*
 * Ceph - scalable distributed file system
 *
 * Copyright (C) 2020 SUSE LLC
 *
 * This is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License version 2.1, as published by the Free Software
 * Foundation. See file COPYING.
 *
 */

#pragma once

#include "rgw/rgw_service.h"
#include "rgw/rgw_role.h"
#include "svc_meta_be.h"

class RGWSI_Role: public RGWServiceInstance
{
 public:
  RGWSI_Role(CephContext *cct) : RGWServiceInstance(cct) {}
  virtual ~RGWSI_Role() {}

  virtual RGWSI_MetaBackend_Handler* get_be_handler() = 0;
  static std::string get_role_meta_key(const std::string& role_id);
  static std::string get_role_name_meta_key(const std::string& role_name, const std::string& tenant);
  static std::string get_role_path_meta_key(const std::string& path, const std::string& role_id, const std::string& tenant);

  virtual int store_info(RGWSI_MetaBackend::Context *ctx,
			 const rgw::sal::RGWRole& role,
			 RGWObjVersionTracker * const objv_tracker,
			 const real_time& mtime,
			 bool exclusive,
			 std::map<std::string, bufferlist> * pattrs,
			 optional_yield y,
             const DoutPrefixProvider *dpp) = 0;

  virtual int store_name(RGWSI_MetaBackend::Context *ctx,
			 const std::string& role_id,
			 const std::string& name,
			 const std::string& tenant,
			 RGWObjVersionTracker * const objv_tracker,
			 const real_time& mtime,
			 bool exclusive,
			 optional_yield y,
             const DoutPrefixProvider *dpp) = 0;

  virtual int store_path(RGWSI_MetaBackend::Context *ctx,
			 const std::string& role_id,
			 const std::string& path,
			 const std::string& tenant,
			 RGWObjVersionTracker * const objv_tracker,
			 const real_time &mtime,
			 bool exclusive,
			 optional_yield y,
             const DoutPrefixProvider *dpp) = 0;

  virtual int read_info(RGWSI_MetaBackend::Context *ctx,
			const std::string& role_id,
			rgw::sal::RGWRole *role,
			RGWObjVersionTracker * const objv_tracker,
			real_time * const pmtime,
			std::map<std::string, bufferlist> * pattrs,
			optional_yield y,
            const DoutPrefixProvider *dpp) = 0;

  virtual int read_name(RGWSI_MetaBackend::Context *ctx,
			const std::string& name,
			const std::string& tenant,
			std::string& role_id,
			RGWObjVersionTracker * const objv_tracker,
			real_time * const pmtime,
			optional_yield y,
            const DoutPrefixProvider *dpp) = 0;

  virtual int read_path(RGWSI_MetaBackend::Context *ctx,
			std::string& path,
			RGWObjVersionTracker * const objv_tracker,
			real_time * const pmtime,
			optional_yield y,
            const DoutPrefixProvider *dpp) = 0;

  virtual int delete_info(RGWSI_MetaBackend::Context *ctx,
			  const std::string& name,
			  RGWObjVersionTracker * const objv_tracker,
			  optional_yield y,
			  const DoutPrefixProvider *dpp) = 0;

  virtual int delete_name(RGWSI_MetaBackend::Context *ctx,
			  const std::string& name,
			  const std::string& tenant,
			  RGWObjVersionTracker * const objv_tracker,
			  optional_yield y,
			  const DoutPrefixProvider *dpp) = 0;

  virtual int delete_path(RGWSI_MetaBackend::Context *ctx,
			  const std::string& role_id,
			  const std::string& path,
			  const std::string& tenant,
			  RGWObjVersionTracker * const objv_tracker,
			  optional_yield y,
			  const DoutPrefixProvider *dpp) = 0;

};