Mercurial > hg > orthanc
annotate OrthancServer/Sources/Database/StatelessDatabaseOperations.h @ 5464:38f1d06875ad pg-transactions
delete attachment in case of same instance being uploaded multiple times at the same time
author | Alain Mazy <am@osimis.io> |
---|---|
date | Tue, 12 Dec 2023 17:20:10 +0100 |
parents | 176bc05f85f4 |
children | dceed5e3d6a9 |
rev | line source |
---|---|
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Orthanc - A Lightweight, RESTful DICOM Store |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
5185
0ea402b4d901
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5061
diff
changeset
|
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
0ea402b4d901
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5061
diff
changeset
|
6 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * This program is free software: you can redistribute it and/or |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * modify it under the terms of the GNU General Public License as |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * published by the Free Software Foundation, either version 3 of the |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * License, or (at your option) any later version. |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * This program is distributed in the hope that it will be useful, but |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * WITHOUT ANY WARRANTY; without even the implied warranty of |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * General Public License for more details. |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * You should have received a copy of the GNU General Public License |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 **/ |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 #pragma once |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 #include "../../../OrthancFramework/Sources/DicomFormat/DicomMap.h" |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 #include "IDatabaseWrapper.h" |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 #include "../DicomInstanceOrigin.h" |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 |
4594
d494b4f1103e
removed the global database mutex from ServerIndex and StatelessDatabaseOperations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4591
diff
changeset
|
30 #include <boost/shared_ptr.hpp> |
4613
2684544ff03c
maximum number of database retries for writer collisions is now set by the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4607
diff
changeset
|
31 #include <boost/thread/shared_mutex.hpp> |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 namespace Orthanc |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 { |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 class DatabaseLookup; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 class ParsedDicomFile; |
4588 | 38 struct ServerIndexChange; |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 |
5222
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
40 class ExpandedResource : public boost::noncopyable |
4935
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
41 { |
5222
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
42 private: |
4935
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
43 std::string id_; |
5222
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
44 ResourceType level_; |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
45 DicomMap tags_; // all main tags and main sequences from DB |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
46 |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
47 public: |
4935
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
48 std::string mainDicomTagsSignature_; |
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
49 std::string parentId_; |
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
50 std::list<std::string> childrenIds_; |
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
51 std::map<MetadataType, std::string> metadata_; |
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
52 std::string anonymizedFrom_; |
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
53 std::string modifiedFrom_; |
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
54 std::string lastUpdate_; |
4936
8422e4f99a18
Handling RequestedTags in ExpandResource -> read parent main dicom tags if required. Not yet getting missing tags from file. Integration tests ok
Alain Mazy <am@osimis.io>
parents:
4935
diff
changeset
|
55 std::set<DicomTag> missingRequestedTags_; |
4935
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
56 |
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
57 // for patients/studies/series |
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
58 bool isStable_; |
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
59 |
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
60 // for series only |
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
61 int expectedNumberOfInstances_; |
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
62 std::string status_; |
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
63 |
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
64 // for instances only |
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
65 size_t fileSize_; |
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
66 std::string fileUuid_; |
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
67 int indexInSeries_; |
5221
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
68 |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
69 // New in Orthanc 1.12.0 |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
70 std::set<std::string> labels_; |
5222
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
71 |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
72 public: |
5277 | 73 // TODO - Cleanup |
74 ExpandedResource() : | |
75 level_(ResourceType_Instance), | |
76 isStable_(false), | |
77 expectedNumberOfInstances_(0), | |
78 fileSize_(0), | |
79 indexInSeries_(0) | |
80 { | |
81 } | |
82 | |
5222
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
83 void SetResource(ResourceType level, |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
84 const std::string& id) |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
85 { |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
86 level_ = level; |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
87 id_ = id; |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
88 } |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
89 |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
90 const std::string& GetPublicId() const |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
91 { |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
92 return id_; |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
93 } |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
94 |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
95 ResourceType GetLevel() const |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
96 { |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
97 return level_; |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
98 } |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
99 |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
100 DicomMap& GetMainDicomTags() |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
101 { |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
102 return tags_; |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
103 } |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
104 |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
105 const DicomMap& GetMainDicomTags() const |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
106 { |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
107 return tags_; |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
108 } |
4935
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
109 }; |
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
110 |
5222
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
111 enum ExpandResourceFlags |
4940
304514ce84ee
tools/find + C-Find + list-resources now all using the same code (ExpandResource) to build 'computed tags'
Alain Mazy <am@osimis.io>
parents:
4939
diff
changeset
|
112 { |
5222
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
113 ExpandResourceFlags_None = 0, |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
114 ExpandResourceFlags_IncludeMetadata = (1 << 0), |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
115 ExpandResourceFlags_IncludeChildren = (1 << 1), |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
116 ExpandResourceFlags_IncludeMainDicomTags = (1 << 2), |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
117 ExpandResourceFlags_IncludeLabels = (1 << 3), |
4940
304514ce84ee
tools/find + C-Find + list-resources now all using the same code (ExpandResource) to build 'computed tags'
Alain Mazy <am@osimis.io>
parents:
4939
diff
changeset
|
118 |
5222
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
119 ExpandResourceFlags_Default = (ExpandResourceFlags_IncludeMetadata | |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
120 ExpandResourceFlags_IncludeChildren | |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
121 ExpandResourceFlags_IncludeMainDicomTags | |
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
122 ExpandResourceFlags_IncludeLabels) |
4940
304514ce84ee
tools/find + C-Find + list-resources now all using the same code (ExpandResource) to build 'computed tags'
Alain Mazy <am@osimis.io>
parents:
4939
diff
changeset
|
123 }; |
4935
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
124 |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
125 class StatelessDatabaseOperations : public boost::noncopyable |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
126 { |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
127 public: |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
128 typedef std::list<FileInfo> Attachments; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
129 typedef std::map<std::pair<ResourceType, MetadataType>, std::string> MetadataMap; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
130 |
5221
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
131 enum LabelOperation |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
132 { |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
133 LabelOperation_Add, |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
134 LabelOperation_Remove |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
135 }; |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
136 |
4589
bec74e29f86b
attaching the listener to transactions in IDatabaseWrapper
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4588
diff
changeset
|
137 class ITransactionContext : public IDatabaseListener |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
138 { |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
139 public: |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
140 virtual ~ITransactionContext() |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
141 { |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
142 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
143 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
144 virtual void Commit() = 0; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
145 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
146 virtual int64_t GetCompressedSizeDelta() = 0; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
147 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
148 virtual bool IsUnstableResource(int64_t id) = 0; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
149 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
150 virtual bool LookupRemainingLevel(std::string& remainingPublicId /* out */, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
151 ResourceType& remainingLevel /* out */) = 0; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
152 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
153 virtual void MarkAsUnstable(int64_t id, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
154 Orthanc::ResourceType type, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
155 const std::string& publicId) = 0; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
156 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
157 virtual void SignalAttachmentsAdded(uint64_t compressedSize) = 0; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
158 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
159 virtual void SignalChange(const ServerIndexChange& change) = 0; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
160 }; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
161 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
162 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
163 class ITransactionContextFactory : public boost::noncopyable |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
164 { |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
165 public: |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
166 virtual ~ITransactionContextFactory() |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
167 { |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
168 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
169 |
4594
d494b4f1103e
removed the global database mutex from ServerIndex and StatelessDatabaseOperations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4591
diff
changeset
|
170 // WARNING: This method can be invoked from several threads concurrently |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
171 virtual ITransactionContext* Create() = 0; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
172 }; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
173 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
174 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
175 class ReadOnlyTransaction : public boost::noncopyable |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
176 { |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
177 private: |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
178 ITransactionContext& context_; |
5455
176bc05f85f4
DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
5316
diff
changeset
|
179 const IDatabaseWrapper::Capabilities& dbCapabilities_; |
176bc05f85f4
DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
5316
diff
changeset
|
180 |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
181 protected: |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
182 IDatabaseWrapper::ITransaction& transaction_; |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
183 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
184 public: |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
185 explicit ReadOnlyTransaction(IDatabaseWrapper::ITransaction& transaction, |
5237
cd2258ca7894
log about missing support for labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5222
diff
changeset
|
186 ITransactionContext& context, |
5455
176bc05f85f4
DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
5316
diff
changeset
|
187 const IDatabaseWrapper::Capabilities& dbCapabilities) : |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
188 context_(context), |
5455
176bc05f85f4
DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
5316
diff
changeset
|
189 dbCapabilities_(dbCapabilities), |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
190 transaction_(transaction) |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
191 { |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
192 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
193 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
194 ITransactionContext& GetTransactionContext() |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
195 { |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
196 return context_; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
197 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
198 |
5455
176bc05f85f4
DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
5316
diff
changeset
|
199 const IDatabaseWrapper::Capabilities& GetDatabaseCapabilities() const |
5237
cd2258ca7894
log about missing support for labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5222
diff
changeset
|
200 { |
5455
176bc05f85f4
DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
5316
diff
changeset
|
201 return dbCapabilities_; |
5237
cd2258ca7894
log about missing support for labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5222
diff
changeset
|
202 } |
cd2258ca7894
log about missing support for labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5222
diff
changeset
|
203 |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
204 /** |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
205 * Higher-level constructions |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
206 **/ |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
207 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
208 SeriesStatus GetSeriesStatus(int64_t id, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
209 int64_t expectedNumberOfInstances); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
210 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
211 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
212 /** |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
213 * Read-only methods from "IDatabaseWrapper" |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
214 **/ |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
215 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
216 void ApplyLookupResources(std::list<std::string>& resourcesId, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
217 std::list<std::string>* instancesId, // Can be NULL if not needed |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
218 const std::vector<DatabaseConstraint>& lookup, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
219 ResourceType queryLevel, |
5248
a7d95f951f8a
replaced "WithLabels" and "WithoutLabels", by "Labels" and "LabelsConstraint"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5238
diff
changeset
|
220 const std::set<std::string>& labels, // New in Orthanc 1.12.0 |
a7d95f951f8a
replaced "WithLabels" and "WithoutLabels", by "Labels" and "LabelsConstraint"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5238
diff
changeset
|
221 LabelsConstraint labelsConstraint, // New in Orthanc 1.12.0 |
5220
df39c7583a49
preparing virtual methods for labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
222 uint32_t limit) |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
223 { |
5248
a7d95f951f8a
replaced "WithLabels" and "WithoutLabels", by "Labels" and "LabelsConstraint"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5238
diff
changeset
|
224 return transaction_.ApplyLookupResources(resourcesId, instancesId, lookup, queryLevel, |
a7d95f951f8a
replaced "WithLabels" and "WithoutLabels", by "Labels" and "LabelsConstraint"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5238
diff
changeset
|
225 labels, labelsConstraint, limit); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
226 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
227 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
228 void GetAllMetadata(std::map<MetadataType, std::string>& target, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
229 int64_t id) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
230 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
231 transaction_.GetAllMetadata(target, id); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
232 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
233 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
234 void GetAllPublicIds(std::list<std::string>& target, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
235 ResourceType resourceType) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
236 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
237 return transaction_.GetAllPublicIds(target, resourceType); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
238 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
239 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
240 void GetAllPublicIds(std::list<std::string>& target, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
241 ResourceType resourceType, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
242 size_t since, |
5220
df39c7583a49
preparing virtual methods for labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
243 uint32_t limit) |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
244 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
245 return transaction_.GetAllPublicIds(target, resourceType, since, limit); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
246 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
247 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
248 void GetChanges(std::list<ServerIndexChange>& target /*out*/, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
249 bool& done /*out*/, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
250 int64_t since, |
5220
df39c7583a49
preparing virtual methods for labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
251 uint32_t limit) |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
252 { |
5220
df39c7583a49
preparing virtual methods for labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
253 transaction_.GetChanges(target, done, since, limit); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
254 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
255 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
256 void GetChildrenInternalId(std::list<int64_t>& target, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
257 int64_t id) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
258 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
259 transaction_.GetChildrenInternalId(target, id); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
260 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
261 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
262 void GetChildrenPublicId(std::list<std::string>& target, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
263 int64_t id) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
264 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
265 transaction_.GetChildrenPublicId(target, id); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
266 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
267 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
268 void GetExportedResources(std::list<ExportedResource>& target /*out*/, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
269 bool& done /*out*/, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
270 int64_t since, |
5220
df39c7583a49
preparing virtual methods for labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
271 uint32_t limit) |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
272 { |
5220
df39c7583a49
preparing virtual methods for labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
273 return transaction_.GetExportedResources(target, done, since, limit); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
274 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
275 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
276 void GetLastChange(std::list<ServerIndexChange>& target /*out*/) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
277 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
278 transaction_.GetLastChange(target); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
279 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
280 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
281 void GetLastExportedResource(std::list<ExportedResource>& target /*out*/) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
282 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
283 return transaction_.GetLastExportedResource(target); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
284 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
285 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
286 int64_t GetLastChangeIndex() |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
287 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
288 return transaction_.GetLastChangeIndex(); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
289 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
290 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
291 void GetMainDicomTags(DicomMap& map, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
292 int64_t id) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
293 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
294 transaction_.GetMainDicomTags(map, id); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
295 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
296 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
297 std::string GetPublicId(int64_t resourceId) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
298 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
299 return transaction_.GetPublicId(resourceId); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
300 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
301 |
4595
cc64385593ef
added OrthancPluginRegisterDatabaseBackendV3() to plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4594
diff
changeset
|
302 uint64_t GetResourcesCount(ResourceType resourceType) |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
303 { |
4595
cc64385593ef
added OrthancPluginRegisterDatabaseBackendV3() to plugin sdk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4594
diff
changeset
|
304 return transaction_.GetResourcesCount(resourceType); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
305 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
306 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
307 ResourceType GetResourceType(int64_t resourceId) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
308 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
309 return transaction_.GetResourceType(resourceId); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
310 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
311 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
312 uint64_t GetTotalCompressedSize() |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
313 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
314 return transaction_.GetTotalCompressedSize(); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
315 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
316 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
317 uint64_t GetTotalUncompressedSize() |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
318 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
319 return transaction_.GetTotalUncompressedSize(); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
320 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
321 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
322 bool IsProtectedPatient(int64_t internalId) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
323 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
324 return transaction_.IsProtectedPatient(internalId); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
325 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
326 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
327 void ListAvailableAttachments(std::set<FileContentType>& target, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
328 int64_t id) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
329 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
330 transaction_.ListAvailableAttachments(target, id); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
331 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
332 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
333 bool LookupAttachment(FileInfo& attachment, |
4627
f7d5372b59b3
handling revisions of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4623
diff
changeset
|
334 int64_t& revision, |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
335 int64_t id, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
336 FileContentType contentType) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
337 { |
4627
f7d5372b59b3
handling revisions of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4623
diff
changeset
|
338 return transaction_.LookupAttachment(attachment, revision, id, contentType); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
339 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
340 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
341 bool LookupGlobalProperty(std::string& target, |
4607
f75c63aa9de0
differentiating between shared and private global properties
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4595
diff
changeset
|
342 GlobalProperty property, |
f75c63aa9de0
differentiating between shared and private global properties
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4595
diff
changeset
|
343 bool shared) |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
344 { |
4607
f75c63aa9de0
differentiating between shared and private global properties
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4595
diff
changeset
|
345 return transaction_.LookupGlobalProperty(target, property, shared); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
346 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
347 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
348 bool LookupMetadata(std::string& target, |
4623
95ffe3b6ef7c
handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4613
diff
changeset
|
349 int64_t& revision, |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
350 int64_t id, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
351 MetadataType type) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
352 { |
4623
95ffe3b6ef7c
handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4613
diff
changeset
|
353 return transaction_.LookupMetadata(target, revision, id, type); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
354 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
355 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
356 bool LookupParent(int64_t& parentId, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
357 int64_t resourceId) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
358 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
359 return transaction_.LookupParent(parentId, resourceId); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
360 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
361 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
362 bool LookupResource(int64_t& id, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
363 ResourceType& type, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
364 const std::string& publicId) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
365 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
366 return transaction_.LookupResource(id, type, publicId); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
367 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
368 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
369 bool LookupResourceAndParent(int64_t& id, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
370 ResourceType& type, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
371 std::string& parentPublicId, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
372 const std::string& publicId) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
373 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
374 return transaction_.LookupResourceAndParent(id, type, parentPublicId, publicId); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
375 } |
5221
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
376 |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
377 void ListLabels(std::set<std::string>& target, |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
378 int64_t id) |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
379 { |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
380 transaction_.ListLabels(target, id); |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
381 } |
5249
f22c8fac764b
added "/tools/labels" to list all the labels that are associated with any resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5248
diff
changeset
|
382 |
f22c8fac764b
added "/tools/labels" to list all the labels that are associated with any resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5248
diff
changeset
|
383 void ListAllLabels(std::set<std::string>& target) |
f22c8fac764b
added "/tools/labels" to list all the labels that are associated with any resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5248
diff
changeset
|
384 { |
f22c8fac764b
added "/tools/labels" to list all the labels that are associated with any resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5248
diff
changeset
|
385 transaction_.ListAllLabels(target); |
f22c8fac764b
added "/tools/labels" to list all the labels that are associated with any resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5248
diff
changeset
|
386 } |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
387 }; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
388 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
389 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
390 class ReadWriteTransaction : public ReadOnlyTransaction |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
391 { |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
392 public: |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
393 ReadWriteTransaction(IDatabaseWrapper::ITransaction& transaction, |
5237
cd2258ca7894
log about missing support for labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5222
diff
changeset
|
394 ITransactionContext& context, |
5455
176bc05f85f4
DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
5316
diff
changeset
|
395 const IDatabaseWrapper::Capabilities& dbCapabilities) : |
176bc05f85f4
DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
5316
diff
changeset
|
396 ReadOnlyTransaction(transaction, context, dbCapabilities) |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
397 { |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
398 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
399 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
400 void AddAttachment(int64_t id, |
4627
f7d5372b59b3
handling revisions of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4623
diff
changeset
|
401 const FileInfo& attachment, |
f7d5372b59b3
handling revisions of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4623
diff
changeset
|
402 int64_t revision) |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
403 { |
4627
f7d5372b59b3
handling revisions of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4623
diff
changeset
|
404 transaction_.AddAttachment(id, attachment, revision); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
405 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
406 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
407 void ClearChanges() |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
408 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
409 transaction_.ClearChanges(); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
410 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
411 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
412 void ClearExportedResources() |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
413 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
414 transaction_.ClearExportedResources(); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
415 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
416 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
417 void ClearMainDicomTags(int64_t id) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
418 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
419 return transaction_.ClearMainDicomTags(id); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
420 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
421 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
422 bool CreateInstance(IDatabaseWrapper::CreateInstanceResult& result, /* out */ |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
423 int64_t& instanceId, /* out */ |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
424 const std::string& patient, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
425 const std::string& study, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
426 const std::string& series, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
427 const std::string& instance) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
428 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
429 return transaction_.CreateInstance(result, instanceId, patient, study, series, instance); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
430 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
431 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
432 void DeleteAttachment(int64_t id, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
433 FileContentType attachment) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
434 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
435 return transaction_.DeleteAttachment(id, attachment); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
436 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
437 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
438 void DeleteMetadata(int64_t id, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
439 MetadataType type) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
440 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
441 transaction_.DeleteMetadata(id, type); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
442 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
443 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
444 void DeleteResource(int64_t id) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
445 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
446 transaction_.DeleteResource(id); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
447 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
448 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
449 void LogChange(int64_t internalId, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
450 ChangeType changeType, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
451 ResourceType resourceType, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
452 const std::string& publicId); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
453 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
454 void LogExportedResource(const ExportedResource& resource) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
455 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
456 transaction_.LogExportedResource(resource); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
457 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
458 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
459 void SetGlobalProperty(GlobalProperty property, |
4607
f75c63aa9de0
differentiating between shared and private global properties
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4595
diff
changeset
|
460 bool shared, |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
461 const std::string& value) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
462 { |
4607
f75c63aa9de0
differentiating between shared and private global properties
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4595
diff
changeset
|
463 transaction_.SetGlobalProperty(property, shared, value); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
464 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
465 |
5455
176bc05f85f4
DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
5316
diff
changeset
|
466 int64_t IncrementGlobalProperty(GlobalProperty sequence, |
176bc05f85f4
DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
5316
diff
changeset
|
467 bool shared, |
176bc05f85f4
DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
5316
diff
changeset
|
468 int64_t increment) |
176bc05f85f4
DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
5316
diff
changeset
|
469 { |
176bc05f85f4
DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
5316
diff
changeset
|
470 return transaction_.IncrementGlobalProperty(sequence, shared, increment); |
176bc05f85f4
DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
5316
diff
changeset
|
471 } |
176bc05f85f4
DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
5316
diff
changeset
|
472 |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
473 void SetMetadata(int64_t id, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
474 MetadataType type, |
4623
95ffe3b6ef7c
handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4613
diff
changeset
|
475 const std::string& value, |
95ffe3b6ef7c
handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4613
diff
changeset
|
476 int64_t revision) |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
477 { |
4623
95ffe3b6ef7c
handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4613
diff
changeset
|
478 return transaction_.SetMetadata(id, type, value, revision); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
479 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
480 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
481 void SetProtectedPatient(int64_t internalId, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
482 bool isProtected) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
483 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
484 transaction_.SetProtectedPatient(internalId, isProtected); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
485 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
486 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
487 void SetResourcesContent(const ResourcesContent& content) |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
488 { |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
489 transaction_.SetResourcesContent(content); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
490 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
491 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
492 void Recycle(uint64_t maximumStorageSize, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
493 unsigned int maximumPatients, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
494 uint64_t addedInstanceSize, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
495 const std::string& newPatientId); |
5061
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5044
diff
changeset
|
496 |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5044
diff
changeset
|
497 bool HasReachedMaxStorageSize(uint64_t maximumStorageSize, |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5044
diff
changeset
|
498 uint64_t addedInstanceSize); |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5044
diff
changeset
|
499 |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5044
diff
changeset
|
500 bool HasReachedMaxPatientCount(unsigned int maximumPatientCount, |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5044
diff
changeset
|
501 const std::string& patientId); |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5044
diff
changeset
|
502 |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5044
diff
changeset
|
503 bool IsRecyclingNeeded(uint64_t maximumStorageSize, |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5044
diff
changeset
|
504 unsigned int maximumPatients, |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5044
diff
changeset
|
505 uint64_t addedInstanceSize, |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5044
diff
changeset
|
506 const std::string& newPatientId); |
5221
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
507 |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
508 void AddLabel(int64_t id, |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
509 const std::string& label) |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
510 { |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
511 transaction_.AddLabel(id, label); |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
512 } |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
513 |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
514 void RemoveLabel(int64_t id, |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
515 const std::string& label) |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
516 { |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
517 transaction_.RemoveLabel(id, label); |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
518 } |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
519 }; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
520 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
521 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
522 class IReadOnlyOperations : public boost::noncopyable |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
523 { |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
524 public: |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
525 virtual ~IReadOnlyOperations() |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
526 { |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
527 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
528 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
529 virtual void Apply(ReadOnlyTransaction& transaction) = 0; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
530 }; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
531 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
532 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
533 class IReadWriteOperations : public boost::noncopyable |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
534 { |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
535 public: |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
536 virtual ~IReadWriteOperations() |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
537 { |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
538 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
539 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
540 virtual void Apply(ReadWriteTransaction& transaction) = 0; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
541 }; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
542 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
543 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
544 private: |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
545 class MainDicomTagsRegistry; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
546 class Transaction; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
547 |
4587
888868a5dc4e
ServerIndex now uses StatelessDatabaseOperations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4586
diff
changeset
|
548 IDatabaseWrapper& db_; |
4613
2684544ff03c
maximum number of database retries for writer collisions is now set by the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4607
diff
changeset
|
549 boost::shared_ptr<MainDicomTagsRegistry> mainDicomTagsRegistry_; // "shared_ptr" because of PImpl |
2684544ff03c
maximum number of database retries for writer collisions is now set by the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4607
diff
changeset
|
550 |
2684544ff03c
maximum number of database retries for writer collisions is now set by the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4607
diff
changeset
|
551 // Mutex to protect the configuration options |
2684544ff03c
maximum number of database retries for writer collisions is now set by the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4607
diff
changeset
|
552 boost::shared_mutex mutex_; |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
553 std::unique_ptr<ITransactionContextFactory> factory_; |
4587
888868a5dc4e
ServerIndex now uses StatelessDatabaseOperations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4586
diff
changeset
|
554 unsigned int maxRetries_; |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
555 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
556 void NormalizeLookup(std::vector<DatabaseConstraint>& target, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
557 const DatabaseLookup& source, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
558 ResourceType level) const; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
559 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
560 void ApplyInternal(IReadOnlyOperations* readOperations, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
561 IReadWriteOperations* writeOperations); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
562 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
563 protected: |
5061
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5044
diff
changeset
|
564 void StandaloneRecycling(MaxStorageMode maximumStorageMode, |
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5044
diff
changeset
|
565 uint64_t maximumStorageSize, |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
566 unsigned int maximumPatientCount); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
567 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
568 public: |
4591
ff8170d17d90
moving all accesses to databases from IDatabaseWrapper to ITransaction
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4589
diff
changeset
|
569 explicit StatelessDatabaseOperations(IDatabaseWrapper& database); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
570 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
571 void SetTransactionContextFactory(ITransactionContextFactory* factory /* takes ownership */); |
4613
2684544ff03c
maximum number of database retries for writer collisions is now set by the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4607
diff
changeset
|
572 |
2684544ff03c
maximum number of database retries for writer collisions is now set by the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4607
diff
changeset
|
573 // Only used to handle "ErrorCode_DatabaseCannotSerialize" in the |
2684544ff03c
maximum number of database retries for writer collisions is now set by the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4607
diff
changeset
|
574 // case of collision between multiple writers |
2684544ff03c
maximum number of database retries for writer collisions is now set by the plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4607
diff
changeset
|
575 void SetMaxDatabaseRetries(unsigned int maxRetries); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
576 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
577 // It is assumed that "GetDatabaseVersion()" can run out of a |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
578 // database transaction |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
579 unsigned int GetDatabaseVersion() |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
580 { |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
581 return db_.GetDatabaseVersion(); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
582 } |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
583 |
5455
176bc05f85f4
DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
5316
diff
changeset
|
584 const IDatabaseWrapper::Capabilities& GetDatabaseCapabilities() const |
176bc05f85f4
DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
5316
diff
changeset
|
585 { |
176bc05f85f4
DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
5316
diff
changeset
|
586 return db_.GetDatabaseCapabilities(); |
176bc05f85f4
DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
5316
diff
changeset
|
587 } |
176bc05f85f4
DB: new Capabilities class to manage future new methods from DB plugins + Added IncrementGlobalProperty
Alain Mazy <am@osimis.io>
parents:
5316
diff
changeset
|
588 |
4587
888868a5dc4e
ServerIndex now uses StatelessDatabaseOperations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4586
diff
changeset
|
589 void FlushToDisk(); |
888868a5dc4e
ServerIndex now uses StatelessDatabaseOperations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4586
diff
changeset
|
590 |
888868a5dc4e
ServerIndex now uses StatelessDatabaseOperations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4586
diff
changeset
|
591 |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
592 void Apply(IReadOnlyOperations& operations); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
593 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
594 void Apply(IReadWriteOperations& operations); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
595 |
4935
acd3f72e2a21
split ExpandResource in 2: read from DB and serialize to json. This will allow us to merge requested tags from both the DB and the file system
Alain Mazy <am@osimis.io>
parents:
4892
diff
changeset
|
596 bool ExpandResource(ExpandedResource& target, |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
597 const std::string& publicId, |
4697
569d9ef165b1
Added "short", "simplify" and/or "full" options to control the format of DICOM tags wherever possible
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4694
diff
changeset
|
598 ResourceType level, |
4940
304514ce84ee
tools/find + C-Find + list-resources now all using the same code (ExpandResource) to build 'computed tags'
Alain Mazy <am@osimis.io>
parents:
4939
diff
changeset
|
599 const std::set<DicomTag>& requestedTags, |
5222
3a61fd50f804
starting refactoring ExpandedResource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5221
diff
changeset
|
600 ExpandResourceFlags expandFlags); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
601 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
602 void GetAllMetadata(std::map<MetadataType, std::string>& target, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
603 const std::string& publicId, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
604 ResourceType level); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
605 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
606 void GetAllUuids(std::list<std::string>& target, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
607 ResourceType resourceType); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
608 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
609 void GetAllUuids(std::list<std::string>& target, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
610 ResourceType resourceType, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
611 size_t since, |
5220
df39c7583a49
preparing virtual methods for labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
612 uint32_t limit); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
613 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
614 void GetGlobalStatistics(/* out */ uint64_t& diskSize, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
615 /* out */ uint64_t& uncompressedSize, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
616 /* out */ uint64_t& countPatients, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
617 /* out */ uint64_t& countStudies, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
618 /* out */ uint64_t& countSeries, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
619 /* out */ uint64_t& countInstances); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
620 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
621 bool LookupAttachment(FileInfo& attachment, |
4627
f7d5372b59b3
handling revisions of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4623
diff
changeset
|
622 int64_t& revision, |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
623 const std::string& instancePublicId, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
624 FileContentType contentType); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
625 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
626 void GetChanges(Json::Value& target, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
627 int64_t since, |
5220
df39c7583a49
preparing virtual methods for labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
628 uint32_t limit); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
629 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
630 void GetLastChange(Json::Value& target); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
631 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
632 void GetExportedResources(Json::Value& target, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
633 int64_t since, |
5220
df39c7583a49
preparing virtual methods for labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
634 uint32_t limit); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
635 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
636 void GetLastExportedResource(Json::Value& target); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
637 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
638 bool IsProtectedPatient(const std::string& publicId); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
639 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
640 void GetChildren(std::list<std::string>& result, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
641 const std::string& publicId); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
642 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
643 void GetChildInstances(std::list<std::string>& result, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
644 const std::string& publicId); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
645 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
646 bool LookupMetadata(std::string& target, |
4623
95ffe3b6ef7c
handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4613
diff
changeset
|
647 int64_t& revision, |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
648 const std::string& publicId, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
649 ResourceType expectedType, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
650 MetadataType type); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
651 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
652 void ListAvailableAttachments(std::set<FileContentType>& target, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
653 const std::string& publicId, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
654 ResourceType expectedType); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
655 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
656 bool LookupParent(std::string& target, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
657 const std::string& publicId); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
658 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
659 void GetResourceStatistics(/* out */ ResourceType& type, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
660 /* out */ uint64_t& diskSize, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
661 /* out */ uint64_t& uncompressedSize, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
662 /* out */ unsigned int& countStudies, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
663 /* out */ unsigned int& countSeries, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
664 /* out */ unsigned int& countInstances, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
665 /* out */ uint64_t& dicomDiskSize, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
666 /* out */ uint64_t& dicomUncompressedSize, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
667 const std::string& publicId); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
668 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
669 void LookupIdentifierExact(std::vector<std::string>& result, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
670 ResourceType level, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
671 const DicomTag& tag, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
672 const std::string& value); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
673 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
674 bool LookupGlobalProperty(std::string& value, |
4607
f75c63aa9de0
differentiating between shared and private global properties
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4595
diff
changeset
|
675 GlobalProperty property, |
f75c63aa9de0
differentiating between shared and private global properties
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4595
diff
changeset
|
676 bool shared); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
677 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
678 std::string GetGlobalProperty(GlobalProperty property, |
4607
f75c63aa9de0
differentiating between shared and private global properties
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4595
diff
changeset
|
679 bool shared, |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
680 const std::string& defaultValue); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
681 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
682 bool GetMainDicomTags(DicomMap& result, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
683 const std::string& publicId, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
684 ResourceType expectedType, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
685 ResourceType levelOfInterest); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
686 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
687 // Only applicable at the instance level |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
688 bool GetAllMainDicomTags(DicomMap& result, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
689 const std::string& instancePublicId); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
690 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
691 bool LookupResourceType(ResourceType& type, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
692 const std::string& publicId); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
693 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
694 bool LookupParent(std::string& target, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
695 const std::string& publicId, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
696 ResourceType parentType); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
697 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
698 void ApplyLookupResources(std::vector<std::string>& resourcesId, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
699 std::vector<std::string>* instancesId, // Can be NULL if not needed |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
700 const DatabaseLookup& lookup, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
701 ResourceType queryLevel, |
5248
a7d95f951f8a
replaced "WithLabels" and "WithoutLabels", by "Labels" and "LabelsConstraint"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5238
diff
changeset
|
702 const std::set<std::string>& labels, |
a7d95f951f8a
replaced "WithLabels" and "WithoutLabels", by "Labels" and "LabelsConstraint"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5238
diff
changeset
|
703 LabelsConstraint labelsConstraint, |
5220
df39c7583a49
preparing virtual methods for labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5185
diff
changeset
|
704 uint32_t limit); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
705 |
4694
da1edb7d6332
"/tools/bulk-delete" to delete a group of multiple, unrelated resources at once
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4640
diff
changeset
|
706 bool DeleteResource(Json::Value& remainingAncestor /* out */, |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
707 const std::string& uuid, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
708 ResourceType expectedType); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
709 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
710 void LogExportedResource(const std::string& publicId, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
711 const std::string& remoteModality); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
712 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
713 void SetProtectedPatient(const std::string& publicId, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
714 bool isProtected); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
715 |
4623
95ffe3b6ef7c
handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4613
diff
changeset
|
716 void SetMetadata(int64_t& newRevision /*out*/, |
95ffe3b6ef7c
handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4613
diff
changeset
|
717 const std::string& publicId, |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
718 MetadataType type, |
4623
95ffe3b6ef7c
handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4613
diff
changeset
|
719 const std::string& value, |
95ffe3b6ef7c
handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4613
diff
changeset
|
720 bool hasOldRevision, |
4640
66109d24d26e
"ETag" headers for metadata and attachments now allow strong comparison (MD5 is included)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4627
diff
changeset
|
721 int64_t oldRevision, |
66109d24d26e
"ETag" headers for metadata and attachments now allow strong comparison (MD5 is included)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4627
diff
changeset
|
722 const std::string& oldMD5); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
723 |
4623
95ffe3b6ef7c
handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4613
diff
changeset
|
724 // Same as "SetMetadata()", but doesn't care about revisions |
95ffe3b6ef7c
handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4613
diff
changeset
|
725 void OverwriteMetadata(const std::string& publicId, |
95ffe3b6ef7c
handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4613
diff
changeset
|
726 MetadataType type, |
95ffe3b6ef7c
handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4613
diff
changeset
|
727 const std::string& value); |
95ffe3b6ef7c
handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4613
diff
changeset
|
728 |
95ffe3b6ef7c
handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4613
diff
changeset
|
729 bool DeleteMetadata(const std::string& publicId, |
95ffe3b6ef7c
handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4613
diff
changeset
|
730 MetadataType type, |
95ffe3b6ef7c
handling of revisions for metadata
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4613
diff
changeset
|
731 bool hasRevision, |
4640
66109d24d26e
"ETag" headers for metadata and attachments now allow strong comparison (MD5 is included)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4627
diff
changeset
|
732 int64_t revision, |
66109d24d26e
"ETag" headers for metadata and attachments now allow strong comparison (MD5 is included)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4627
diff
changeset
|
733 const std::string& md5); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
734 |
4607
f75c63aa9de0
differentiating between shared and private global properties
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4595
diff
changeset
|
735 uint64_t IncrementGlobalSequence(GlobalProperty sequence, |
f75c63aa9de0
differentiating between shared and private global properties
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4595
diff
changeset
|
736 bool shared); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
737 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
738 void DeleteChanges(); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
739 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
740 void DeleteExportedResources(); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
741 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
742 void SetGlobalProperty(GlobalProperty property, |
4607
f75c63aa9de0
differentiating between shared and private global properties
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4595
diff
changeset
|
743 bool shared, |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
744 const std::string& value); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
745 |
4627
f7d5372b59b3
handling revisions of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4623
diff
changeset
|
746 bool DeleteAttachment(const std::string& publicId, |
f7d5372b59b3
handling revisions of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4623
diff
changeset
|
747 FileContentType type, |
f7d5372b59b3
handling revisions of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4623
diff
changeset
|
748 bool hasRevision, |
4640
66109d24d26e
"ETag" headers for metadata and attachments now allow strong comparison (MD5 is included)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4627
diff
changeset
|
749 int64_t revision, |
66109d24d26e
"ETag" headers for metadata and attachments now allow strong comparison (MD5 is included)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4627
diff
changeset
|
750 const std::string& md5); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
751 |
4587
888868a5dc4e
ServerIndex now uses StatelessDatabaseOperations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4586
diff
changeset
|
752 void LogChange(int64_t internalId, |
888868a5dc4e
ServerIndex now uses StatelessDatabaseOperations
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4586
diff
changeset
|
753 ChangeType changeType, |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
754 const std::string& publicId, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
755 ResourceType level); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
756 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
757 void ReconstructInstance(const ParsedDicomFile& dicom); |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
758 |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
759 StoreStatus Store(std::map<MetadataType, std::string>& instanceMetadata, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
760 const DicomMap& dicomSummary, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
761 const Attachments& attachments, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
762 const MetadataMap& metadata, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
763 const DicomInstanceOrigin& origin, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
764 bool overwrite, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
765 bool hasTransferSyntax, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
766 DicomTransferSyntax transferSyntax, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
767 bool hasPixelDataOffset, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
768 uint64_t pixelDataOffset, |
5316
03501a258d9e
added instance metadata "PixelDataVR"
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5277
diff
changeset
|
769 ValueRepresentation pixelDataVR, |
5061
e95fadefeb72
new MaximumStorageMode configuration
Alain Mazy <am@osimis.io>
parents:
5044
diff
changeset
|
770 MaxStorageMode maximumStorageMode, |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
771 uint64_t maximumStorageSize, |
4988
8fba26292a9f
Housekeeper plugin: finalizing + integration tests ok
Alain Mazy <am@osimis.io>
parents:
4940
diff
changeset
|
772 unsigned int maximumPatients, |
8fba26292a9f
Housekeeper plugin: finalizing + integration tests ok
Alain Mazy <am@osimis.io>
parents:
4940
diff
changeset
|
773 bool isReconstruct); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
774 |
4627
f7d5372b59b3
handling revisions of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4623
diff
changeset
|
775 StoreStatus AddAttachment(int64_t& newRevision /*out*/, |
f7d5372b59b3
handling revisions of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4623
diff
changeset
|
776 const FileInfo& attachment, |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
777 const std::string& publicId, |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
778 uint64_t maximumStorageSize, |
4627
f7d5372b59b3
handling revisions of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4623
diff
changeset
|
779 unsigned int maximumPatients, |
f7d5372b59b3
handling revisions of attachments
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4623
diff
changeset
|
780 bool hasOldRevision, |
4640
66109d24d26e
"ETag" headers for metadata and attachments now allow strong comparison (MD5 is included)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4627
diff
changeset
|
781 int64_t oldRevision, |
66109d24d26e
"ETag" headers for metadata and attachments now allow strong comparison (MD5 is included)
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4627
diff
changeset
|
782 const std::string& oldMd5); |
5221
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
783 |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
784 void ListLabels(std::set<std::string>& target, |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
785 const std::string& publicId, |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
786 ResourceType level); |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
787 |
5249
f22c8fac764b
added "/tools/labels" to list all the labels that are associated with any resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5248
diff
changeset
|
788 void ListAllLabels(std::set<std::string>& target); |
f22c8fac764b
added "/tools/labels" to list all the labels that are associated with any resource
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5248
diff
changeset
|
789 |
5221
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
790 void ModifyLabel(const std::string& publicId, |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
791 ResourceType level, |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
792 const std::string& label, |
d0f7c742d397
started implementation of labels
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5220
diff
changeset
|
793 LabelOperation operation); |
5238
367e8af46cfd
added "HasLabels" in /system
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5237
diff
changeset
|
794 |
367e8af46cfd
added "HasLabels" in /system
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
5237
diff
changeset
|
795 bool HasLabelsSupport(); |
4586
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
796 }; |
1d96fe7e054e
taking StatelessDatabaseOperations out of ServerIndex
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
797 } |