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

Public Member Functions

 PeerPageJob (MenuConfiguration menu, PeerPageConfiguration 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 => "Peer pages build"
 
override int Priority => 11
 
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 PeerPageConfiguration 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 33 of file PeerPageJob.cs.

Constructor & Destructor Documentation

Ntp.Analyzer.Process.Description.PeerPageJob.PeerPageJob ( MenuConfiguration  menu,
PeerPageConfiguration  page,
LogBase  log 
)
inline

Definition at line 35 of file PeerPageJob.cs.

39  : base(page, log)
40  {
41  this.menu = menu;
42  this.page = page;
43  }
readonly PeerPageConfiguration page
Definition: PeerPageJob.cs:46

Member Function Documentation

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

Implementing method for descendants.

Implements Ntp.Common.Process.JobDescription.

Definition at line 54 of file PeerPageJob.cs.

References Ntp.Analyzer.Data.DataFace.Hosts, Ntp.Analyzer.Data.DataFace.Instance, and Ntp.Analyzer.Data.DataFace.PeerActivities.

55  {
56  var host = DataFace.Instance.Hosts.SingleOrDefault(h => h.Id == page.HostId);
57  if (host == null)
58  {
59  Log.HostNotFound(page.HostId);
60  return;
61  }
62 
63  var peers = DataFace.Instance.PeerActivities.Where(p => Equals(p.Host, host) && p.IsActive);
64 
65  foreach (var entry in peers)
66  {
67  var peerPageBuilder = page.Theme == PageTheme.Bootstrap
68  ? new BootstrapPeerPageBuilder(host, entry.Peer, menu, page)
69  : (PageBuilderBase) new DefaultPeerPageBuilder(entry.Peer, page);
70 
71  SaveStream(peerPageBuilder, entry.Name + ".html");
72  }
73  }
HostDatabaseMapper Hosts
Gets the host mapper.
Definition: DataFace.cs:57
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
PeerActivityDatabaseMapper PeerActivities
Gets the peer activity mapper.
Definition: DataFace.cs:99
readonly PeerPageConfiguration page
Definition: PeerPageJob.cs:46
static DataFace Instance
Gets the Singleton instance.
Definition: DataFace.cs:51

Member Data Documentation

override string Ntp.Analyzer.Process.Description.PeerPageJob.JobType => "Peer pages build"

Definition at line 50 of file PeerPageJob.cs.

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

Definition at line 45 of file PeerPageJob.cs.

readonly PeerPageConfiguration Ntp.Analyzer.Process.Description.PeerPageJob.page
private

Definition at line 46 of file PeerPageJob.cs.

override int Ntp.Analyzer.Process.Description.PeerPageJob.Priority => 11

Definition at line 52 of file PeerPageJob.cs.

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

Definition at line 48 of file PeerPageJob.cs.


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