comparison 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
comparison
equal deleted inserted replaced
3603:7e303ba837d9 3604:e327b44780bb
89 } 89 }
90 }; 90 };
91 91
92 92
93 93
94 class OrthancStorageCommitmentRequestHandler : public IStorageCommitmentRequestHandler
95 {
96 private:
97 ServerContext& server_;
98
99 public:
100 OrthancStorageCommitmentRequestHandler(ServerContext& context) :
101 server_(context)
102 {
103 }
104
105 virtual void Handle(const std::string& transactionUid,
106 const std::vector<std::string>& referencedSopClassUids,
107 const std::vector<std::string>& referencedSopInstanceUids,
108 const std::string& remoteIp,
109 const std::string& remoteAet,
110 const std::string& calledAet)
111 {
112 // TODO - Enqueue a Storage commitment job
113 }
114 };
115
116
117
94 class ModalitiesFromConfiguration : public DicomServer::IRemoteModalities 118 class ModalitiesFromConfiguration : public DicomServer::IRemoteModalities
95 { 119 {
96 public: 120 public:
97 virtual bool IsSameAETitle(const std::string& aet1, 121 virtual bool IsSameAETitle(const std::string& aet1,
98 const std::string& aet2) 122 const std::string& aet2)
111 135
112 136
113 class MyDicomServerFactory : 137 class MyDicomServerFactory :
114 public IStoreRequestHandlerFactory, 138 public IStoreRequestHandlerFactory,
115 public IFindRequestHandlerFactory, 139 public IFindRequestHandlerFactory,
116 public IMoveRequestHandlerFactory 140 public IMoveRequestHandlerFactory,
141 public IStorageCommitmentRequestHandlerFactory
117 { 142 {
118 private: 143 private:
119 ServerContext& context_; 144 ServerContext& context_;
120 145
121 public: 146 public:
162 } 187 }
163 188
164 virtual IMoveRequestHandler* ConstructMoveRequestHandler() 189 virtual IMoveRequestHandler* ConstructMoveRequestHandler()
165 { 190 {
166 return new OrthancMoveRequestHandler(context_); 191 return new OrthancMoveRequestHandler(context_);
192 }
193
194 virtual IStorageCommitmentRequestHandler* ConstructStorageCommitmentRequestHandler()
195 {
196 return new OrthancStorageCommitmentRequestHandler(context_);
167 } 197 }
168 198
169 void Done() 199 void Done()
170 { 200 {
171 } 201 }
670 PrintErrorCode(ErrorCode_DatabaseNotInitialized, "Plugin trying to call the database during its initialization"); 700 PrintErrorCode(ErrorCode_DatabaseNotInitialized, "Plugin trying to call the database during its initialization");
671 PrintErrorCode(ErrorCode_SslDisabled, "Orthanc has been built without SSL support"); 701 PrintErrorCode(ErrorCode_SslDisabled, "Orthanc has been built without SSL support");
672 PrintErrorCode(ErrorCode_CannotOrderSlices, "Unable to order the slices of the series"); 702 PrintErrorCode(ErrorCode_CannotOrderSlices, "Unable to order the slices of the series");
673 PrintErrorCode(ErrorCode_NoWorklistHandler, "No request handler factory for DICOM C-Find Modality SCP"); 703 PrintErrorCode(ErrorCode_NoWorklistHandler, "No request handler factory for DICOM C-Find Modality SCP");
674 PrintErrorCode(ErrorCode_AlreadyExistingTag, "Cannot override the value of a tag that already exists"); 704 PrintErrorCode(ErrorCode_AlreadyExistingTag, "Cannot override the value of a tag that already exists");
705 PrintErrorCode(ErrorCode_NoStorageCommitmentHandler, "No request handler factory for DICOM N-ACTION SCP (storage commitment)");
675 PrintErrorCode(ErrorCode_UnsupportedMediaType, "Unsupported media type"); 706 PrintErrorCode(ErrorCode_UnsupportedMediaType, "Unsupported media type");
676 } 707 }
677 708
678 std::cout << std::endl; 709 std::cout << std::endl;
679 } 710 }
964 DicomServer dicomServer; 995 DicomServer dicomServer;
965 dicomServer.SetRemoteModalities(modalities); 996 dicomServer.SetRemoteModalities(modalities);
966 dicomServer.SetStoreRequestHandlerFactory(serverFactory); 997 dicomServer.SetStoreRequestHandlerFactory(serverFactory);
967 dicomServer.SetMoveRequestHandlerFactory(serverFactory); 998 dicomServer.SetMoveRequestHandlerFactory(serverFactory);
968 dicomServer.SetFindRequestHandlerFactory(serverFactory); 999 dicomServer.SetFindRequestHandlerFactory(serverFactory);
1000 dicomServer.SetStorageCommitmentRequestHandlerFactory(serverFactory);
969 1001
970 { 1002 {
971 OrthancConfiguration::ReaderLock lock; 1003 OrthancConfiguration::ReaderLock lock;
972 dicomServer.SetCalledApplicationEntityTitleCheck(lock.GetConfiguration().GetBooleanParameter("DicomCheckCalledAet", false)); 1004 dicomServer.SetCalledApplicationEntityTitleCheck(lock.GetConfiguration().GetBooleanParameter("DicomCheckCalledAet", false));
973 dicomServer.SetAssociationTimeout(lock.GetConfiguration().GetUnsignedIntegerParameter("DicomScpTimeout", 30)); 1005 dicomServer.SetAssociationTimeout(lock.GetConfiguration().GetUnsignedIntegerParameter("DicomScpTimeout", 30));