NTP Analyzer  0.8.2
Analyze the operation of time servers
Configuration.cs
Go to the documentation of this file.
1 //
2 // Copyright (c) 2013-2017 Carsten Sonne Larsen <cs@innolan.net>
3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to deal
6 // in the Software without restriction, including without limitation the rights
7 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 // copies of the Software, and to permit persons to whom the Software is
9 // furnished to do so, subject to the following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included in
12 // all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 // THE SOFTWARE.
21 
22 using System.Collections.Generic;
24 using Ntp.Analyzer.Config.Table;
25 
26 namespace Ntp.Analyzer.Config.Node
27 {
28  public sealed class Configuration : ConfigurationNode
29  {
30  internal Configuration(
31  string configName,
32  DatabaseConfiguration database,
33  HeartbeatConfiguration heartbeat,
34  PermissionConfiguration permission,
35  ClusterConfiguration cluster,
36  NotifyConfiguration notify,
37  IEnumerable<ReadingBulkConfiguration> bulks,
38  IEnumerable<ListenerConfiguration> monitors,
39  IEnumerable<LogConfiguration> logs,
40  IEnumerable<HostConfiguration> servers)
41  : base(configName)
42  {
43  Database = database;
44  Heartbeat = heartbeat;
45  Permission = permission;
46  Cluster = cluster;
47  Notify = notify;
48  this.bulks = new List<ReadingBulkConfiguration>(bulks);
49  this.monitors = new List<ListenerConfiguration>(monitors);
50  this.logs = new List<LogConfiguration>(logs);
51  this.servers = new List<HostConfiguration>(servers);
52  }
53 
54  private readonly List<ReadingBulkConfiguration> bulks;
55  private readonly List<LogConfiguration> logs;
56  private readonly List<ListenerConfiguration> monitors;
57  private readonly List<HostConfiguration> servers;
58 
59  [NtpaIndex(1)]
60  [NtpaSetting(Symbol.KeywordDatabase)]
61  public DatabaseConfiguration Database { get; }
62 
63  [NtpaIndex(20)]
64  [NtpaSetting(Symbol.KeywordPermission)]
65  public PermissionConfiguration Permission { get; }
66 
67  [NtpaIndex(10)]
68  [NtpaSetting(Symbol.KeywordCluster)]
69  public ClusterConfiguration Cluster { get; }
70 
71  [NtpaIndex(11)]
72  [NtpaSettingsCollection(Symbol.KeywordListener)]
73  public IEnumerable<ListenerConfiguration> Monitors => monitors;
74 
75  [NtpaIndex(22)]
76  [NtpaSettingsCollection(Symbol.KeywordLog)]
77  public IEnumerable<LogConfiguration> Log => logs;
78 
79  [NtpaIndex(30)]
80  [NtpaSetting(Symbol.KeywordNotify)]
81  public NotifyConfiguration Notify { get; }
82 
83  [NtpaIndex(23)]
84  [NtpaSetting(Symbol.KeywordDaemon)]
85  public HeartbeatConfiguration Heartbeat { get; }
86 
87  [NtpaIndex(40)]
88  [NtpaSettingsCollection(Symbol.KeywordReading)]
89  public IEnumerable<ReadingBulkConfiguration> Bulks => bulks;
90 
91  [NtpaIndex(50)]
92  [NtpaSettingsCollection(Symbol.KeywordServer)]
93  public IEnumerable<HostConfiguration> Servers => servers;
94  }
95 }
readonly List< LogConfiguration > logs
Configuration(string configName, DatabaseConfiguration database, HeartbeatConfiguration heartbeat, PermissionConfiguration permission, ClusterConfiguration cluster, NotifyConfiguration notify, IEnumerable< ReadingBulkConfiguration > bulks, IEnumerable< ListenerConfiguration > monitors, IEnumerable< LogConfiguration > logs, IEnumerable< HostConfiguration > servers)
readonly List< HostConfiguration > servers
readonly List< ReadingBulkConfiguration > bulks
readonly List< ListenerConfiguration > monitors