Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
DecrementCounter.cs
1using System.Threading.Tasks;
2using System.Xml;
6using Waher.Script;
7
9{
14 {
19 : base()
20 {
21 }
22
30 : base(Xml, Parent, Document)
31 {
32 }
33
37 public override string LocalName => nameof(DecrementCounter);
38
46 public override WafAction Create(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document) => new DecrementCounter(Xml, Parent, Document);
47
53 public override async Task<WafResult?> Review(ProcessingState State)
54 {
56 CaseInsensitiveString Name = await this.name.EvaluateAsync(Variables, string.Empty);
57 long Delta = await this.delta.EvaluateAsync(Variables, 1L);
58
59 await RuntimeCounters.DecrementCounter(Name, Delta);
60
61 return null;
62 }
63 }
64}
Represents a case-insensitive string.
Static class managing persistent counters.
static Task< long > DecrementCounter(CaseInsensitiveString Key)
Decrements a counter.
Collection of variables.
Definition: Variables.cs:25
DecrementCounter(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document)
Decrements a named counter.
override WafAction Create(XmlElement Xml, WafAction Parent, WebApplicationFirewall Document)
Creates a WAF action from its XML definition.
override string LocalName
XML Local Name for the XML element defining the action.
override async Task< WafResult?> Review(ProcessingState State)
Reviews the processing state, and returns a WAF result, if any.
Abstract base class for WAF actions with a name and delta.
readonly StringAttribute name
Name attribute
Contains the current state of a review process.
Variables Variables
Set of variables.
Abstract base class for Web Application Firewall actions.
Definition: WafAction.cs:17
WebApplicationFirewall Document
Web Application Firewall document.
Definition: WafAction.cs:60
Web Application Firewall for HttpServer.