MonitorConfig getMonitorConfig(ReverseUrl url) {
String key = url.getServiceUrl().getPath();
if (key == null) {
key = "default";
}
MonitorConfig config = new MonitorConfig();
String checkUrl = monitorProps.getProperty(key + ".url");
URL u = url.getReverse();
if (checkUrl == null) {
checkUrl = defaultCheckUrl;
}
if (checkUrl.startsWith("http://")==false
&& checkUrl.startsWith("https://")==false) {
checkUrl = u != null ? u.toString() + checkUrl : checkUrl;
}
config.setUrl(checkUrl);
config.setInterval(StringUtils.parse(
monitorProps.getProperty(key + ".interval"), defaultInterval)
);
config.setTimeout(StringUtils.parse(
monitorProps.getProperty(key + ".timeout"), defaultTimeout)
);
return config;
}