]> granicus.if.org Git - icinga2/blob - lib/notification/notificationcomponent.hpp
Merge pull request #7185 from Icinga/bugfix/gelfwriter-wrong-log-facility
[icinga2] / lib / notification / notificationcomponent.hpp
1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
2
3 #ifndef NOTIFICATIONCOMPONENT_H
4 #define NOTIFICATIONCOMPONENT_H
5
6 #include "notification/notificationcomponent-ti.hpp"
7 #include "icinga/service.hpp"
8 #include "base/configobject.hpp"
9 #include "base/timer.hpp"
10
11 namespace icinga
12 {
13
14 /**
15  * @ingroup notification
16  */
17 class NotificationComponent final : public ObjectImpl<NotificationComponent>
18 {
19 public:
20         DECLARE_OBJECT(NotificationComponent);
21         DECLARE_OBJECTNAME(NotificationComponent);
22
23         static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
24
25         void Start(bool runtimeCreated) override;
26         void Stop(bool runtimeRemoved) override;
27
28 private:
29         Timer::Ptr m_NotificationTimer;
30
31         void NotificationTimerHandler();
32         void SendNotificationsHandler(const Checkable::Ptr& checkable, NotificationType type,
33                 const CheckResult::Ptr& cr, const String& author, const String& text);
34 };
35
36 }
37
38 #endif /* NOTIFICATIONCOMPONENT_H */