PrivMX Endpoint v2.8.0
Loading...
Searching...
No Matches
Events.hpp
1#ifndef _PRIVMXLIB_ENDPOINT_KVDB_EVENTS_HPP_
2#define _PRIVMXLIB_ENDPOINT_KVDB_EVENTS_HPP_
3
4#include "privmx/endpoint/core/Events.hpp"
5#include "privmx/endpoint/core/Types.hpp"
6#include "privmx/endpoint/kvdb/Types.hpp"
7
8namespace privmx {
9namespace endpoint {
10namespace kvdb {
11
16
20 std::string kvdbId;
21};
22
27
31 std::string kvdbId;
32
37
41 int64_t entries;
42};
43
48
52 std::string kvdbId;
53
57 std::string kvdbEntryKey;
58};
59
61
65 KvdbCreatedEvent() : core::Event("kvdbCreated") {}
66
72 std::string toJSON() const override;
73
77 std::shared_ptr<core::SerializedEvent> serialize() const override;
78
83};
84
89
93 KvdbUpdatedEvent() : core::Event("kvdbUpdated") {}
94
100 std::string toJSON() const override;
101
105 std::shared_ptr<core::SerializedEvent> serialize() const override;
106
111};
112
117
121 KvdbDeletedEvent() : core::Event("kvdbDeleted") {}
122
128 std::string toJSON() const override;
129
133 std::shared_ptr<core::SerializedEvent> serialize() const override;
134
139};
140
145
149 KvdbStatsChangedEvent() : core::Event("kvdbStatsChanged") {}
150
156 std::string toJSON() const override;
157
161 std::shared_ptr<core::SerializedEvent> serialize() const override;
162
167};
168
173
177 KvdbNewEntryEvent() : core::Event("kvdbNewEntry") {}
178
184 std::string toJSON() const override;
185
189 std::shared_ptr<core::SerializedEvent> serialize() const override;
190
195};
196
201
205 KvdbEntryUpdatedEvent() : core::Event("kvdbEntryUpdated") {}
206
212 std::string toJSON() const override;
213
217 std::shared_ptr<core::SerializedEvent> serialize() const override;
218
223};
224
229
233 KvdbEntryDeletedEvent() : core::Event("kvdbEntryDeleted") {}
234
240 std::string toJSON() const override;
241
245 std::shared_ptr<core::SerializedEvent> serialize() const override;
246
251};
252
256class Events {
257public:
264 static bool isKvdbCreatedEvent(const core::EventHolder& eventHolder);
265
273
280 static bool isKvdbUpdatedEvent(const core::EventHolder& eventHolder);
281
289
296 static bool isKvdbDeletedEvent(const core::EventHolder& eventHolder);
297
305
312 static bool isKvdbStatsEvent(const core::EventHolder& eventHolder);
313
321
328 static bool isKvdbNewEntryEvent(const core::EventHolder& eventHolder);
329
337
344 static bool isKvdbEntryUpdatedEvent(const core::EventHolder& eventHolder);
345
353
360 static bool isKvdbEntryDeletedEvent(const core::EventHolder& eventHolder);
361
369};
370
371} // namespace kvdb
372} // namespace endpoint
373} // namespace privmx
374
375#endif
Definition Events.hpp:78
Definition Events.hpp:256
static KvdbUpdatedEvent extractKvdbUpdatedEvent(const core::EventHolder &eventHolder)
static bool isKvdbStatsEvent(const core::EventHolder &eventHolder)
static KvdbEntryUpdatedEvent extractKvdbEntryUpdatedEvent(const core::EventHolder &eventHolder)
static KvdbStatsChangedEvent extractKvdbStatsEvent(const core::EventHolder &eventHolder)
static KvdbCreatedEvent extractKvdbCreatedEvent(const core::EventHolder &eventHolder)
static bool isKvdbDeletedEvent(const core::EventHolder &eventHolder)
static bool isKvdbUpdatedEvent(const core::EventHolder &eventHolder)
static bool isKvdbEntryUpdatedEvent(const core::EventHolder &eventHolder)
static bool isKvdbNewEntryEvent(const core::EventHolder &eventHolder)
static bool isKvdbCreatedEvent(const core::EventHolder &eventHolder)
static KvdbDeletedEvent extractKvdbDeletedEvent(const core::EventHolder &eventHolder)
static KvdbEntryDeletedEvent extractKvdbEntryDeletedEvent(const core::EventHolder &eventHolder)
static bool isKvdbEntryDeletedEvent(const core::EventHolder &eventHolder)
static KvdbNewEntryEvent extractKvdbNewEntryEvent(const core::EventHolder &eventHolder)
Definition Events.hpp:19
Event(const std::string &type)
std::shared_ptr< core::SerializedEvent > serialize() const override
KvdbCreatedEvent()
Definition Events.hpp:65
std::string toJSON() const override
Kvdb data
Definition Events.hpp:82
std::string kvdbId
Definition Events.hpp:52
std::string kvdbEntryKey
Definition Events.hpp:57
std::string kvdbId
Definition Events.hpp:20
KvdbDeletedEventData data
Definition Events.hpp:138
std::string toJSON() const override
KvdbDeletedEvent()
Definition Events.hpp:121
std::shared_ptr< core::SerializedEvent > serialize() const override
std::shared_ptr< core::SerializedEvent > serialize() const override
KvdbDeletedEntryEventData data
Definition Events.hpp:250
KvdbEntryDeletedEvent()
Definition Events.hpp:233
kvdb::KvdbEntry data
Definition Events.hpp:222
std::shared_ptr< core::SerializedEvent > serialize() const override
KvdbEntryUpdatedEvent()
Definition Events.hpp:205
Definition Types.hpp:125
kvdb::KvdbEntry data
Definition Events.hpp:194
KvdbNewEntryEvent()
Definition Events.hpp:177
std::shared_ptr< core::SerializedEvent > serialize() const override
std::string toJSON() const override
KvdbStatsEventData data
Definition Events.hpp:166
KvdbStatsChangedEvent()
Definition Events.hpp:149
std::shared_ptr< core::SerializedEvent > serialize() const override
std::string kvdbId
Definition Events.hpp:31
int64_t lastEntryDate
Definition Events.hpp:36
int64_t entries
Definition Events.hpp:41
KvdbUpdatedEvent()
Definition Events.hpp:93
std::string toJSON() const override
Kvdb data
Definition Events.hpp:110
std::shared_ptr< core::SerializedEvent > serialize() const override
Definition Types.hpp:14