changeset 5196:031ab885e18a db-protobuf

comments
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 28 Mar 2023 12:43:38 +0200
parents e9f3bddd30cc
children d8469ad83f39
files OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h OrthancServer/Plugins/Include/orthanc/OrthancDatabasePlugin.proto
diffstat 2 files changed, 37 insertions(+), 47 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h	Mon Mar 27 21:18:37 2023 +0200
+++ b/OrthancServer/Plugins/Include/orthanc/OrthancCPlugin.h	Tue Mar 28 12:43:38 2023 +0200
@@ -119,8 +119,8 @@
 #endif
 
 #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER     1
-#define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER     11
-#define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER  3
+#define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER     12
+#define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER  0
 
 
 #if !defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE)
--- a/OrthancServer/Plugins/Include/orthanc/OrthancDatabasePlugin.proto	Mon Mar 27 21:18:37 2023 +0200
+++ b/OrthancServer/Plugins/Include/orthanc/OrthancDatabasePlugin.proto	Tue Mar 28 12:43:38 2023 +0200
@@ -20,6 +20,12 @@
  **/
 
 
+/**
+ * This Protocol Buffers prototype describes the exchanges between the
+ * Orthanc core and its database plugins. The various calls correspond
+ * to the "IDatabaseWrapper" interface in the source code of Orthanc.
+ **/
+
 syntax = "proto3";
 
 package Orthanc.DatabasePluginMessages;
@@ -91,14 +97,13 @@
  **/
 
 enum DatabaseOperation {
-  OPERATION_OPEN = 0;
-  OPERATION_CLOSE = 1;
-  OPERATION_FLUSH_TO_DISK = 2;
-  OPERATION_HAS_FLUSH_TO_DISK = 3;
+  OPERATION_GET_SYSTEM_INFORMATION = 0;
+  OPERATION_OPEN = 1;
+  OPERATION_CLOSE = 2;
+  OPERATION_FLUSH_TO_DISK = 3;
   OPERATION_START_TRANSACTION = 4;
   OPERATION_GET_DATABASE_VERSION = 5;
   OPERATION_UPGRADE = 6;
-  OPERATION_HAS_REVISION_SUPPORT = 7;
 }
 
 enum TransactionType {
@@ -106,6 +111,15 @@
   TRANSACTION_TYPE_READ_WRITE = 1;
 }
 
+message GetSystemInformation {
+  message Request {
+  }
+  message Response {
+    bool supports_flush_to_disk = 1;
+    bool supports_revisions = 2;
+  }
+}
+
 message Open {
   message Request {
   }
@@ -127,14 +141,6 @@
   }
 }
 
-message TestFlushToDisk {
-  message Request {
-  }
-  message Response {
-    bool result = 1;
-  }
-}
-
 message StartTransaction {
   message Request {
     TransactionType type = 1;
@@ -161,41 +167,28 @@
   }
 }
 
-message TestRevisionsSupport {
-  message Request {
-  }
-  message Response {
-    bool result = 1;
-  }
-}
 
-
-message RequestDatabase {
+message DatabaseRequest {
   sfixed64           database = 1;
   DatabaseOperation  operation = 2;
 
-  Open.Request                  open = 100;
-  Close.Request                 close = 101;
-  FlushToDisk.Request           flush_to_disk = 102;
-  TestFlushToDisk.Request       test_flush_to_disk = 103;
+  GetSystemInformation.Request  get_system_information = 100;
+  Open.Request                  open = 101;
+  Close.Request                 close = 102;
+  FlushToDisk.Request           flush_to_disk = 103;
   StartTransaction.Request      start_transaction = 104;
   GetDatabaseVersion.Request    get_database_version = 105;
   Upgrade.Request               upgrade = 106;
-  TestRevisionsSupport.Request  test_revisions_support = 107;
 }
 
-message ResponseDatabase {
-  int32   error_code = 1;
-  string  error_description = 2;
-
-  Open.Response                  open = 100;
-  Close.Response                 close = 101;
-  FlushToDisk.Response           flush_to_disk = 102;
-  TestFlushToDisk.Response       test_flush_to_disk = 103;
+message DatabaseResponse {
+  GetSystemInformation.Response  get_system_information = 100;
+  Open.Response                  open = 101;
+  Close.Response                 close = 102;
+  FlushToDisk.Response           flush_to_disk = 103;
   StartTransaction.Response      start_transaction = 104;
   GetDatabaseVersion.Response    get_database_version = 105;
   Upgrade.Response               upgrade = 106;
-  TestRevisionsSupport.Response  test_revisions_support = 107;
 }
 
 
@@ -716,7 +709,7 @@
   }
 }
 
-message RequestTransaction {
+message TransactionRequest {
   sfixed64              transaction = 1;
   TransactionOperation  operation = 2;
 
@@ -767,10 +760,7 @@
   LookupResourceAndParent.Request         lookup_resource_and_parent = 144;
 }
 
-message ResponseTransaction {
-  int32   error_code = 1;
-  string  error_description = 2;
-
+message TransactionResponse {
   Rollback.Response                        rollback = 100;
   Commit.Response                          commit = 101;
   AddAttachment.Response                   add_attachment = 102;
@@ -825,11 +815,11 @@
 
 message Request {
   RequestType         type = 1;
-  RequestDatabase     request_database = 2;
-  RequestTransaction  request_transaction = 3;
+  DatabaseRequest     database_request = 2;
+  TransactionRequest  transaction_request = 3;
 }
 
 message Response {
-  ResponseDatabase     response_database = 1;
-  ResponseTransaction  response_transaction = 2;
+  DatabaseResponse     database_response = 2;
+  TransactionResponse  transaction_response = 3;
 }