Mercurial > hg > orthanc-object-storage
annotate Common/MoveStorageJob.h @ 113:78c075412ab4
more config for S3 transfer mode
author | Alain Mazy <am@osimis.io> |
---|---|
date | Tue, 17 Oct 2023 13:01:04 +0200 |
parents | 8a9207933297 |
children | 3c7e0374f28e |
rev | line source |
---|---|
83
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
1 /** |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
2 * Cloud storage plugins for Orthanc |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
3 * Copyright (C) 2020-2021 Osimis S.A., Belgium |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
4 * |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
5 * This program is free software: you can redistribute it and/or |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
6 * modify it under the terms of the GNU Affero General Public License |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
7 * as published by the Free Software Foundation, either version 3 of |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
8 * the License, or (at your option) any later version. |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
9 * |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
10 * This program is distributed in the hope that it will be useful, but |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
11 * WITHOUT ANY WARRANTY; without even the implied warranty of |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
13 * Affero General Public License for more details. |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
14 * |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU Affero General Public License |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
17 **/ |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
18 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
19 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
20 #pragma once |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
21 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
22 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
23 #include <orthanc/OrthancCPlugin.h> |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
24 #include <OrthancPluginCppWrapper.h> |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
25 #include <json/json.h> |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
26 #include "IStorage.h" |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
27 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
28 #include <vector> |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
29 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
30 class MoveStorageJob : public OrthancPlugins::OrthancJob |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
31 { |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
32 std::string targetStorage_; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
33 std::vector<std::string> instances_; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
34 size_t processedInstancesCount_; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
35 Json::Value resourceForJobContent_; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
36 IStorage* fileSystemStorage_; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
37 IStorage* objectStorage_; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
38 bool cryptoEnabled_; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
39 |
84 | 40 void Serialize(Json::Value& target) const; |
83
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
41 public: |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
42 MoveStorageJob(const std::string& targetStorage, |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
43 const std::vector<std::string>& instances, |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
44 const Json::Value& resourceForJobContent, |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
45 bool cryptoEnabled); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
46 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
47 virtual OrthancPluginJobStepStatus Step(); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
48 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
49 virtual void Stop(OrthancPluginJobStopReason reason); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
50 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
51 virtual void Reset(); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
52 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
53 void SetStorages(IStorage* fileSystemStorage, IStorage* objectStorage); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
54 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
55 }; |