REGISTER_CLASS(Service);
+const int Service::DefaultMaxAttempts = 3;
+const int Service::DefaultCheckInterval = 5 * 60;
+const int Service::MinCheckInterval = 15;
+const int Service::CheckIntervalDivisor = 5;
+
boost::signal<void (const Service::Ptr&, const CheckResultMessage&)> Service::OnCheckResultReceived;
boost::signal<void (const Service::Ptr&, const String&)> Service::OnCheckerChanged;
Value value = Get("max_check_attempts");
if (value.IsEmpty())
- return 3;
+ return DefaultMaxCheckAttempts;
return value;
}
Value value = Get("check_interval");
if (value.IsEmpty())
- return 300;
+ return DefaultCheckInterval;
- if (value < 15)
- value = 15;
+ if (value < MinCheckInterval)
+ value = MinCheckInterval;
return value;
}
Value value = Get("retry_interval");
if (value.IsEmpty())
- return GetCheckInterval() / 5;
+ return GetCheckInterval() / CheckIntervalDivisor;
return value;
}
static bool Exists(const String& name);
static Service::Ptr GetByName(const String& name);
+ static const int DefaultMaxAttempts;
+ static const int DefaultCheckInterval;
+ static const int MinCheckInterval;
+ static const int CheckIntervalDivisor;
+
String GetAlias(void) const;
Host::Ptr GetHost(void) const;
Dictionary::Ptr GetMacros(void) const;