mirror of https://github.com/Icinga/icinga2.git
ModifiedAttributes for Enable* must call signals.
Refs #6151 Refs #5219
This commit is contained in:
parent
76658e7ddd
commit
7730cc9b52
|
@ -215,25 +215,35 @@ int Checkable::GetModifiedAttributes(void) const
|
|||
return attrs;
|
||||
}
|
||||
|
||||
void Checkable::SetModifiedAttributes(int flags)
|
||||
void Checkable::SetModifiedAttributes(int flags, const MessageOrigin& origin)
|
||||
{
|
||||
if ((flags & ModAttrNotificationsEnabled) == 0)
|
||||
if ((flags & ModAttrNotificationsEnabled) == 0) {
|
||||
SetOverrideEnableNotifications(Empty);
|
||||
OnEnableNotificationsChanged(GetSelf(), GetEnableNotifications(), origin);
|
||||
}
|
||||
|
||||
if ((flags & ModAttrActiveChecksEnabled) == 0)
|
||||
if ((flags & ModAttrActiveChecksEnabled) == 0) {
|
||||
SetOverrideEnableActiveChecks(Empty);
|
||||
OnEnableActiveChecksChanged(GetSelf(), GetEnableActiveChecks(), origin);
|
||||
}
|
||||
|
||||
if ((flags & ModAttrPassiveChecksEnabled) == 0)
|
||||
if ((flags & ModAttrPassiveChecksEnabled) == 0) {
|
||||
SetOverrideEnablePassiveChecks(Empty);
|
||||
OnEnablePassiveChecksChanged(GetSelf(), GetEnablePassiveChecks(), origin);
|
||||
}
|
||||
|
||||
if ((flags & ModAttrFlapDetectionEnabled) == 0)
|
||||
if ((flags & ModAttrFlapDetectionEnabled) == 0) {
|
||||
SetOverrideEnableFlapping(Empty);
|
||||
OnEnableFlappingChanged(GetSelf(), GetEnableFlapping(), origin);
|
||||
}
|
||||
|
||||
if ((flags & ModAttrEventHandlerEnabled) == 0)
|
||||
SetOverrideEnableEventHandler(Empty);
|
||||
|
||||
if ((flags & ModAttrPerformanceDataEnabled) == 0)
|
||||
if ((flags & ModAttrPerformanceDataEnabled) == 0) {
|
||||
SetOverrideEnablePerfdata(Empty);
|
||||
OnEnablePerfdataChanged(GetSelf(), GetEnablePerfdata(), origin);
|
||||
}
|
||||
|
||||
if ((flags & ModAttrNormalCheckInterval) == 0)
|
||||
SetOverrideCheckInterval(Empty);
|
||||
|
|
|
@ -143,7 +143,7 @@ public:
|
|||
void ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrigin& origin = MessageOrigin());
|
||||
|
||||
int GetModifiedAttributes(void) const;
|
||||
void SetModifiedAttributes(int flags);
|
||||
void SetModifiedAttributes(int flags, const MessageOrigin& origin = MessageOrigin());
|
||||
|
||||
bool IsCheckPending(void) const;
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ int Command::GetModifiedAttributes(void) const
|
|||
return attrs;
|
||||
}
|
||||
|
||||
void Command::SetModifiedAttributes(int flags)
|
||||
void Command::SetModifiedAttributes(int flags, const MessageOrigin& origin)
|
||||
{
|
||||
if ((flags & ModAttrCustomVariable) == 0) {
|
||||
SetOverrideVars(Empty);
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "base/i2-base.h"
|
||||
#include "base/array.h"
|
||||
#include "base/logger_fwd.h"
|
||||
#include "remote/messageorigin.h"
|
||||
#include <set>
|
||||
|
||||
namespace icinga
|
||||
|
@ -45,7 +46,7 @@ public:
|
|||
virtual bool ResolveMacro(const String& macro, const CheckResult::Ptr& cr, String *result) const;
|
||||
|
||||
int GetModifiedAttributes(void) const;
|
||||
void SetModifiedAttributes(int flags);
|
||||
void SetModifiedAttributes(int flags, const MessageOrigin& origin = MessageOrigin());
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ int User::GetModifiedAttributes(void) const
|
|||
return attrs;
|
||||
}
|
||||
|
||||
void User::SetModifiedAttributes(int flags)
|
||||
void User::SetModifiedAttributes(int flags, const MessageOrigin& origin)
|
||||
{
|
||||
if ((flags & ModAttrCustomVariable) == 0) {
|
||||
SetOverrideVars(Empty);
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "icinga/macroresolver.h"
|
||||
#include "icinga/timeperiod.h"
|
||||
#include "base/array.h"
|
||||
#include "remote/messageorigin.h"
|
||||
|
||||
namespace icinga
|
||||
{
|
||||
|
@ -48,7 +49,7 @@ public:
|
|||
static void ValidateFilters(const String& location, const Dictionary::Ptr& attrs);
|
||||
|
||||
int GetModifiedAttributes(void) const;
|
||||
void SetModifiedAttributes(int flags);
|
||||
void SetModifiedAttributes(int flags, const MessageOrigin& origin = MessageOrigin());
|
||||
|
||||
protected:
|
||||
virtual void Stop(void);
|
||||
|
|
Loading…
Reference in New Issue