diff OrthancServer/main.cpp @ 3604:e327b44780bb storage-commitment

abstraction: storage commitment handler
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 16 Jan 2020 18:14:43 +0100
parents 9cc09f4c0fa9
children 33ba63637d48
line wrap: on
line diff
--- a/OrthancServer/main.cpp	Thu Jan 16 18:10:57 2020 +0100
+++ b/OrthancServer/main.cpp	Thu Jan 16 18:14:43 2020 +0100
@@ -91,6 +91,30 @@
 
 
 
+class OrthancStorageCommitmentRequestHandler : public IStorageCommitmentRequestHandler
+{
+private:
+  ServerContext& server_;
+
+public:
+  OrthancStorageCommitmentRequestHandler(ServerContext& context) :
+    server_(context)
+  {
+  }
+
+  virtual void Handle(const std::string& transactionUid,
+                      const std::vector<std::string>& referencedSopClassUids,
+                      const std::vector<std::string>& referencedSopInstanceUids,
+                      const std::string& remoteIp,
+                      const std::string& remoteAet,
+                      const std::string& calledAet)
+  {
+    // TODO - Enqueue a Storage commitment job
+  }
+};
+
+
+
 class ModalitiesFromConfiguration : public DicomServer::IRemoteModalities
 {
 public:
@@ -113,7 +137,8 @@
 class MyDicomServerFactory : 
   public IStoreRequestHandlerFactory,
   public IFindRequestHandlerFactory, 
-  public IMoveRequestHandlerFactory
+  public IMoveRequestHandlerFactory, 
+  public IStorageCommitmentRequestHandlerFactory
 {
 private:
   ServerContext& context_;
@@ -166,6 +191,11 @@
     return new OrthancMoveRequestHandler(context_);
   }
 
+  virtual IStorageCommitmentRequestHandler* ConstructStorageCommitmentRequestHandler()
+  {
+    return new OrthancStorageCommitmentRequestHandler(context_);
+  }
+
   void Done()
   {
   }
@@ -672,6 +702,7 @@
     PrintErrorCode(ErrorCode_CannotOrderSlices, "Unable to order the slices of the series");
     PrintErrorCode(ErrorCode_NoWorklistHandler, "No request handler factory for DICOM C-Find Modality SCP");
     PrintErrorCode(ErrorCode_AlreadyExistingTag, "Cannot override the value of a tag that already exists");
+    PrintErrorCode(ErrorCode_NoStorageCommitmentHandler, "No request handler factory for DICOM N-ACTION SCP (storage commitment)");
     PrintErrorCode(ErrorCode_UnsupportedMediaType, "Unsupported media type");
   }
 
@@ -966,6 +997,7 @@
     dicomServer.SetStoreRequestHandlerFactory(serverFactory);
     dicomServer.SetMoveRequestHandlerFactory(serverFactory);
     dicomServer.SetFindRequestHandlerFactory(serverFactory);
+    dicomServer.SetStorageCommitmentRequestHandlerFactory(serverFactory);
 
     {
       OrthancConfiguration::ReaderLock lock;