29 namespace Ntp.Analyzer.Data.Import
42 protected abstract string Provider {
get; }
61 Log.TimeServerMaxId(Provider);
65 string html = Download(url, orgId);
69 Log.TimeServerNotReceived(orgId);
77 var client =
new WebClient();
81 "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2;)" 84 var stream = client.OpenRead(url);
85 Log.TimeServerDownload(Provider, url, orgId);
89 var reader =
new StreamReader(stream);
90 string html = reader.ReadToEnd();
95 catch (WebException
e)
97 var response = e.Response as HttpWebResponse;
98 if (response != null && response.StatusCode == HttpStatusCode.NotFound)
100 Log.TimeServerNotFound(Provider, orgId);
104 Log.TimeServerError(Provider, orgId);
111 Log.TimeServerError(Provider, orgId);
string FetchHtml(string url, int orgId)
TimeServerWebAdapter(LogBase log)
static void Initialize(bool enable)
static TimeServerWebAdapter Create(LogBase log)
string Download(string url, int orgId)