Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ServiceFailureActions.cs
1using System;
3using System.Text;
5
7{
15 public class ServiceFailureActions(TimeSpan resetPeriod, string rebootMessage,
16 string restartCommand, IReadOnlyCollection<ScAction> actions)
17 : IEquatable<ServiceFailureActions>
18 {
22 public TimeSpan ResetPeriod { get; } = resetPeriod;
23
27 public string RebootMessage { get; } = rebootMessage;
28
32 public string RestartCommand { get; } = restartCommand;
33
37 public IReadOnlyCollection<ScAction> Actions { get; } = actions;
38
40 public override bool Equals(object obj)
41 {
42 if (obj is null)
43 return false;
44
45 return obj is ServiceFailureActions Typed && this.Equals(Typed);
46 }
47
48
50 public override int GetHashCode()
51 {
52 int h1 = this.ResetPeriod.GetHashCode();
53 int h2 = this.RebootMessage.GetHashCode();
54
55 h1 = ((h1 << 5) + h1) ^ h2;
56
57 h2 = this.RestartCommand.GetHashCode();
58 h1 = ((h1 << 5) + h1) ^ h2;
59
60 foreach (ScAction Action in this.Actions)
61 {
62 h2 = Action.GetHashCode();
63 h1 = ((h1 << 5) + h1) ^ h2;
64 }
65
66 return h1;
67 }
68
74 public bool Equals(ServiceFailureActions Other)
75 {
76 if (Other is null)
77 return false;
78
79 return this.GetHashCode() == Other.GetHashCode();
80 }
81 }
82}
Action
The Action field indicates the action performed by the Reporting-MTA as a result of its attempt to de...