Mercurial > hg > orthanc-object-storage
annotate Google/GoogleStoragePlugin.h @ 37:f55b2afdf53d
upgrade to year 2021
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 06 Jan 2021 18:27:54 +0100 |
parents | 2a02b21f0a19 |
children | b922ae86bbe1 |
rev | line source |
---|---|
1 | 1 /** |
2 * Cloud storage plugins for Orthanc | |
37
f55b2afdf53d
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
15
diff
changeset
|
3 * Copyright (C) 2020-2021 Osimis S.A., Belgium |
1 | 4 * |
5 * This program is free software: you can redistribute it and/or | |
6 * modify it under the terms of the GNU Affero General Public License | |
7 * as published by the Free Software Foundation, either version 3 of | |
8 * the License, or (at your option) any later version. | |
9 * | |
10 * This program is distributed in the hope that it will be useful, but | |
11 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 * Affero General Public License for more details. | |
14 * | |
15 * You should have received a copy of the GNU Affero General Public License | |
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
17 **/ | |
18 | |
19 #pragma once | |
20 | |
15 | 21 #include "../Common/BaseStoragePlugin.h" |
1 | 22 |
23 #include "google/cloud/storage/client.h" | |
24 | |
25 class GoogleStoragePluginFactory | |
26 { | |
27 public: | |
28 static const char* GetStoragePluginName(); | |
29 static IStoragePlugin* CreateStoragePlugin(const OrthancPlugins::OrthancConfiguration& orthancConfig); | |
30 }; | |
31 | |
32 | |
15 | 33 class GoogleStoragePlugin : public BaseStoragePlugin |
1 | 34 { |
35 public: | |
36 | |
37 std::string bucketName_; | |
38 google::cloud::storage::Client mainClient_; // the client that is created at startup. Each thread should copy it when it needs it. (from the doc: Instances of this class created via copy-construction or copy-assignment share the underlying pool of connections. Access to these copies via multiple threads is guaranteed to work. Two threads operating on the same instance of this class is not guaranteed to work.) | |
39 | |
40 public: | |
41 | |
42 GoogleStoragePlugin(const std::string& bucketName, | |
15 | 43 google::cloud::storage::Client& mainClient, |
44 bool enableLegacyStorageStructure | |
1 | 45 ); |
46 | |
47 virtual IWriter* GetWriterForObject(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled); | |
48 virtual IReader* GetReaderForObject(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled); | |
49 virtual void DeleteObject(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled); | |
15 | 50 virtual const char* GetConfigurationSectionName(); |
1 | 51 }; |