comparison Azure/AzureBlobStoragePlugin.cpp @ 79:16514270d9ca

fix
author Alain Mazy <am@osimis.io>
date Fri, 14 Oct 2022 16:22:26 +0200
parents d7295e8678d7
children b3787f4aa16a
comparison
equal deleted inserted replaced
78:d7295e8678d7 79:16514270d9ca
39 as::cloud_blob_container blobContainer_; 39 as::cloud_blob_container blobContainer_;
40 bool storageContainsUnknownFiles_; 40 bool storageContainsUnknownFiles_;
41 41
42 public: 42 public:
43 43
44 AzureBlobStoragePlugin(const as::cloud_blob_client& blobClient, 44 AzureBlobStoragePlugin(const std::string& nameForLogs,
45 const as::cloud_blob_client& blobClient,
45 const as::cloud_blob_container& blobContainer, 46 const as::cloud_blob_container& blobContainer,
46 bool enableLegacyStorageStructure, 47 bool enableLegacyStorageStructure,
47 bool storageContainsUnknownFiles 48 bool storageContainsUnknownFiles
48 ); 49 );
49 50
194 } 195 }
195 196
196 return false; 197 return false;
197 } 198 }
198 199
199 IStorage* AzureBlobStoragePluginFactory::CreateStorage(const OrthancPlugins::OrthancConfiguration& orthancConfig) 200 IStorage* AzureBlobStoragePluginFactory::CreateStorage(const std::string& nameForLogs, const OrthancPlugins::OrthancConfiguration& orthancConfig)
200 { 201 {
201 std::string connectionString; 202 std::string connectionString;
202 std::string containerName; 203 std::string containerName;
203 bool enableLegacyStorageStructure; 204 bool enableLegacyStorageStructure;
204 bool storageContainsUnknownFiles; 205 bool storageContainsUnknownFiles;
301 } 302 }
302 } 303 }
303 304
304 OrthancPlugins::LogInfo("Blob storage initialized"); 305 OrthancPlugins::LogInfo("Blob storage initialized");
305 306
306 return new AzureBlobStoragePlugin(blobClient, blobContainer, enableLegacyStorageStructure, storageContainsUnknownFiles); 307 return new AzureBlobStoragePlugin(nameForLogs, blobClient, blobContainer, enableLegacyStorageStructure, storageContainsUnknownFiles);
307 } 308 }
308 catch (const std::exception& e) 309 catch (const std::exception& e)
309 { 310 {
310 OrthancPlugins::LogError(std::string("AzureBlobStorage plugin: failed to initialize plugin: ") + e.what()); 311 OrthancPlugins::LogError(std::string("AzureBlobStorage plugin: failed to initialize plugin: ") + e.what());
311 return nullptr; 312 return nullptr;
312 } 313 }
313 314
314 } 315 }
315 316
316 AzureBlobStoragePlugin::AzureBlobStoragePlugin(const as::cloud_blob_client& blobClient, const as::cloud_blob_container& blobContainer, bool enableLegacyStorageStructure, bool storageContainsUnknownFiles) 317 AzureBlobStoragePlugin::AzureBlobStoragePlugin(const std::string& nameForLogs, const as::cloud_blob_client& blobClient, const as::cloud_blob_container& blobContainer, bool enableLegacyStorageStructure, bool storageContainsUnknownFiles)
317 : BaseStorage(enableLegacyStorageStructure), 318 : BaseStorage(nameForLogs, enableLegacyStorageStructure),
318 blobClient_(blobClient), 319 blobClient_(blobClient),
319 blobContainer_(blobContainer), 320 blobContainer_(blobContainer),
320 storageContainsUnknownFiles_(storageContainsUnknownFiles) 321 storageContainsUnknownFiles_(storageContainsUnknownFiles)
321 { 322 {
322 323