12#ifndef RTCTK_COMPONENTFRAMEWORK_ALERTSERVICE_HPP
13#define RTCTK_COMPONENTFRAMEWORK_ALERTSERVICE_HPP
21#include <taiclock/taiClock.hpp>
65 log4cplus::Logger m_logger;
80 log4cplus::Logger m_logger;
103 std::unique_ptr<EventPublisherIf> m_publisher;
104 log4cplus::Logger m_logger;
114 void AddAlert(
const std::string&
id,
const std::string& text);
116 void SetAlert(
const std::string&
id,
bool state =
true);
123 std::recursive_mutex m_mtx;
125 std::vector<AlertInfo> m_alerts;
127 std::vector<std::unique_ptr<AlertObserverIf>> m_observers;
Alert observer that publishes alerts to Event Channel.
Definition alertService.hpp:89
AlertEventPublisher(const std::string &name, EventServiceIf &ev)
Constructor.
Definition alertService.cpp:262
void Publish(const AlertInfo &reduced, const std::vector< AlertInfo > &alerts) noexcept override
Definition alertService.cpp:269
Alert observer that publishes alerts to Log Files.
Definition alertService.hpp:74
void Publish(const AlertInfo &reduced, const std::vector< AlertInfo > &alerts) noexcept override
Definition alertService.cpp:239
AlertLogger()
Definition alertService.cpp:236
Alert observer that publishes alerts to Online Database.
Definition alertService.hpp:51
void Publish(const AlertInfo &reduced, const std::vector< AlertInfo > &alerts) noexcept override
Definition alertService.cpp:213
AlertOldbPublisher(const std::string &name, OldbIf &oldb)
Constructor.
Definition alertService.cpp:199
Alert Service interface.
Definition alertServiceIf.hpp:138
Definition alertService.hpp:130
bool GetStatus() override
Returns the overall alert status.
Definition alertService.hpp:140
void ClearAll() override
Clears all active alerts.
Definition alertService.hpp:144
AlertSource MakeAlertSource(const std::string &id, const std::string &text) override
Creates a new alert source for a specified alert condition.
Definition alertService.hpp:136
void AddObserver(std::unique_ptr< AlertObserverIf > o)
Definition alertService.hpp:132
Models a single alert source that can be set or cleared.
Definition alertServiceIf.hpp:47
Definition alertService.hpp:107
void AddAlert(const std::string &id, const std::string &text)
Definition alertService.cpp:66
~AlertStatus()
Definition alertService.cpp:57
void ClearAlerts()
Definition alertService.cpp:120
void AddObserver(std::unique_ptr< AlertObserverIf > o)
Definition alertService.cpp:61
AlertInfo GetInfo(const std::string &id)
Definition alertService.cpp:151
AlertStatus()
Definition alertService.cpp:53
void SetAlert(const std::string &id, bool state=true)
Definition alertService.cpp:83
Interface class for providing pub/sub facilities for JSON events.
Definition eventServiceIf.hpp:29
Base interface for all OLDB adapters.
Definition oldbIf.hpp:25
Framework-provided event definitions.
Low-level interface of the event service.
Logging Support Library based on log4cplus.
Definition commandReplier.cpp:22
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23
Header file for OldbIf, which defines the API for OldbAdapters.
Definition alertService.hpp:28
taiclock::TaiClock::time_point TimePoint
Definition alertService.hpp:29
std::string text
Definition alertService.hpp:36
std::string id
Definition alertService.hpp:35
AlertInfo(bool state, TimePoint since, const std::string &id, const std::string &text)
Definition alertService.cpp:46
bool state
Definition alertService.hpp:33
TimePoint since
Definition alertService.hpp:34
Definition alertService.hpp:39
virtual ~AlertObserverIf()=default
virtual void Publish(const AlertInfo &reduced, const std::vector< AlertInfo > &alerts) noexcept=0