Mercurial > hg > orthanc-object-storage
annotate Common/MoveStorageJob.cpp @ 103:2ba7af9eddce
release notes
author | Alain Mazy <am@osimis.io> |
---|---|
date | Thu, 20 Jul 2023 17:19:07 +0200 |
parents | 8a9207933297 |
children | 407bd022b0cf |
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 #include "MoveStorageJob.h" |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
20 #include "Logging.h" |
84 | 21 #include "StoragePlugin.h" |
83
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 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
24 MoveStorageJob::MoveStorageJob(const std::string& targetStorage, |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
25 const std::vector<std::string>& instances, |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
26 const Json::Value& resourceForJobContent, |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
27 bool cryptoEnabled) |
84 | 28 : OrthancPlugins::OrthancJob(JOB_TYPE_MOVE_STORAGE), |
83
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
29 targetStorage_(targetStorage), |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
30 instances_(instances), |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
31 processedInstancesCount_(0), |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
32 resourceForJobContent_(resourceForJobContent), |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
33 fileSystemStorage_(NULL), |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
34 objectStorage_(NULL), |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
35 cryptoEnabled_(cryptoEnabled) |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
36 { |
84 | 37 UpdateContent(resourceForJobContent); |
38 | |
39 Json::Value serialized; | |
40 Serialize(serialized); | |
41 UpdateSerialized(serialized); | |
42 } | |
43 | |
44 void MoveStorageJob::Serialize(Json::Value& target) const | |
45 { | |
46 target[KEY_CONTENT] = resourceForJobContent_; | |
47 target[KEY_TARGET_STORAGE] = targetStorage_; | |
48 target[KEY_INSTANCES] = Json::arrayValue; | |
49 | |
50 for (size_t i = 0; i < instances_.size(); ++i) | |
51 { | |
52 target[KEY_INSTANCES].append(instances_[i]); | |
53 } | |
54 | |
83
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
55 } |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
56 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
57 void MoveStorageJob::SetStorages(IStorage* fileSystemStorage, IStorage* objectStorage) |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
58 { |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
59 fileSystemStorage_ = fileSystemStorage; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
60 objectStorage_ = objectStorage; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
61 } |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
62 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
63 static bool MoveAttachment(const std::string& uuid, int type, IStorage* sourceStorage, IStorage* targetStorage, bool cryptoEnabled) |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
64 { |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
65 std::vector<char> buffer; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
66 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
67 // read from source storage |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
68 try |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
69 { |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
70 OrthancPlugins::LogInfo("Move attachment: " + sourceStorage->GetNameForLogs() + ": reading attachment " + std::string(uuid) + " of type " + boost::lexical_cast<std::string>(type)); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
71 std::unique_ptr<IStorage::IReader> reader(sourceStorage->GetReaderForObject(uuid.c_str(), static_cast<OrthancPluginContentType>(type), cryptoEnabled)); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
72 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
73 size_t fileSize = reader->GetSize(); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
74 buffer.resize(fileSize); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
75 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
76 reader->ReadWhole(buffer.data(), fileSize); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
77 } |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
78 catch (StoragePluginException& ex) |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
79 { |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
80 OrthancPlugins::LogInfo("Move attachment: " + sourceStorage->GetNameForLogs() + ": error while reading attachment " + std::string(uuid) + " of type " + boost::lexical_cast<std::string>(type) + ", this likely means that the file is already on the right storage"); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
81 return true; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
82 } |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
83 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
84 // write to target storage |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
85 if (buffer.size() > 0) |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
86 { |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
87 try |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
88 { |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
89 std::unique_ptr<IStorage::IWriter> writer(targetStorage->GetWriterForObject(uuid.c_str(), static_cast<OrthancPluginContentType>(type), cryptoEnabled)); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
90 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
91 writer->Write(buffer.data(), buffer.size()); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
92 } |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
93 catch (StoragePluginException& ex) |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
94 { |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
95 OrthancPlugins::LogError("Move attachment: " + targetStorage->GetNameForLogs() + ": error while writing attachment " + std::string(uuid) + " of type " + boost::lexical_cast<std::string>(type) + ": " + ex.what()); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
96 return false; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
97 } |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
98 } |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
99 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
100 // everything went well so fare, we can delete from source storage |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
101 if (buffer.size() > 0) |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
102 { |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
103 try |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
104 { |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
105 sourceStorage->DeleteObject(uuid.c_str(), static_cast<OrthancPluginContentType>(type), cryptoEnabled); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
106 } |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
107 catch (StoragePluginException& ex) |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
108 { |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
109 OrthancPlugins::LogError("Move attachment: " + sourceStorage->GetNameForLogs() + ": error while deleting attachment " + std::string(uuid) + " of type " + boost::lexical_cast<std::string>(type) + ": " + ex.what()); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
110 return false; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
111 } |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
112 } |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
113 return true; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
114 } |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
115 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
116 static bool MoveInstance(const std::string& instanceId, IStorage* sourceStorage, IStorage* targetStorage, bool cryptoEnabled) |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
117 { |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
118 LOG(INFO) << "Moving instance from " << sourceStorage->GetNameForLogs() << " to " << targetStorage->GetNameForLogs(); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
119 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
120 Json::Value attachmentsList; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
121 OrthancPlugins::RestApiGet(attachmentsList, std::string("/instances/") + instanceId + "/attachments?full", false); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
122 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
123 Json::Value::Members attachmentsMembers = attachmentsList.getMemberNames(); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
124 bool success = true; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
125 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
126 for (size_t i = 0; i < attachmentsMembers.size(); i++) |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
127 { |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
128 int attachmentId = attachmentsList[attachmentsMembers[i]].asInt(); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
129 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
130 Json::Value attachmentInfo; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
131 OrthancPlugins::RestApiGet(attachmentInfo, std::string("/instances/") + instanceId + "/attachments/" + boost::lexical_cast<std::string>(attachmentId) + "/info", false); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
132 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
133 std::string attachmentUuid = attachmentInfo["Uuid"].asString(); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
134 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
135 // now we have the uuid and type. We actually don't know where the file is but we'll try to move it anyway to the requested target |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
136 success &= MoveAttachment(attachmentUuid, attachmentId, sourceStorage, targetStorage, cryptoEnabled); |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
137 } |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
138 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
139 return success; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
140 } |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
141 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
142 OrthancPluginJobStepStatus MoveStorageJob::Step() |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
143 { |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
144 if (processedInstancesCount_ < instances_.size()) |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
145 { |
84 | 146 IStorage* sourceStorage = (targetStorage_ == STORAGE_TYPE_FILE_SYSTEM ? objectStorage_ : fileSystemStorage_); |
147 IStorage* targetStorage = (targetStorage_ == STORAGE_TYPE_FILE_SYSTEM ? fileSystemStorage_ : objectStorage_); | |
83
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
148 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
149 if (MoveInstance(instances_[processedInstancesCount_], sourceStorage, targetStorage, cryptoEnabled_)) |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
150 { |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
151 processedInstancesCount_++; |
84 | 152 UpdateProgress((float)processedInstancesCount_/(float)instances_.size()); |
153 | |
83
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
154 return OrthancPluginJobStepStatus_Continue; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
155 } |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
156 else |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
157 { |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
158 return OrthancPluginJobStepStatus_Failure; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
159 } |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
160 } |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
161 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
162 return OrthancPluginJobStepStatus_Success; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
163 } |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
164 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
165 void MoveStorageJob::Stop(OrthancPluginJobStopReason reason) |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
166 { |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
167 } |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
168 |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
169 void MoveStorageJob::Reset() |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
170 { |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
171 processedInstancesCount_ = 0; |
431ab61b5760
/move-storage when HybridMode is enabled
Alain Mazy <am@osimis.io>
parents:
diff
changeset
|
172 } |