return value;
}
+Dictionary::Ptr Service::GetCheckers(void) const
+{
+ Dictionary::Ptr value;
+ GetConfigObject()->GetProperty("checkers", &value);
+ return value;
+}
+
void Service::SetNextCheck(time_t nextCheck)
{
GetConfigObject()->SetTag("next_check", (long)nextCheck);
bool Service::IsAllowedChecker(const string& checker) const
{
- /* TODO: check config */
- return true;
+ Dictionary::Ptr checkers = GetCheckers();
+
+ if (!checkers)
+ return true;
+
+ Dictionary::Iterator it;
+ for (it = checkers->Begin(); it != checkers->End(); it++) {
+ string pattern = it->second;
+
+ if (Utility::Match(pattern, checker))
+ return true;
+ }
+
+ return false;
}
+
long GetFreshnessInterval(void) const;
Dictionary::Ptr GetDependencies(void) const;
Dictionary::Ptr GetGroups(void) const;
+ Dictionary::Ptr GetCheckers(void) const;
void SetNextCheck(time_t nextCheck);
time_t GetNextCheck(void);
m_StatusTimer->OnTimerExpired.connect(boost::bind(&CompatComponent::StatusTimerHandler, this));
m_StatusTimer->Start();
+ CIB::RequireInformation(CIB_Configuration);
CIB::RequireInformation(CIB_ProgramStatus);
CIB::RequireInformation(CIB_ServiceStatus);
}