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<TypedEventPublisher<AlertStatusEvent>> 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:253
void Publish(const AlertInfo &reduced, const std::vector< AlertInfo > &alerts) noexcept override
Definition alertService.cpp:260
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:230
AlertLogger()
Definition alertService.cpp:227
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:204
AlertOldbPublisher(const std::string &name, OldbIf &oldb)
Constructor.
Definition alertService.cpp:190
Alert Service interface.
Definition alertServiceIf.hpp:128
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:65
~AlertStatus()
Definition alertService.cpp:56
void ClearAlerts()
Definition alertService.cpp:119
void AddObserver(std::unique_ptr< AlertObserverIf > o)
Definition alertService.cpp:60
AlertInfo GetInfo(const std::string &id)
Definition alertService.cpp:150
AlertStatus()
Definition alertService.cpp:52
void SetAlert(const std::string &id, bool state=true)
Definition alertService.cpp:82
Interface class for providing pub/sub facilities for JSON events.
Definition eventServiceIf.hpp:29
Base interface for all OLDB adapters.
Definition oldbIf.hpp:25
A high-level event service API that is aware of event types.
Definition typedEventService.hpp:247
Framework-provided event definitions.
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:45
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
High-level API of the event service.