NTP Analyzer  0.8.2
Analyze the operation of time servers
Ntp.Analyzer.Config.Syntax.NotifySyntaxNode Class Reference
Inheritance diagram for Ntp.Analyzer.Config.Syntax.NotifySyntaxNode:
Collaboration diagram for Ntp.Analyzer.Config.Syntax.NotifySyntaxNode:

Public Member Functions

 NotifySyntaxNode (string name, int line)
 
- Public Member Functions inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< NotifyConfiguration >
void Add (ISyntaxNode node)
 
void Assemble (ISyntaxNode node)
 
Compile ()
 
void CompileNode ()
 
IEnumerator< ISyntaxNodeGetEnumerator ()
 
void Resolve (SymbolTable table)
 
void Validate (SymbolTable table)
 

Protected Member Functions

override NotifyConfiguration InternalCompile ()
 
override void ValidateMandatories ()
 Override to validates the mandatory types in this syntax node. More...
 
override void ValidateTypes ()
 Override to validates the types in this syntax node. More...
 
- Protected Member Functions inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< NotifyConfiguration >
 SyntaxNode (Symbol symbol, string name, int line, bool requirePath=false)
 
void AddError (string message)
 
void AddReferenceNameError (ISyntaxNode node, string keyword, string name)
 
void AddReferenceTypeError (ISyntaxNode node, string keyword, string section, string name)
 
void CheckAllIsPresent (IEnumerable< Symbol > list)
 
void CheckIsUnique (IEnumerable< Symbol > list)
 
Uri CheckLink (string link, string keyword)
 
void CheckOneIsPresent (IEnumerable< Symbol > list)
 
void CheckOnlyOneIsPresent (IEnumerable< Symbol > list)
 
void CheckTypeIs< TU > (Symbol symbol)
 
void CheckTypeIs< TU, TV > (Symbol symbol)
 
virtual void InternalResolve (SymbolTable table)
 Override to resolve references to other syntax nodes from this syntax node. More...
 
virtual void ValidateReferences (SymbolTable table)
 Override to validates the references in this syntax node. More...
 

Additional Inherited Members

- Public Attributes inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< NotifyConfiguration >
ConfigurationNode CompiledNode
 
IEnumerable< string > Errors
 
bool HasErrors
 
- Properties inherited from Ntp.Analyzer.Config.Syntax.SyntaxNode< NotifyConfiguration >
int Line [get]
 
string Name [get]
 
List< ISyntaxNodeNodes [get]
 
bool RequirePath [get]
 
Symbol Symbol [get]
 

Detailed Description

Definition at line 30 of file NotifySyntaxNode.cs.

Constructor & Destructor Documentation

Ntp.Analyzer.Config.Syntax.NotifySyntaxNode.NotifySyntaxNode ( string  name,
int  line 
)
inline

Definition at line 32 of file NotifySyntaxNode.cs.

References Ntp.Analyzer.Config.Table.KeywordNotify.

33  : base(Symbol.KeywordNotify, name, line)
34  {
35  }

Member Function Documentation

override NotifyConfiguration Ntp.Analyzer.Config.Syntax.NotifySyntaxNode.InternalCompile ( )
inlineprotectedvirtual

Implements Ntp.Analyzer.Config.Syntax.SyntaxNode< NotifyConfiguration >.

Definition at line 37 of file NotifySyntaxNode.cs.

38  {
39  var frequency = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordFrequency) as IntegerSettingNode;
40  var initialRun = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordInitialRun) as BooleanSettingNode;
41  var fixedRun = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordFixedRun) as BooleanSettingNode;
42  var user = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordUser) as StringSettingNode ??
43  Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordSmtpUser) as StringSettingNode;
44  var pass = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordPass) as StringSettingNode ??
45  Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordSmtpPass) as StringSettingNode;
46  var host = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordIp) as StringSettingNode ??
47  Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordHost) as StringSettingNode ??
48  Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordHostAddress) as StringSettingNode ??
49  Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordSmtpHost) as StringSettingNode ??
50  Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordAddress) as StringSettingNode;
51  var port = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordPort) as IntegerSettingNode ??
52  Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordSmtpPort) as IntegerSettingNode;
53  var ssl = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordEnableSsl) as BooleanSettingNode;
54  var sender = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordSender) as StringSettingNode;
55  var recipient = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordRecipient) as StringSettingNode ??
56  Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordMail) as StringSettingNode;
57  var subject = Nodes.SingleOrDefault(n => n.Symbol == Symbol.KeywordSubject) as StringSettingNode;
58 
59  return new NotifyConfiguration(
60  Name,
61  initialRun?.Value,
62  fixedRun?.Value,
63  frequency?.Value,
64  recipient?.Value,
65  subject?.Value,
66  sender?.Value,
67  host?.Value,
68  port?.Value,
69  user?.Value,
70  pass?.Value,
71  ssl?.Value
72  );
73  }
override void Ntp.Analyzer.Config.Syntax.NotifySyntaxNode.ValidateMandatories ( )
inlineprotectedvirtual

