comparison Framework/Plugins/DatabaseBackendAdapterV4.cpp @ 532:25cfcb752af6 large-queries

merged find-refactoring -> large-queries
author Alain Mazy <am@orthanc.team>
date Fri, 06 Sep 2024 15:31:33 +0200
parents 2ab3d45c0b3c 451125122692
children 4ecf50a4521c
comparison
equal deleted inserted replaced
524:48aba35fe64e 532:25cfcb752af6
437 response.mutable_get_system_information()->set_supports_increment_global_property(accessor.GetBackend().HasAtomicIncrementGlobalProperty()); 437 response.mutable_get_system_information()->set_supports_increment_global_property(accessor.GetBackend().HasAtomicIncrementGlobalProperty());
438 response.mutable_get_system_information()->set_has_update_and_get_statistics(accessor.GetBackend().HasUpdateAndGetStatistics()); 438 response.mutable_get_system_information()->set_has_update_and_get_statistics(accessor.GetBackend().HasUpdateAndGetStatistics());
439 response.mutable_get_system_information()->set_has_measure_latency(accessor.GetBackend().HasMeasureLatency()); 439 response.mutable_get_system_information()->set_has_measure_latency(accessor.GetBackend().HasMeasureLatency());
440 #endif 440 #endif
441 441
442 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 13, 0) 442 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 5)
443 response.mutable_get_system_information()->set_has_extended_api_v1(accessor.GetBackend().HasExtendedApiV1()); 443 response.mutable_get_system_information()->set_supports_find(accessor.GetBackend().HasFindSupport());
444 response.mutable_get_system_information()->set_has_extended_changes(accessor.GetBackend().HasExtendedChanges());
444 #endif 445 #endif
446
445 break; 447 break;
446 } 448 }
447 449
448 case Orthanc::DatabasePluginMessages::OPERATION_OPEN: 450 case Orthanc::DatabasePluginMessages::OPERATION_OPEN:
449 { 451 {
784 backend.GetChanges(output, done, manager, request.get_changes().since(), request.get_changes().limit()); 786 backend.GetChanges(output, done, manager, request.get_changes().since(), request.get_changes().limit());
785 787
786 response.mutable_get_changes()->set_done(done); 788 response.mutable_get_changes()->set_done(done);
787 break; 789 break;
788 } 790 }
789 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 13, 0) 791 #if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 5)
790 case Orthanc::DatabasePluginMessages::OPERATION_GET_CHANGES_2: 792 case Orthanc::DatabasePluginMessages::OPERATION_GET_CHANGES_EXTENDED:
791 { 793 {
792 Output output(*response.mutable_get_changes()); 794 Output output(*response.mutable_get_changes());
793 795
794 bool done; 796 bool done;
795 backend.GetChanges2(output, done, manager, request.get_changes2().since(), request.get_changes2().to(), static_cast<OrthancPluginChangeType>(request.get_changes2().change_type()), request.get_changes2().limit()); 797 backend.GetChangesExtended(output, done, manager, request.get_changes_extended().since(), request.get_changes_extended().to(), static_cast<OrthancPluginChangeType>(request.get_changes_extended().change_type()), request.get_changes_extended().limit());
796 798
797 response.mutable_get_changes()->set_done(done); 799 response.mutable_get_changes_extended()->set_done(done);
798 break; 800 break;
799 } 801 }
800 #endif 802 #endif
801 803
802 case Orthanc::DatabasePluginMessages::OPERATION_GET_CHILDREN_INTERNAL_ID: 804 case Orthanc::DatabasePluginMessages::OPERATION_GET_CHILDREN_INTERNAL_ID:
1311 } 1313 }
1312 1314
1313 break; 1315 break;
1314 } 1316 }
1315 1317
1318 case Orthanc::DatabasePluginMessages::OPERATION_FIND:
1319 {
1320 backend.ExecuteFind(response, manager, request.find());
1321 break;
1322 }
1323
1316 default: 1324 default:
1317 LOG(ERROR) << "Not implemented transaction operation from protobuf: " << request.operation(); 1325 LOG(ERROR) << "Not implemented transaction operation from protobuf: " << request.operation();
1318 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); 1326 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
1319 } 1327 }
1320 } 1328 }