if (!service->HasAuthority("checker"))
return Utility::GetTime() + 60;
- double next = service->GetNextCheck();
-
- while (next == 0) {
- service->UpdateNextCheck();
- next = service->GetNextCheck();
- }
-
- return next;
+ return service->GetNextCheck();
}
};
{
SetNextNotificationRaw(time);
- Utility::QueueAsyncCallback(boost::bind(boost::ref(OnNextNotificationChanged), GetSelf(), time, authority));
+ OnNextNotificationChanged(GetSelf(), time, authority);
}
void Notification::UpdateNotificationNumber(void)
{
SetNextCheckRaw(nextCheck);
- Utility::QueueAsyncCallback(boost::bind(boost::ref(Service::OnNextCheckChanged), GetSelf(), nextCheck, authority));
+ OnNextCheckChanged(GetSelf(), nextCheck, authority);
}
double Service::GetNextCheck(void)
{
SetOverrideEnableActiveChecks(enabled);
- Utility::QueueAsyncCallback(boost::bind(boost::ref(OnEnableActiveChecksChanged), GetSelf(), enabled, authority));
+ OnEnableActiveChecksChanged(GetSelf(), enabled, authority);
}
bool Service::GetEnablePassiveChecks(void) const
{
SetOverrideEnablePassiveChecks(enabled);
- Utility::QueueAsyncCallback(boost::bind(boost::ref(OnEnablePassiveChecksChanged), GetSelf(), enabled, authority));
+ OnEnablePassiveChecksChanged(GetSelf(), enabled, authority);
}
bool Service::GetForceNextCheck(void) const
{
SetForceNextCheckRaw(forced);
- Utility::QueueAsyncCallback(boost::bind(boost::ref(OnForceNextCheckChanged), GetSelf(), forced, authority));
+ OnForceNextCheckChanged(GetSelf(), forced, authority);
}
void Service::ProcessCheckResult(const CheckResult::Ptr& cr, const String& authority)
// " threshold: " + Convert::ToString(GetFlappingThreshold()) +
// "% current: " + Convert::ToString(GetFlappingCurrent()) + "%.");
- Utility::QueueAsyncCallback(boost::bind(boost::ref(OnNewCheckResult), GetSelf(), cr, authority));
+ OnNewCheckResult(GetSelf(), cr, authority);
OnStateChanged(GetSelf());
- if (hardChange) {
- Utility::QueueAsyncCallback(boost::bind(boost::ref(OnStateChange), GetSelf(), cr, StateTypeHard, authority));
- }
- else if (stateChange) {
- Utility::QueueAsyncCallback(boost::bind(boost::ref(OnStateChange), GetSelf(), cr, StateTypeSoft, authority));
- }
+ if (hardChange)
+ OnStateChange(GetSelf(), cr, StateTypeHard, authority);
+ else if (stateChange)
+ OnStateChange(GetSelf(), cr, StateTypeSoft, authority);
if (call_eventhandler)
ExecuteEventHandler();
l_CommentsCache[uid] = GetSelf();
}
- Utility::QueueAsyncCallback(boost::bind(boost::ref(OnCommentAdded), GetSelf(), comment, authority));
+ OnCommentAdded(GetSelf(), comment, authority);
return uid;
}
l_CommentsCache.erase(id);
}
- Utility::QueueAsyncCallback(boost::bind(boost::ref(OnCommentRemoved), owner, comment, authority));
+ OnCommentRemoved(owner, comment, authority);
}
String Service::GetCommentIDFromLegacyID(int id)
Log(LogWarning, "icinga", "added downtime with ID '" + Convert::ToString(downtime->GetLegacyId()) + "'.");
- Utility::QueueAsyncCallback(boost::bind(boost::ref(OnDowntimeAdded), GetSelf(), downtime, authority));
+ OnDowntimeAdded(GetSelf(), downtime, authority);
return uid;
}
Log(LogWarning, "icinga", "removed downtime with ID '" + Convert::ToString(downtime->GetLegacyId()) + "' from service '" + owner->GetName() + "'.");
- Utility::QueueAsyncCallback(boost::bind(boost::ref(OnDowntimeRemoved), owner, downtime, authority));
+ OnDowntimeRemoved(owner, downtime, authority);
}
void Service::TriggerDowntimes(void)
TriggerDowntime(tid);
}
- Utility::QueueAsyncCallback(boost::bind(boost::ref(OnDowntimeTriggered), owner, downtime));
+ OnDowntimeTriggered(owner, downtime);
}
String Service::GetDowntimeIDFromLegacyID(int id)
SetEnableFlappingRaw(enabled);
OnFlappingChanged(GetSelf(), enabled ? FlappingEnabled : FlappingDisabled);
- Utility::QueueAsyncCallback(boost::bind(boost::ref(OnEnableFlappingChanged), GetSelf(), enabled, authority));
+ OnEnableFlappingChanged(GetSelf(), enabled, authority);
}
void Service::UpdateFlappingStatus(bool stateChange)
{
SetEnableNotificationsRaw(enabled);
- Utility::QueueAsyncCallback(boost::bind(boost::ref(OnEnableNotificationsChanged), GetSelf(), enabled, authority));
+ OnEnableNotificationsChanged(GetSelf(), enabled, authority);
}
bool Service::GetForceNextNotification(void) const
{
SetForceNextNotificationRaw(forced);
- Utility::QueueAsyncCallback(boost::bind(boost::ref(OnForceNextNotificationChanged), GetSelf(), forced, authority));
+ OnForceNextNotificationChanged(GetSelf(), forced, authority);
}
OnNotificationsRequested(GetSelf(), NotificationAcknowledgement, GetLastCheckResult(), author, comment);
- boost::function<void (void)> f = boost::bind(boost::ref(Service::OnAcknowledgementSet), GetSelf(), author, comment, type, expiry, authority);
- Utility::QueueAsyncCallback(f);
+ OnAcknowledgementSet(GetSelf(), author, comment, type, expiry, authority);
}
void Service::ClearAcknowledgement(const String& authority)
SetAcknowledgementRaw(AcknowledgementNone);
SetAcknowledgementExpiry(0);
- Utility::QueueAsyncCallback(boost::bind(boost::ref(OnAcknowledgementCleared), GetSelf(), authority));
+ OnAcknowledgementCleared(GetSelf(), authority);
}
std::set<Host::Ptr> Service::GetParentHosts(void) const