annotate Common/MoveStorageJob.h @ 83:431ab61b5760

/move-storage when HybridMode is enabled
author Alain Mazy <am@osimis.io>
date Thu, 20 Oct 2022 15:14:39 +0200
parents
children 8a9207933297
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
431ab61b5760 /move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff changeset
40 public:
431ab61b5760 /move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff changeset
41 MoveStorageJob(const std::string& targetStorage,
431ab61b5760 /move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff changeset
42 const std::vector<std::string>& instances,
431ab61b5760 /move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff changeset
43 const Json::Value& resourceForJobContent,
431ab61b5760 /move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff changeset
44 bool cryptoEnabled);
431ab61b5760 /move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff changeset
45
431ab61b5760 /move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff changeset
46 virtual OrthancPluginJobStepStatus Step();
431ab61b5760 /move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff changeset
47
431ab61b5760 /move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff changeset
48 virtual void Stop(OrthancPluginJobStopReason reason);
431ab61b5760 /move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff changeset
49
431ab61b5760 /move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff changeset
50 virtual void Reset();
431ab61b5760 /move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff changeset
51
431ab61b5760 /move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff changeset
52 void SetStorages(IStorage* fileSystemStorage, IStorage* objectStorage);
431ab61b5760 /move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff changeset
53
431ab61b5760 /move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff changeset
54 };