Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
EventLogs.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_LOGS_EVENTLOGS_HPP_
2#define IV_SRC_LOGS_EVENTLOGS_HPP_
3
5#include "core/Timestamp.hpp"
6#include "core/defines.hpp"
8#include "logs/structs.h"
10#include <set>
11
12#include <memory>
13
14namespace iv::logs
15{
16
18{
19 Backup,
20 Config,
21 Control,
22 Login
23};
24
26{
27public:
29 std::string_view message);
30
32 iv::diamar::eUserProfileType outUser, std::string_view message);
34 iv::types::ipPort port, std::string_view message);
35
38 std::string_view message);
39
40 static bool createBackUpAndRestoreEvent(iv::model::diamar::EventTypes type, std::string_view backupName,
41 std::string_view message);
42
43 static bool createConfigChangeEvent(iv::model::diamar::EventTypes type, std::string_view message);
44
45 static bool createOperatingSystemEvent(iv::model::diamar::EventTypes type, std::string_view message);
46
47 EventLogs() = delete;
48 EventLogs(const EventLogs &other) = delete;
49 EventLogs(EventLogs &&other) = delete;
50
51 ~EventLogs() = default;
52
53 EventLogs &operator=(const EventLogs &other) = delete;
54 EventLogs &operator=(EventLogs &&other) noexcept = delete;
55
56 static bool queryEvents(std::vector<std::shared_ptr<iv::model::diamar::AuditableEvent>> &eventsResult,
57 const iv::comms::api::ApiPaginationInfo &paginationInfo,
58 const std::vector<iv::model::diamar::EventCategory> &eventCategories,
59 const std::set<std::string> &stationsSource, const iv::types::timestamp startDate = 0,
60 const iv::types::timestamp endDate = iv::time::Timestamp().inMilliseconds());
61
62private:
64 static std::string m_source;
65 std::weak_ptr<iv::diamar::UserProfile> m_activeUser;
66};
67
68}// namespace iv::logs
69
70#endif//IV_SRC_LOGS_EVENTLOGS_HPP_
Definition EventLogs.hpp:26
static bool createControlSystemEvent(iv::model::diamar::EventTypes type, iv::types::unitId unitId, iv::types::channelId channelId, iv::types::groupId groupId, std::string_view message)
Definition EventLogs.cpp:194
static bool createConfigChangeEvent(iv::model::diamar::EventTypes type, std::string_view message)
Definition EventLogs.cpp:259
static bool createDefaultEvent(iv::model::diamar::EventCategory category, iv::model::diamar::EventTypes type, std::string_view message)
Definition EventLogs.cpp:15
std::weak_ptr< iv::diamar::UserProfile > m_activeUser
Definition EventLogs.hpp:65
EventLogs & operator=(EventLogs &&other) noexcept=delete
static bool createBackUpAndRestoreEvent(iv::model::diamar::EventTypes type, std::string_view backupName, std::string_view message)
Definition EventLogs.cpp:237
static bool createOperatingSystemEvent(iv::model::diamar::EventTypes type, std::string_view message)
Definition EventLogs.cpp:264
static bool queryEvents(std::vector< std::shared_ptr< iv::model::diamar::AuditableEvent > > &eventsResult, const iv::comms::api::ApiPaginationInfo &paginationInfo, const std::vector< iv::model::diamar::EventCategory > &eventCategories, const std::set< std::string > &stationsSource, const iv::types::timestamp startDate=0, const iv::types::timestamp endDate=iv::time::Timestamp().inMilliseconds())
Requests for events logs.
Definition EventLogs.cpp:39
static bool createEvent(const iv::comms::api::eventLogger::EventLoggerMessage &event)
Definition EventLogs.cpp:213
EventLogs(const EventLogs &other)=delete
static bool createAccessControlEvent(iv::model::diamar::EventTypes type, iv::diamar::eUserProfileType inUser, iv::diamar::eUserProfileType outUser, std::string_view message)
Definition EventLogs.cpp:153
static bool createRequestErrorsEvent(iv::model::diamar::EventTypes type, iv::types::ipAddress ip, iv::types::ipPort port, std::string_view message)
Definition EventLogs.cpp:177
static std::string m_source
Definition EventLogs.hpp:64
EventLogs(EventLogs &&other)=delete
EventLogs & operator=(const EventLogs &other)=delete
Definition Timestamp.hpp:17
eUserProfileType
Definition enums.hpp:34
Definition DownloadLogger.cpp:19
eEventCategory
Definition EventLogs.hpp:18
EventTypes
Definition AuditableEvents.hpp:23
EventCategory
Definition AuditableEvents.hpp:11
uint64_t timestamp
Definition types.hpp:21
uint16_t ipPort
Definition types.hpp:41
uint16_t unitId
Definition types.hpp:77
std::string ipAddress
Definition types.hpp:40
std::string channelId
Definition types.hpp:66
std::string groupId
Definition types.hpp:70
Definition structs.hpp:19