comparison Core/DicomNetworking/DicomServer.h @ 2382:7284093111b0

big reorganization to cleanly separate framework vs. server
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 29 Aug 2017 21:17:35 +0200
parents OrthancServer/DicomProtocol/DicomServer.h@b8969010b534
children 878b59270859
comparison
equal deleted inserted replaced
2381:b8969010b534 2382:7284093111b0
1 /**
2 * Orthanc - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017 Osimis, Belgium
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.
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.
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
36 #if ORTHANC_ENABLE_DCMTK_NETWORKING != 1
37 # error The macro ORTHANC_ENABLE_DCMTK_NETWORKING must be set to 1
38 #endif
39
40 #include "IFindRequestHandlerFactory.h"
41 #include "IMoveRequestHandlerFactory.h"
42 #include "IStoreRequestHandlerFactory.h"
43 #include "IWorklistRequestHandlerFactory.h"
44 #include "IApplicationEntityFilter.h"
45 #include "RemoteModalityParameters.h"
46
47 #include <boost/shared_ptr.hpp>
48 #include <boost/noncopyable.hpp>
49
50
51 namespace Orthanc
52 {
53 class DicomServer : public boost::noncopyable
54 {
55 public:
56 // WARNING: The methods of this class must be thread-safe
57 class IRemoteModalities : public boost::noncopyable
58 {
59 public:
60 virtual ~IRemoteModalities()
61 {
62 }
63
64 virtual bool IsSameAETitle(const std::string& aet1,
65 const std::string& aet2) = 0;
66
67 virtual bool LookupAETitle(RemoteModalityParameters& modality,
68 const std::string& aet) = 0;
69 };
70
71 private:
72 struct PImpl;
73 boost::shared_ptr<PImpl> pimpl_;
74
75 bool checkCalledAet_;
76 std::string aet_;
77 uint16_t port_;
78 bool continue_;
79 uint32_t associationTimeout_;
80 IRemoteModalities* modalities_;
81 IFindRequestHandlerFactory* findRequestHandlerFactory_;
82 IMoveRequestHandlerFactory* moveRequestHandlerFactory_;
83 IStoreRequestHandlerFactory* storeRequestHandlerFactory_;
84 IWorklistRequestHandlerFactory* worklistRequestHandlerFactory_;
85 IApplicationEntityFilter* applicationEntityFilter_;
86
87 static void ServerThread(DicomServer* server);
88
89 public:
90 DicomServer();
91
92 ~DicomServer();
93
94 void SetPortNumber(uint16_t port);
95 uint16_t GetPortNumber() const;
96
97 void SetAssociationTimeout(uint32_t seconds);
98 uint32_t GetAssociationTimeout() const;
99
100 void SetCalledApplicationEntityTitleCheck(bool check);
101 bool HasCalledApplicationEntityTitleCheck() const;
102
103 void SetApplicationEntityTitle(const std::string& aet);
104 const std::string& GetApplicationEntityTitle() const;
105
106 void SetRemoteModalities(IRemoteModalities& modalities);
107 IRemoteModalities& GetRemoteModalities() const;
108
109 void SetFindRequestHandlerFactory(IFindRequestHandlerFactory& handler);
110 bool HasFindRequestHandlerFactory() const;
111 IFindRequestHandlerFactory& GetFindRequestHandlerFactory() const;
112
113 void SetMoveRequestHandlerFactory(IMoveRequestHandlerFactory& handler);
114 bool HasMoveRequestHandlerFactory() const;
115 IMoveRequestHandlerFactory& GetMoveRequestHandlerFactory() const;
116
117 void SetStoreRequestHandlerFactory(IStoreRequestHandlerFactory& handler);
118 bool HasStoreRequestHandlerFactory() const;
119 IStoreRequestHandlerFactory& GetStoreRequestHandlerFactory() const;
120
121 void SetWorklistRequestHandlerFactory(IWorklistRequestHandlerFactory& handler);
122 bool HasWorklistRequestHandlerFactory() const;
123 IWorklistRequestHandlerFactory& GetWorklistRequestHandlerFactory() const;
124
125 void SetApplicationEntityFilter(IApplicationEntityFilter& handler);
126 bool HasApplicationEntityFilter() const;
127 IApplicationEntityFilter& GetApplicationEntityFilter() const;
128
129 void Start();
130
131 void Stop();
132
133 bool IsMyAETitle(const std::string& aet) const;
134 };
135
136 }