Drop CompatUtility::GetCheckableHasBeenChecked() and use Checkable::HasBeenChecked()

This commit is contained in:
Michael Friedrich 2017-12-05 14:23:15 +01:00
parent 3847e37df1
commit 334f633b0a
7 changed files with 5 additions and 11 deletions

View File

@ -338,7 +338,7 @@ void StatusDataWriter::DumpCheckableStatusAttrs(std::ostream& fp, const Checkabl
"\t" "check_period=" << CompatUtility::GetCheckableCheckPeriod(checkable) << "\n"
"\t" "check_interval=" << CompatUtility::GetCheckableCheckInterval(checkable) << "\n"
"\t" "retry_interval=" << CompatUtility::GetCheckableRetryInterval(checkable) << "\n"
"\t" "has_been_checked=" << CompatUtility::GetCheckableHasBeenChecked(checkable) << "\n"
"\t" "has_been_checked=" << (checkable->HasBeenChecked() ? 1 : 0) << "\n"
"\t" "should_be_scheduled=" << checkable->GetEnableActiveChecks() << "\n"
"\t" "event_handler_enabled=" << CompatUtility::GetCheckableEventHandlerEnabled(checkable) << "\n";

View File

@ -132,7 +132,7 @@ Dictionary::Ptr HostDbObject::GetStatusFields() const
}
fields->Set("current_state", CompatUtility::GetHostCurrentState(host));
fields->Set("has_been_checked", CompatUtility::GetCheckableHasBeenChecked(host));
fields->Set("has_been_checked", host->HasBeenChecked());
fields->Set("should_be_scheduled", host->GetEnableActiveChecks());
fields->Set("current_check_attempt", host->GetCheckAttempt());
fields->Set("max_check_attempts", host->GetMaxCheckAttempts());

View File

@ -119,7 +119,7 @@ Dictionary::Ptr ServiceDbObject::GetStatusFields() const
}
fields->Set("current_state", service->GetState());
fields->Set("has_been_checked", CompatUtility::GetCheckableHasBeenChecked(service));
fields->Set("has_been_checked", service->HasBeenChecked());
fields->Set("should_be_scheduled", service->GetEnableActiveChecks());
fields->Set("current_check_attempt", service->GetCheckAttempt());
fields->Set("max_check_attempts", service->GetMaxCheckAttempts());

View File

@ -202,11 +202,6 @@ String CompatUtility::GetCheckableCheckPeriod(const Checkable::Ptr& checkable)
return "24x7";
}
int CompatUtility::GetCheckableHasBeenChecked(const Checkable::Ptr& checkable)
{
return (checkable->GetLastCheckResult() ? 1 : 0);
}
int CompatUtility::GetCheckablePassiveChecksEnabled(const Checkable::Ptr& checkable)
{
return (checkable->GetEnablePassiveChecks() ? 1 : 0);

View File

@ -54,7 +54,6 @@ public:
static double GetCheckableCheckInterval(const Checkable::Ptr& checkable);
static double GetCheckableRetryInterval(const Checkable::Ptr& checkable);
static String GetCheckableCheckPeriod(const Checkable::Ptr& checkable);
static int GetCheckableHasBeenChecked(const Checkable::Ptr& checkable);
static int GetCheckablePassiveChecksEnabled(const Checkable::Ptr& checkable);
static int GetCheckableActiveChecksEnabled(const Checkable::Ptr& checkable);
static int GetCheckableEventHandlerEnabled(const Checkable::Ptr& checkable);

View File

@ -602,7 +602,7 @@ Value HostsTable::HasBeenCheckedAccessor(const Value& row)
if (!host)
return Empty;
return CompatUtility::GetCheckableHasBeenChecked(host);
return Convert::ToLong(host->HasBeenChecked());
}
Value HostsTable::CurrentNotificationNumberAccessor(const Value& row)

View File

@ -509,7 +509,7 @@ Value ServicesTable::HasBeenCheckedAccessor(const Value& row)
if (!service)
return Empty;
return CompatUtility::GetCheckableHasBeenChecked(service);
return Convert::ToLong(service->HasBeenChecked());
}
Value ServicesTable::LastStateAccessor(const Value& row)