summaryrefslogtreecommitdiffstats
path: root/lib/icinga/apievents.hpp
blob: 07d5c60131ac6419c63f0783d75cc68f5065378e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */

#ifndef APIEVENTS_H
#define APIEVENTS_H

#include "remote/eventqueue.hpp"
#include "icinga/checkable.hpp"
#include "icinga/host.hpp"

namespace icinga
{

/**
 * @ingroup icinga
 */
class ApiEvents
{
public:
	static void StaticInitialize();

	static void CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, const MessageOrigin::Ptr& origin);
	static void StateChangeHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr, StateType type, const MessageOrigin::Ptr& origin);


	static void NotificationSentToAllUsersHandler(const Notification::Ptr& notification, const Checkable::Ptr& checkable,
		const std::set<User::Ptr>& users, NotificationType type, const CheckResult::Ptr& cr, const String& author,
		const String& text, const MessageOrigin::Ptr& origin);

	static void FlappingChangedHandler(const Checkable::Ptr& checkable, const MessageOrigin::Ptr& origin);

	static void AcknowledgementSetHandler(const Checkable::Ptr& checkable,
		const String& author, const String& comment, AcknowledgementType type,
		bool notify, bool persistent, double, double expiry, const MessageOrigin::Ptr& origin);
	static void AcknowledgementClearedHandler(const Checkable::Ptr& checkable, const String& removedBy, double, const MessageOrigin::Ptr& origin);

	static void CommentAddedHandler(const Comment::Ptr& comment);
	static void CommentRemovedHandler(const Comment::Ptr& comment);

	static void DowntimeAddedHandler(const Downtime::Ptr& downtime);
	static void DowntimeRemovedHandler(const Downtime::Ptr& downtime);
	static void DowntimeStartedHandler(const Downtime::Ptr& downtime);
	static void DowntimeTriggeredHandler(const Downtime::Ptr& downtime);

	static void OnActiveChangedHandler(const ConfigObject::Ptr& object, const Value&);
	static void OnVersionChangedHandler(const ConfigObject::Ptr& object, const Value&);
	static void SendObjectChangeEvent(const ConfigObject::Ptr& object, const EventType& eventType, const String& eventQueue);
};

}

#endif /* APIEVENTS_H */