Add OnEnableEventHandlerChanged event

refs #5219
This commit is contained in:
Michael Friedrich 2014-08-26 11:48:46 +02:00
parent fca79dd66c
commit d53fced691
2 changed files with 8 additions and 2 deletions

View File

@ -26,6 +26,7 @@
using namespace icinga; using namespace icinga;
boost::signals2::signal<void (const Checkable::Ptr&)> Checkable::OnEventCommandExecuted; boost::signals2::signal<void (const Checkable::Ptr&)> Checkable::OnEventCommandExecuted;
boost::signals2::signal<void (const Checkable::Ptr&, bool, const MessageOrigin&)> Checkable::OnEnableEventHandlerChanged;
bool Checkable::GetEnableEventHandler(void) const bool Checkable::GetEnableEventHandler(void) const
{ {
@ -35,9 +36,11 @@ bool Checkable::GetEnableEventHandler(void) const
return GetEnableEventHandlerRaw(); return GetEnableEventHandlerRaw();
} }
void Checkable::SetEnableEventHandler(bool enabled) void Checkable::SetEnableEventHandler(bool enabled, const MessageOrigin& origin)
{ {
SetOverrideEnableEventHandler(enabled); SetOverrideEnableEventHandler(enabled);
OnEnableEventHandlerChanged(GetSelf(), enabled, origin);
} }
EventCommand::Ptr Checkable::GetEventCommand(void) const EventCommand::Ptr Checkable::GetEventCommand(void) const

View File

@ -153,6 +153,9 @@ public:
static boost::signals2::signal<void (const Checkable::Ptr&, bool, const MessageOrigin&)> OnEnableNotificationsChanged; static boost::signals2::signal<void (const Checkable::Ptr&, bool, const MessageOrigin&)> OnEnableNotificationsChanged;
static boost::signals2::signal<void (const Checkable::Ptr&, bool, const MessageOrigin&)> OnEnableFlappingChanged; static boost::signals2::signal<void (const Checkable::Ptr&, bool, const MessageOrigin&)> OnEnableFlappingChanged;
static boost::signals2::signal<void (const Checkable::Ptr&, bool, const MessageOrigin&)> OnEnablePerfdataChanged; static boost::signals2::signal<void (const Checkable::Ptr&, bool, const MessageOrigin&)> OnEnablePerfdataChanged;
static boost::signals2::signal<void (const Checkable::Ptr&, bool, const MessageOrigin&)> OnEnableEventHandlerChanged;
static boost::signals2::signal<void (const Checkable::Ptr&, const CheckResult::Ptr&, const MessageOrigin&)> OnNewCheckResult; static boost::signals2::signal<void (const Checkable::Ptr&, const CheckResult::Ptr&, const MessageOrigin&)> OnNewCheckResult;
static boost::signals2::signal<void (const Checkable::Ptr&, const CheckResult::Ptr&, StateType, const MessageOrigin&)> OnStateChange; static boost::signals2::signal<void (const Checkable::Ptr&, const CheckResult::Ptr&, StateType, const MessageOrigin&)> OnStateChange;
static boost::signals2::signal<void (const Checkable::Ptr&, NotificationType, const CheckResult::Ptr&, static boost::signals2::signal<void (const Checkable::Ptr&, NotificationType, const CheckResult::Ptr&,
@ -238,7 +241,7 @@ public:
void SetEventCommand(const shared_ptr<EventCommand>& command); void SetEventCommand(const shared_ptr<EventCommand>& command);
bool GetEnableEventHandler(void) const; bool GetEnableEventHandler(void) const;
void SetEnableEventHandler(bool enabled); void SetEnableEventHandler(bool enabled, const MessageOrigin& origin = MessageOrigin());
/* Flapping Detection */ /* Flapping Detection */
double GetFlappingCurrent(void) const; double GetFlappingCurrent(void) const;