Mercurial > hg > orthanc
annotate Core/DicomNetworking/DicomServer.h @ 4042:f5c86a00cae0
moving DownloadOrthancFramework.cmake to Resources/CMake/
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 10 Jun 2020 16:44:29 +0200 |
parents | 4f78da5613a1 |
children |
rev | line source |
---|---|
0 | 1 /** |
62 | 2 * Orthanc - A Lightweight, RESTful DICOM Store |
1900 | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
690
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
3640
94f4a18a79cc
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium |
0 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU General Public License as | |
9 * published by the Free Software Foundation, either version 3 of the | |
10 * License, or (at your option) any later version. | |
136 | 11 * |
12 * In addition, as a special exception, the copyright holders of this | |
13 * program give permission to link the code of its release with the | |
14 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
15 * that use the same license as the "OpenSSL" library), and distribute | |
16 * the linked executables. You must obey the GNU General Public License | |
17 * in all respects for all of the code used other than "OpenSSL". If you | |
18 * modify file(s) with this exception, you may extend this exception to | |
19 * your version of the file(s), but you are not obligated to do so. If | |
20 * you do not wish to do so, delete this exception statement from your | |
21 * version. If you delete this exception statement from all source files | |
22 * in the program, then also delete it here. | |
0 | 23 * |
24 * This program is distributed in the hope that it will be useful, but | |
25 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
27 * General Public License for more details. | |
28 * | |
29 * You should have received a copy of the GNU General Public License | |
30 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
31 **/ | |
32 | |
33 | |
34 #pragma once | |
35 | |
2380
96b3ec054b69
reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
36 #if ORTHANC_ENABLE_DCMTK_NETWORKING != 1 |
96b3ec054b69
reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
37 # error The macro ORTHANC_ENABLE_DCMTK_NETWORKING must be set to 1 |
96b3ec054b69
reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
38 #endif |
96b3ec054b69
reorganization in macros
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2244
diff
changeset
|
39 |
0 | 40 #include "IFindRequestHandlerFactory.h" |
41 #include "IMoveRequestHandlerFactory.h" | |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3641
diff
changeset
|
42 #include "IGetRequestHandlerFactory.h" |
0 | 43 #include "IStoreRequestHandlerFactory.h" |
1786
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
44 #include "IWorklistRequestHandlerFactory.h" |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
45 #include "IStorageCommitmentRequestHandlerFactory.h" |
0 | 46 #include "IApplicationEntityFilter.h" |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
47 #include "RemoteModalityParameters.h" |
0 | 48 |
49 #include <boost/shared_ptr.hpp> | |
50 #include <boost/noncopyable.hpp> | |
51 | |
1682
6414043df7d8
integration mainline->db-changes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1681
diff
changeset
|
52 |
62 | 53 namespace Orthanc |
0 | 54 { |
55 class DicomServer : public boost::noncopyable | |
56 { | |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
57 public: |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
58 // WARNING: The methods of this class must be thread-safe |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
59 class IRemoteModalities : public boost::noncopyable |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
60 { |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
61 public: |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
62 virtual ~IRemoteModalities() |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
63 { |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
64 } |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
65 |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
66 virtual bool IsSameAETitle(const std::string& aet1, |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
67 const std::string& aet2) = 0; |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
68 |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
69 virtual bool LookupAETitle(RemoteModalityParameters& modality, |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
70 const std::string& aet) = 0; |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
71 }; |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
72 |
0 | 73 private: |
74 struct PImpl; | |
75 boost::shared_ptr<PImpl> pimpl_; | |
76 | |
77 bool checkCalledAet_; | |
78 std::string aet_; | |
79 uint16_t port_; | |
80 bool continue_; | |
2068
879f3be759ef
renames to make code clearer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
81 uint32_t associationTimeout_; |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
82 IRemoteModalities* modalities_; |
0 | 83 IFindRequestHandlerFactory* findRequestHandlerFactory_; |
84 IMoveRequestHandlerFactory* moveRequestHandlerFactory_; | |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3641
diff
changeset
|
85 IGetRequestHandlerFactory* getRequestHandlerFactory_; |
0 | 86 IStoreRequestHandlerFactory* storeRequestHandlerFactory_; |
1786
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
87 IWorklistRequestHandlerFactory* worklistRequestHandlerFactory_; |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
88 IStorageCommitmentRequestHandlerFactory* storageCommitmentFactory_; |
0 | 89 IApplicationEntityFilter* applicationEntityFilter_; |
90 | |
1681
ee4367497d0d
got rid of buggy BagOfRunnablesBySteps
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1675
diff
changeset
|
91 static void ServerThread(DicomServer* server); |
0 | 92 |
93 public: | |
94 DicomServer(); | |
95 | |
96 ~DicomServer(); | |
97 | |
128 | 98 void SetPortNumber(uint16_t port); |
99 uint16_t GetPortNumber() const; | |
0 | 100 |
2069
fabf7820d1f1
New configuration options: "DicomScuTimeout" and "DicomScpTimeout" + validation of non-negative options
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2068
diff
changeset
|
101 void SetAssociationTimeout(uint32_t seconds); |
2068
879f3be759ef
renames to make code clearer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1900
diff
changeset
|
102 uint32_t GetAssociationTimeout() const; |
0 | 103 |
104 void SetCalledApplicationEntityTitleCheck(bool check); | |
105 bool HasCalledApplicationEntityTitleCheck() const; | |
106 | |
107 void SetApplicationEntityTitle(const std::string& aet); | |
108 const std::string& GetApplicationEntityTitle() const; | |
109 | |
2381
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
110 void SetRemoteModalities(IRemoteModalities& modalities); |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
111 IRemoteModalities& GetRemoteModalities() const; |
b8969010b534
uncoupling DCMTK primitives from Orthanc::Configuration
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2380
diff
changeset
|
112 |
0 | 113 void SetFindRequestHandlerFactory(IFindRequestHandlerFactory& handler); |
114 bool HasFindRequestHandlerFactory() const; | |
115 IFindRequestHandlerFactory& GetFindRequestHandlerFactory() const; | |
116 | |
117 void SetMoveRequestHandlerFactory(IMoveRequestHandlerFactory& handler); | |
118 bool HasMoveRequestHandlerFactory() const; | |
119 IMoveRequestHandlerFactory& GetMoveRequestHandlerFactory() const; | |
120 | |
3818
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3641
diff
changeset
|
121 void SetGetRequestHandlerFactory(IGetRequestHandlerFactory& handler); |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3641
diff
changeset
|
122 bool HasGetRequestHandlerFactory() const; |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3641
diff
changeset
|
123 IGetRequestHandlerFactory& GetGetRequestHandlerFactory() const; |
4f78da5613a1
Add C-GET SCP support
Stacy Loesch <stacy.loesch@varian.com>
parents:
3641
diff
changeset
|
124 |
0 | 125 void SetStoreRequestHandlerFactory(IStoreRequestHandlerFactory& handler); |
126 bool HasStoreRequestHandlerFactory() const; | |
127 IStoreRequestHandlerFactory& GetStoreRequestHandlerFactory() const; | |
128 | |
1786
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
129 void SetWorklistRequestHandlerFactory(IWorklistRequestHandlerFactory& handler); |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
130 bool HasWorklistRequestHandlerFactory() const; |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
131 IWorklistRequestHandlerFactory& GetWorklistRequestHandlerFactory() const; |
164d78911382
primitives to handle dicom worklists
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1682
diff
changeset
|
132 |
3604
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
133 void SetStorageCommitmentRequestHandlerFactory(IStorageCommitmentRequestHandlerFactory& handler); |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
134 bool HasStorageCommitmentRequestHandlerFactory() const; |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
135 IStorageCommitmentRequestHandlerFactory& GetStorageCommitmentRequestHandlerFactory() const; |
e327b44780bb
abstraction: storage commitment handler
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3060
diff
changeset
|
136 |
0 | 137 void SetApplicationEntityFilter(IApplicationEntityFilter& handler); |
138 bool HasApplicationEntityFilter() const; | |
139 IApplicationEntityFilter& GetApplicationEntityFilter() const; | |
140 | |
141 void Start(); | |
142 | |
143 void Stop(); | |
690
2e67366aab83
case-insensitive matching of Application Entity Titles
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
144 |
2e67366aab83
case-insensitive matching of Application Entity Titles
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
689
diff
changeset
|
145 bool IsMyAETitle(const std::string& aet) const; |
0 | 146 }; |
147 | |
148 } |