comparison OrthancServer/Plugins/Samples/MultitenantDicom/MultitenantDicomServer.h @ 5273:7cb1b851f5c8

Added a sample plugin bringing multitenant DICOM support through labels
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 14 Apr 2023 11:49:24 +0200
parents
children 49477780e25a
comparison
equal deleted inserted replaced
5272:a45e8b6115f6 5273:7cb1b851f5c8
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-2023 Osimis S.A., Belgium
6 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
7 *
8 * This program is free software: you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation, either version 3 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program. If not, see
20 * <http://www.gnu.org/licenses/>.
21 **/
22
23
24 #pragma once
25
26 #include "DicomFilter.h"
27 #include "PluginEnumerations.h"
28
29 #include "../../../../OrthancFramework/Sources/DicomNetworking/DicomServer.h"
30
31 #include <boost/thread/mutex.hpp>
32
33
34 class MultitenantDicomServer :
35 private Orthanc::DicomServer::IRemoteModalities,
36 private Orthanc::IFindRequestHandlerFactory,
37 private Orthanc::IMoveRequestHandlerFactory,
38 private Orthanc::IStoreRequestHandlerFactory
39 {
40 private:
41 virtual bool IsSameAETitle(const std::string& aet1,
42 const std::string& aet2) ORTHANC_OVERRIDE;
43
44 virtual bool LookupAETitle(Orthanc::RemoteModalityParameters& parameters,
45 const std::string& aet) ORTHANC_OVERRIDE;
46
47 virtual Orthanc::IFindRequestHandler* ConstructFindRequestHandler() ORTHANC_OVERRIDE;
48
49 virtual Orthanc::IMoveRequestHandler* ConstructMoveRequestHandler() ORTHANC_OVERRIDE;
50
51 virtual Orthanc::IStoreRequestHandler* ConstructStoreRequestHandler() ORTHANC_OVERRIDE;
52
53 boost::mutex mutex_;
54
55 std::set<std::string> labels_;
56 LabelsConstraint labelsConstraint_;
57 std::set<Orthanc::ResourceType> labelsStoreLevels_;
58 bool isSynchronousCMove_;
59 bool isStrictAet_;
60 DicomFilter filter_;
61 std::unique_ptr<Orthanc::DicomServer> server_;
62
63 public:
64 MultitenantDicomServer(const Json::Value& serverConfig);
65
66 void Start();
67
68 void Stop();
69 };