return 0;
}
-int CompatUtility::GetCheckableInCheckPeriod(const Checkable::Ptr& checkable)
-{
- TimePeriod::Ptr timeperiod = checkable->GetCheckPeriod();
-
- /* none set means always checked */
- if (!timeperiod)
- return 1;
-
- return (timeperiod->IsInside(Utility::GetTime()) ? 1 : 0);
-}
-
int CompatUtility::GetCheckableInNotificationPeriod(const Checkable::Ptr& checkable)
{
for (const Notification::Ptr& notification : checkable->GetNotifications()) {
static String GetCheckableCheckPeriod(const Checkable::Ptr& checkable);
static int GetCheckableNoMoreNotifications(const Checkable::Ptr& checkable);
- static int GetCheckableInCheckPeriod(const Checkable::Ptr& checkable);
static int GetCheckableInNotificationPeriod(const Checkable::Ptr& checkable);
/* notification */
if (!host)
return Empty;
- return CompatUtility::GetCheckableInCheckPeriod(host);
+ TimePeriod::Ptr timeperiod = host->GetCheckPeriod();
+
+ /* none set means always checked */
+ if (!timeperiod)
+ return 1;
+
+ return Convert::ToLong(timeperiod->IsInside(Utility::GetTime()));
}
Value HostsTable::ContactsAccessor(const Value& row)
if (!service)
return Empty;
- return CompatUtility::GetCheckableInCheckPeriod(service);
+ TimePeriod::Ptr timeperiod = service->GetCheckPeriod();
+
+ /* none set means always checked */
+ if (!timeperiod)
+ return 1;
+
+ return Convert::ToLong(timeperiod->IsInside(Utility::GetTime()));
}
Value ServicesTable::InNotificationPeriodAccessor(const Value& row)