NTP Analyzer  0.8.2
Analyze the operation of time servers
Ntp.Analyzer.Process.Description.HostPageJob Class Reference
Inheritance diagram for Ntp.Analyzer.Process.Description.HostPageJob:
Collaboration diagram for Ntp.Analyzer.Process.Description.HostPageJob:

Public Member Functions

 HostPageJob (MenuConfiguration menu, HostPageConfiguration page, LogBase log)
 
- Public Member Functions inherited from Ntp.Common.Process.JobDescription
override string ToString ()
 Returns a string that represents the current JobDescription. More...
 

Public Attributes

override string JobType => "Host page build"
 
override int Priority => 10
 
override ThreadType ThreadType => ThreadType.MultiThreaded
 
- Public Attributes inherited from Ntp.Common.Process.JobDescription
string Name => Configuration.ConfigName
 Gets the name. More...
 

Protected Member Functions

override void InternalExecute ()
 Implementing method for descendants. More...
 
- Protected Member Functions inherited from Ntp.Analyzer.Process.Description.StreamJob
 StreamJob (IJobConfiguration config, LogBase log)
 
void SaveStream (IStreamGenerator generator)
 
void SaveStream (IStreamGenerator generator, string file)
 
- Protected Member Functions inherited from Ntp.Common.Process.JobDescription
 JobDescription (IJobConfiguration config, LogBase log)
 Initializes a new instance of the JobDescription class. More...
 

Private Attributes

readonly MenuConfiguration menu
 
readonly HostPageConfiguration page
 

Additional Inherited Members

- Package Functions inherited from Ntp.Common.Process.JobDescription
void Execute ()
 Perform execution of this instance. More...
 
- Properties inherited from Ntp.Common.Process.JobDescription
IJobConfiguration Configuration [get]
 Gets the configuration for the job. More...
 
abstract string JobType [get]
 Gets the type of the job as text. More...
 
LogBase Log [get]
 Gets the log to use when registering events. More...
 
abstract int Priority [get]
 Gets the priority to use when scheduling jobs. More...
 
abstract ThreadType ThreadType [get]
 Gets a value indicating whether this JobDescription should run as a single thread. More...
 

Detailed Description

Definition at line 34 of file HostPageJob.cs.

Constructor & Destructor Documentation

Ntp.Analyzer.Process.Description.HostPageJob.HostPageJob ( MenuConfiguration  menu,
HostPageConfiguration  page,
LogBase  log 
)
inline

Definition at line 36 of file HostPageJob.cs.

37  : base(page, log)
38  {
39  this.menu = menu;
40  this.page = page;
41  }
readonly HostPageConfiguration page
Definition: HostPageJob.cs:44

Member Function Documentation

override void Ntp.Analyzer.Process.Description.HostPageJob.InternalExecute ( )
inlineprotectedvirtual

Implementing method for descendants.

Implements Ntp.Common.Process.JobDescription.

Definition at line 52 of file HostPageJob.cs.

References Ntp.Analyzer.Statistics.StatusBuilder.Build(), Ntp.Analyzer.Data.DataFace.Hosts, and Ntp.Analyzer.Data.DataFace.Instance.

53  {
54  var host = DataFace.Instance.Hosts.SingleOrDefault(h => h.Id == page.HostId);
55  if (host == null)
56  {
57  Log.HostNotFound(page.HostId);
58  return;
59  }
60 
61  var builder = page.QueryDirect
63  : (StatusBuilder) new DbStatusBuilder(host);
64 
65  builder.Build();
66 
67  var pageBuilder = page.Theme == PageTheme.Bootstrap
68  ? new BootstrapHostPageBuilder(menu, page, builder.Entries.ToArray())
69  : (PageBuilderBase) new DefaultHostPageBuilder(page, builder.Entries.ToArray());
70 
71  SaveStream(pageBuilder);
72  }
string ServerName
Gets the name of the server in the HostSubConfiguration.
HostDatabaseMapper Hosts
Gets the host mapper.
Definition: DataFace.cs:57
Build a HTML status page showing the state of a hosted NTP server.
LogBase Log
Gets the log to use when registering events.
void SaveStream(IStreamGenerator generator)
Definition: StreamJob.cs:36
int HostId
Gets the host identifier in the HostSubConfiguration.
Singleton facade class used to access memory persistent data.
Definition: DataFace.cs:30
readonly HostPageConfiguration page
Definition: HostPageJob.cs:44
static DataFace Instance
Gets the Singleton instance.
Definition: DataFace.cs:51
ServerType ServerType
Gets the type of the server in the HostSubConfiguration.

Here is the call graph for this function:

Member Data Documentation

override string Ntp.Analyzer.Process.Description.HostPageJob.JobType => "Host page build"

Definition at line 48 of file HostPageJob.cs.

readonly MenuConfiguration Ntp.Analyzer.Process.Description.HostPageJob.menu
private

Definition at line 43 of file HostPageJob.cs.

readonly HostPageConfiguration Ntp.Analyzer.Process.Description.HostPageJob.page
private

Definition at line 44 of file HostPageJob.cs.

override int Ntp.Analyzer.Process.Description.HostPageJob.Priority => 10

Definition at line 50 of file HostPageJob.cs.

override ThreadType Ntp.Analyzer.Process.Description.HostPageJob.ThreadType => ThreadType.MultiThreaded

Definition at line 46 of file HostPageJob.cs.


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