Mercurial > hg > orthanc
annotate OrthancServer/Plugins/Engine/OrthancPluginDatabaseV4.h @ 5310:b5c502bcaf99
added a route to DELETE /jobs/../archive
author | Alain Mazy <am@osimis.io> |
---|---|
date | Mon, 12 Jun 2023 18:42:06 +0200 |
parents | df39c7583a49 |
children | 176bc05f85f4 48b8dae6dc77 |
rev | line source |
---|---|
5207
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Orthanc - A Lightweight, RESTful DICOM Store |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * This program is free software: you can redistribute it and/or |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * modify it under the terms of the GNU General Public License as |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * published by the Free Software Foundation, either version 3 of the |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * License, or (at your option) any later version. |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * This program is distributed in the hope that it will be useful, but |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * WITHOUT ANY WARRANTY; without even the implied warranty of |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * General Public License for more details. |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * You should have received a copy of the GNU General Public License |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 **/ |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 #pragma once |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 #if ORTHANC_ENABLE_PLUGINS == 1 |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 #include "../../../OrthancFramework/Sources/SharedLibrary.h" |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 #include "../../Sources/Database/IDatabaseWrapper.h" |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 #include "../Include/orthanc/OrthancCPlugin.h" |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 #include "PluginsErrorDictionary.h" |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 namespace Orthanc |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 { |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 class OrthancPluginDatabaseV4 : public IDatabaseWrapper |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 { |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 private: |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 class Transaction; |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 SharedLibrary& library_; |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 PluginsErrorDictionary& errorDictionary_; |
5209
154d37a56500
started implementation of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5207
diff
changeset
|
41 _OrthancPluginRegisterDatabaseBackendV4 definition_; |
5207
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 std::string serverIdentifier_; |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 bool open_; |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 unsigned int databaseVersion_; |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 bool hasFlushToDisk_; |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 bool hasRevisionsSupport_; |
5220
df39c7583a49
preparing virtual methods for labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5211
diff
changeset
|
47 bool hasLabelsSupport_; |
5207
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 void CheckSuccess(OrthancPluginErrorCode code) const; |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 public: |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 OrthancPluginDatabaseV4(SharedLibrary& library, |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 PluginsErrorDictionary& errorDictionary, |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 const _OrthancPluginRegisterDatabaseBackendV4& database, |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 const std::string& serverIdentifier); |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 virtual ~OrthancPluginDatabaseV4(); |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 |
5209
154d37a56500
started implementation of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5207
diff
changeset
|
59 const _OrthancPluginRegisterDatabaseBackendV4& GetDefinition() const |
154d37a56500
started implementation of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5207
diff
changeset
|
60 { |
154d37a56500
started implementation of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5207
diff
changeset
|
61 return definition_; |
154d37a56500
started implementation of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5207
diff
changeset
|
62 } |
154d37a56500
started implementation of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5207
diff
changeset
|
63 |
154d37a56500
started implementation of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5207
diff
changeset
|
64 PluginsErrorDictionary& GetErrorDictionary() const |
154d37a56500
started implementation of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5207
diff
changeset
|
65 { |
154d37a56500
started implementation of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5207
diff
changeset
|
66 return errorDictionary_; |
154d37a56500
started implementation of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5207
diff
changeset
|
67 } |
154d37a56500
started implementation of transactions
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5207
diff
changeset
|
68 |
5211
27e6ec2811e3
completed first implementation of OrthancPluginDatabaseV4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5209
diff
changeset
|
69 const std::string& GetServerIdentifier() const |
27e6ec2811e3
completed first implementation of OrthancPluginDatabaseV4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5209
diff
changeset
|
70 { |
27e6ec2811e3
completed first implementation of OrthancPluginDatabaseV4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5209
diff
changeset
|
71 return serverIdentifier_; |
27e6ec2811e3
completed first implementation of OrthancPluginDatabaseV4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5209
diff
changeset
|
72 } |
27e6ec2811e3
completed first implementation of OrthancPluginDatabaseV4
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5209
diff
changeset
|
73 |
5207
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 virtual void Open() ORTHANC_OVERRIDE; |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 virtual void Close() ORTHANC_OVERRIDE; |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 const SharedLibrary& GetSharedLibrary() const |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 { |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 return library_; |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 } |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 virtual void FlushToDisk() ORTHANC_OVERRIDE; |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 virtual bool HasFlushToDisk() const ORTHANC_OVERRIDE; |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 virtual IDatabaseWrapper::ITransaction* StartTransaction(TransactionType type, |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 IDatabaseListener& listener) |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 ORTHANC_OVERRIDE; |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 virtual unsigned int GetDatabaseVersion() ORTHANC_OVERRIDE; |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 virtual void Upgrade(unsigned int targetVersion, |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 IStorageArea& storageArea) ORTHANC_OVERRIDE; |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 virtual bool HasRevisionsSupport() const ORTHANC_OVERRIDE; |
5220
df39c7583a49
preparing virtual methods for labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5211
diff
changeset
|
97 |
df39c7583a49
preparing virtual methods for labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5211
diff
changeset
|
98 virtual bool HasLabelsSupport() const ORTHANC_OVERRIDE; |
5207
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 }; |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 } |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 |
e7529e6241d2
first successful protobuf communication
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 #endif |