Mercurial > hg > orthanc
annotate OrthancServer/Sources/ServerIndexChange.h @ 4819:70d2a97ca8cb openssl-3.x
integration mainline->openssl-3.x
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 25 Nov 2021 13:12:32 +0100 |
parents | f0038043fb97 |
children | 2e71a08eea15 |
rev | line source |
---|---|
1198 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
1900 | 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
1288
6e7e5ed91c2d
upgrade to year 2015
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1242
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
4437
d9473bd5ed43
upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4045
diff
changeset
|
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium |
1198 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
8 * modify it under the terms of the GNU General Public License as | |
9 * published by the Free Software Foundation, either version 3 of the | |
10 * License, or (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, but | |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 * General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU General Public License | |
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 **/ | |
20 | |
21 | |
22 #pragma once | |
23 | |
24 #include "ServerEnumerations.h" | |
4045 | 25 #include "../../OrthancFramework/Sources/IDynamicObject.h" |
26 #include "../../OrthancFramework/Sources/SystemToolbox.h" | |
1198 | 27 |
28 #include <string> | |
1240 | 29 #include <json/value.h> |
1198 | 30 |
31 namespace Orthanc | |
32 { | |
1436
0a3e3be59094
uncoupling of SignalChange for Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
33 struct ServerIndexChange : public IDynamicObject |
1198 | 34 { |
35 private: | |
1240 | 36 int64_t seq_; |
1198 | 37 ChangeType changeType_; |
38 ResourceType resourceType_; | |
39 std::string publicId_; | |
1240 | 40 std::string date_; |
1198 | 41 |
42 public: | |
43 ServerIndexChange(ChangeType changeType, | |
44 ResourceType resourceType, | |
1240 | 45 const std::string& publicId) : |
46 seq_(-1), | |
1198 | 47 changeType_(changeType), |
48 resourceType_(resourceType), | |
1240 | 49 publicId_(publicId), |
2475
8cc3ca64a534
Orthanc now uses UTC (universal time) instead of local time in its database
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2447
diff
changeset
|
50 date_(SystemToolbox::GetNowIsoString(true /* use UTC time (not local time) */)) |
1198 | 51 { |
52 } | |
53 | |
1240 | 54 ServerIndexChange(int64_t seq, |
55 ChangeType changeType, | |
56 ResourceType resourceType, | |
57 const std::string& publicId, | |
58 const std::string& date) : | |
59 seq_(seq), | |
60 changeType_(changeType), | |
61 resourceType_(resourceType), | |
62 publicId_(publicId), | |
63 date_(date) | |
64 { | |
65 } | |
66 | |
1436
0a3e3be59094
uncoupling of SignalChange for Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
67 ServerIndexChange(const ServerIndexChange& other) |
0a3e3be59094
uncoupling of SignalChange for Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
68 : seq_(other.seq_), |
0a3e3be59094
uncoupling of SignalChange for Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
69 changeType_(other.changeType_), |
0a3e3be59094
uncoupling of SignalChange for Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
70 resourceType_(other.resourceType_), |
0a3e3be59094
uncoupling of SignalChange for Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
71 publicId_(other.publicId_), |
0a3e3be59094
uncoupling of SignalChange for Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
72 date_(other.date_) |
0a3e3be59094
uncoupling of SignalChange for Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
73 { |
0a3e3be59094
uncoupling of SignalChange for Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
74 } |
0a3e3be59094
uncoupling of SignalChange for Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
75 |
0a3e3be59094
uncoupling of SignalChange for Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
76 ServerIndexChange* Clone() const |
0a3e3be59094
uncoupling of SignalChange for Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
77 { |
0a3e3be59094
uncoupling of SignalChange for Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
78 return new ServerIndexChange(*this); |
0a3e3be59094
uncoupling of SignalChange for Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
79 } |
0a3e3be59094
uncoupling of SignalChange for Lua scripts
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1288
diff
changeset
|
80 |
1240 | 81 int64_t GetSeq() const |
82 { | |
83 return seq_; | |
84 } | |
85 | |
1198 | 86 ChangeType GetChangeType() const |
87 { | |
88 return changeType_; | |
89 } | |
90 | |
91 ResourceType GetResourceType() const | |
92 { | |
93 return resourceType_; | |
94 } | |
95 | |
96 const std::string& GetPublicId() const | |
97 { | |
98 return publicId_; | |
99 } | |
1240 | 100 |
101 const std::string& GetDate() const | |
102 { | |
103 return date_; | |
104 } | |
105 | |
106 void Format(Json::Value& item) const | |
107 { | |
108 item = Json::objectValue; | |
109 item["Seq"] = static_cast<int>(seq_); | |
110 item["ChangeType"] = EnumerationToString(changeType_); | |
111 item["ResourceType"] = EnumerationToString(resourceType_); | |
112 item["ID"] = publicId_; | |
113 item["Path"] = GetBasePath(resourceType_, publicId_); | |
114 item["Date"] = date_; | |
115 } | |
1198 | 116 }; |
117 } |