NTP Analyzer  0.8.2
Analyze the operation of time servers
Ntp.Analyzer.Data.Import.ExactlyAdapter Class Reference
Inheritance diagram for Ntp.Analyzer.Data.Import.ExactlyAdapter:
Collaboration diagram for Ntp.Analyzer.Data.Import.ExactlyAdapter:

Public Member Functions

 ExactlyAdapter (LogBase log)
 
override TimeServer Import (int orgId)
 

Protected Attributes

override string Provider => "ntp.exactlywww.com"
 
- Protected Attributes inherited from Ntp.Analyzer.Data.Import.TimeServerWebAdapter
readonly LogBase Log
 

Additional Inherited Members

- Static Public Member Functions inherited from Ntp.Analyzer.Data.Import.TimeServerWebAdapter
static TimeServerWebAdapter Create (LogBase log)
 
static void Initialize (bool enable)
 
- Protected Member Functions inherited from Ntp.Analyzer.Data.Import.TimeServerWebAdapter
 TimeServerWebAdapter (LogBase log)
 
string FetchHtml (string url, int orgId)
 
- Properties inherited from Ntp.Analyzer.Data.Import.TimeServerWebAdapter
abstract string Provider [get]
 

Detailed Description

Definition at line 30 of file ExactlyAdapter.cs.

Constructor & Destructor Documentation

Ntp.Analyzer.Data.Import.ExactlyAdapter.ExactlyAdapter ( LogBase  log)
inline

Definition at line 32 of file ExactlyAdapter.cs.

33  : base(log)
34  {
35  }

Member Function Documentation

override TimeServer Ntp.Analyzer.Data.Import.ExactlyAdapter.Import ( int  orgId)
inlinevirtual

Implements Ntp.Analyzer.Data.Import.TimeServerWebAdapter.

Definition at line 39 of file ExactlyAdapter.cs.

References e, and Ntp.Analyzer.Objects.ExactlyTimeServer.SetOrgId().

40  {
41  string url = $"http://ntp.exactlywww.com/ntp/api/?id={orgId}";
42  string json = FetchHtml(url, orgId);
43 
44  if (json == null)
45  return null;
46 
47  ExactlyTimeServer server;
48 
49  try
50  {
51  server = JsonConvert.DeserializeObject<ExactlyTimeServer>(json);
52  server.SetOrgId(orgId);
53  }
54  catch (Exception e)
55  {
56  Log.TimeServerParseError("json", e);
57  return null;
58  }
59 
60  return server;
61  }
var e
Definition: bootstrap.min.js:6

Here is the call graph for this function:

Member Data Documentation

override string Ntp.Analyzer.Data.Import.ExactlyAdapter.Provider => "ntp.exactlywww.com"
protected

Definition at line 37 of file ExactlyAdapter.cs.


The documentation for this class was generated from the following file: