comparison OrthancServer/Plugins/Engine/OrthancPluginDatabaseV3.cpp @ 4604:2c702cfae274 db-changes

New option "DatabaseServerIdentifier" to identify the server among a pool of Orthanc servers
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 30 Mar 2021 10:39:59 +0200
parents cfdd1f59ff6f
children f75c63aa9de0
comparison
equal deleted inserted replaced
4603:c125bfd31023 4604:2c702cfae274
694 694
695 695
696 virtual bool LookupGlobalProperty(std::string& target, 696 virtual bool LookupGlobalProperty(std::string& target,
697 GlobalProperty property) ORTHANC_OVERRIDE 697 GlobalProperty property) ORTHANC_OVERRIDE
698 { 698 {
699 CheckSuccess(that_.backend_.lookupGlobalProperty(transaction_, static_cast<int32_t>(property))); 699 CheckSuccess(that_.backend_.lookupGlobalProperty(
700 transaction_, that_.serverIdentifier_.c_str(), static_cast<int32_t>(property)));
700 CheckNoEvent(); 701 CheckNoEvent();
701 return ReadSingleStringAnswer(target); 702 return ReadSingleStringAnswer(target);
702 } 703 }
703 704
704 705
760 761
761 762
762 virtual void SetGlobalProperty(GlobalProperty property, 763 virtual void SetGlobalProperty(GlobalProperty property,
763 const std::string& value) ORTHANC_OVERRIDE 764 const std::string& value) ORTHANC_OVERRIDE
764 { 765 {
765 CheckSuccess(that_.backend_.setGlobalProperty(transaction_, static_cast<int32_t>(property), value.c_str())); 766 CheckSuccess(that_.backend_.setGlobalProperty(transaction_, that_.serverIdentifier_.c_str(),
767 static_cast<int32_t>(property), value.c_str()));
766 CheckNoEvent(); 768 CheckNoEvent();
767 } 769 }
768 770
769 771
770 virtual void ClearMainDicomTags(int64_t id) ORTHANC_OVERRIDE 772 virtual void ClearMainDicomTags(int64_t id) ORTHANC_OVERRIDE
1046 1048
1047 OrthancPluginDatabaseV3::OrthancPluginDatabaseV3(SharedLibrary& library, 1049 OrthancPluginDatabaseV3::OrthancPluginDatabaseV3(SharedLibrary& library,
1048 PluginsErrorDictionary& errorDictionary, 1050 PluginsErrorDictionary& errorDictionary,
1049 const OrthancPluginDatabaseBackendV3* backend, 1051 const OrthancPluginDatabaseBackendV3* backend,
1050 size_t backendSize, 1052 size_t backendSize,
1051 void* database) : 1053 void* database,
1054 const std::string& serverIdentifier) :
1052 library_(library), 1055 library_(library),
1053 errorDictionary_(errorDictionary), 1056 errorDictionary_(errorDictionary),
1054 database_(database) 1057 database_(database),
1058 serverIdentifier_(serverIdentifier)
1055 { 1059 {
1060 CLOG(INFO, PLUGINS) << "Identifier of this Orthanc server for the global properties "
1061 << "of the custom database: \"" << serverIdentifier << "\"";
1062
1056 if (backendSize >= sizeof(backend_)) 1063 if (backendSize >= sizeof(backend_))
1057 { 1064 {
1058 memcpy(&backend_, backend, sizeof(backend_)); 1065 memcpy(&backend_, backend, sizeof(backend_));
1059 } 1066 }
1060 else 1067 else