comparison 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
comparison
equal deleted inserted replaced
82:f30b9acf80f0 83:431ab61b5760
1 /**
2 * Cloud storage plugins for Orthanc
3 * Copyright (C) 2020-2021 Osimis S.A., Belgium
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
20 #pragma once
21
22
23 #include <orthanc/OrthancCPlugin.h>
24 #include <OrthancPluginCppWrapper.h>
25 #include <json/json.h>
26 #include "IStorage.h"
27
28 #include <vector>
29
30 class MoveStorageJob : public OrthancPlugins::OrthancJob
31 {
32 std::string targetStorage_;
33 std::vector<std::string> instances_;
34 size_t processedInstancesCount_;
35 Json::Value resourceForJobContent_;
36 IStorage* fileSystemStorage_;
37 IStorage* objectStorage_;
38 bool cryptoEnabled_;
39
40 public:
41 MoveStorageJob(const std::string& targetStorage,
42 const std::vector<std::string>& instances,
43 const Json::Value& resourceForJobContent,
44 bool cryptoEnabled);
45
46 virtual OrthancPluginJobStepStatus Step();
47
48 virtual void Stop(OrthancPluginJobStopReason reason);
49
50 virtual void Reset();
51
52 void SetStorages(IStorage* fileSystemStorage, IStorage* objectStorage);
53
54 };