Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
WafActionReference.cs
1using System.Xml;
3using Waher.Events;
4
6{
10 public abstract class WafActionReference : WafActions
11 {
12 private readonly string reference;
13 private WafAction referencedAction = null;
14
19 : base()
20 {
21 }
22
30 : base(Xml, Parent, Document)
31 {
32 this.reference = XML.Attribute(Xml, "reference");
33 }
34
38 public override void Prepare()
39 {
40 if (!this.Document.TryGetActionById(this.reference, out this.referencedAction))
41 {
42 this.referencedAction = null;
43 Log.Error("Referenced action not found: " + this.reference, this.Document.FileName);
44 }
45 }
46
50 public string Reference => this.reference;
51
55 public WafAction ReferencedAction => this.referencedAction;
56 }
57}
Helps with common XML-related tasks.
Definition: XML.cs:21
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
Definition: XML.cs:1062
Static class managing the application event log. Applications and services log events on this static ...
Definition: Log.cs:14
static void Error(string Message, string Object, string Actor, string EventId, EventLevel Level, string Facility, string Module, string StackTrace, params KeyValuePair< string, object >[] Tags)
Logs an error event.
Definition: Log.cs:692
Abstract base class for WAF actions that has tags.
WafActionReference()
Abstract base class for WAF actions that has tags.
WafActionReference(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document)
Abstract base class for WAF actions that has tags.
WafAction ReferencedAction
Referenced action, if found.
override void Prepare()
Prepares the node for processing.
Abstract base class for Web Application Firewall actions.
Definition: WafAction.cs:17
WebApplicationFirewall Document
Web Application Firewall document.
Definition: WafAction.cs:60
Abstract base class for Web Application Firewall actions containing other child actions.
Definition: WafActions.cs:14
Web Application Firewall for HttpServer.
bool TryGetActionById(string Id, [NotNullWhen(true)] out WafAction Action)
Tries to get an action node by its ID.