Override to validates the mandatory types in this syntax node.

When overriding this method do not call the base method.

Reimplemented from Ntp.Analyzer.Config.Syntax.SyntaxNode< NotifyConfiguration >.

Definition at line 75 of file NotifySyntaxNode.cs.

76  {
77  CheckIsUnique(new List<Symbol>
78  {
79  Symbol.KeywordFrequency,
80  Symbol.KeywordInitialRun,
81  Symbol.KeywordFixedRun,
82  Symbol.KeywordUser,
83  Symbol.KeywordSmtpUser,
84  Symbol.KeywordPass,
85  Symbol.KeywordSmtpPass,
86  Symbol.KeywordIp,
87  Symbol.KeywordHost,
88  Symbol.KeywordAddress,
89  Symbol.KeywordHostAddress,
90  Symbol.KeywordSmtpHost,
91  Symbol.KeywordPort,
92  Symbol.KeywordSmtpPort,
93  Symbol.KeywordEnableSsl,
94  Symbol.KeywordSender,
95  Symbol.KeywordMail,
96  Symbol.KeywordRecipient,
97  Symbol.KeywordSubject
98  });
99 
100  CheckOnlyOneIsPresent(new List<Symbol>
101  {
102  Symbol.KeywordRecipient,
103  Symbol.KeywordMail
104  });
105 
106  CheckOnlyOneIsPresent(new List<Symbol>
107  {
108  Symbol.KeywordIp,
109  Symbol.KeywordHost,
110  Symbol.KeywordAddress,
111  Symbol.KeywordHostAddress,
112  Symbol.KeywordSmtpHost
113  });
114 
115  CheckOnlyOneIsPresent(new List<Symbol>
116  {
117  Symbol.KeywordSmtpPort,
118  Symbol.KeywordPort
119  });
120 
121  CheckOnlyOneIsPresent(new List<Symbol>
122  {
123  Symbol.KeywordSmtpUser,
124  Symbol.KeywordUser
125  });
126 
127  CheckOnlyOneIsPresent(new List<Symbol>
128  {
129  Symbol.KeywordSmtpPass,
130  Symbol.KeywordPass
131  });
132 
133  CheckAllIsPresent(new List<Symbol>
134  {
135  Symbol.KeywordSender,
136  Symbol.KeywordSubject
137  });
138 
139  CheckOneIsPresent(new List<Symbol>
140  {
141  Symbol.KeywordRecipient,
142  Symbol.KeywordMail
143  });
144 
145  CheckOneIsPresent(new List<Symbol>
146  {
147  Symbol.KeywordIp,
148  Symbol.KeywordHost,
149  Symbol.KeywordAddress,
150  Symbol.KeywordSmtpHost
151  });
152  }
override void Ntp.Analyzer.Config.Syntax.NotifySyntaxNode.ValidateTypes ( )
inlineprotectedvirtual

Override to validates the types in this syntax node.

When overriding this method do not call the base method.

Reimplemented from Ntp.Analyzer.Config.Syntax.SyntaxNode< NotifyConfiguration >.

Definition at line 154 of file NotifySyntaxNode.cs.

155  {
156  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordFrequency);
157  CheckTypeIs<BooleanSettingNode>(Symbol.KeywordInitialRun);
158  CheckTypeIs<BooleanSettingNode>(Symbol.KeywordFixedRun);
159  CheckTypeIs<StringSettingNode>(Symbol.KeywordUser);
160  CheckTypeIs<StringSettingNode>(Symbol.KeywordPass);
161  CheckTypeIs<StringSettingNode>(Symbol.KeywordSmtpUser);
162  CheckTypeIs<StringSettingNode>(Symbol.KeywordSmtpPass);
163  CheckTypeIs<StringSettingNode>(Symbol.KeywordIp);
164  CheckTypeIs<StringSettingNode>(Symbol.KeywordHost);
165  CheckTypeIs<StringSettingNode>(Symbol.KeywordAddress);
166  CheckTypeIs<StringSettingNode>(Symbol.KeywordSmtpHost);
167  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordPort);
168  CheckTypeIs<IntegerSettingNode>(Symbol.KeywordSmtpPort);
169  CheckTypeIs<BooleanSettingNode>(Symbol.KeywordEnableSsl);
170  CheckTypeIs<StringSettingNode>(Symbol.KeywordSender);
171  CheckTypeIs<StringSettingNode>(Symbol.KeywordRecipient);
172  CheckTypeIs<StringSettingNode>(Symbol.KeywordSubject);
173  }

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