Mercurial > hg > orthanc-object-storage
annotate Google/GoogleStoragePlugin.h @ 56:b922ae86bbe1
full static linking against AWS SDK
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 22 Jun 2021 15:00:36 +0200 |
parents | f55b2afdf53d |
children | 16e419fe80c5 |
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 | |
56
b922ae86bbe1
full static linking against AWS SDK
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
37
diff
changeset
|
19 |
1 | 20 #pragma once |
21 | |
15 | 22 #include "../Common/BaseStoragePlugin.h" |
1 | 23 |
24 #include "google/cloud/storage/client.h" | |
25 | |
26 class GoogleStoragePluginFactory | |
27 { | |
28 public: | |
29 static const char* GetStoragePluginName(); | |
30 static IStoragePlugin* CreateStoragePlugin(const OrthancPlugins::OrthancConfiguration& orthancConfig); | |
31 }; | |
32 | |
33 | |
15 | 34 class GoogleStoragePlugin : public BaseStoragePlugin |
1 | 35 { |
36 public: | |
37 | |
38 std::string bucketName_; | |
39 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.) | |
40 | |
41 public: | |
42 | |
43 GoogleStoragePlugin(const std::string& bucketName, | |
15 | 44 google::cloud::storage::Client& mainClient, |
45 bool enableLegacyStorageStructure | |
1 | 46 ); |
47 | |
48 virtual IWriter* GetWriterForObject(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled); | |
49 virtual IReader* GetReaderForObject(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled); | |
50 virtual void DeleteObject(const char* uuid, OrthancPluginContentType type, bool encryptionEnabled); | |
15 | 51 virtual const char* GetConfigurationSectionName(); |
1 | 52 }; |