Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
QueuedEvent.cs
1using System;
5
6namespace Waher.Events.Queue
7{
12 {
13 private DateTime timestamp = DateTime.MinValue;
14 private EventType type = EventType.Informational;
15 private EventLevel level = EventLevel.Minor;
16 private string message = string.Empty;
17 private string obj = string.Empty;
18 private string actor = string.Empty;
19 private string eventId = string.Empty;
20 private string module = string.Empty;
21 private string facility = string.Empty;
22 private string stackTrace = string.Empty;
23 private QueuedTag[] tags = null;
24
28 public QueuedEvent()
29 {
30 }
31
37 {
38 this.timestamp = Event.Timestamp;
39 this.type = Event.Type;
40 this.message = Event.Message;
41 this.obj = Event.Object;
42 this.actor = Event.Actor;
43 this.eventId = Event.EventId;
44 this.level = Event.Level;
45 this.facility = Event.Facility;
46 this.module = Event.Module;
47 this.stackTrace = Event.StackTrace;
48
49 if (Event.Tags is null)
50 this.tags = null;
51 else
52 {
53 int i, c = Event.Tags.Length;
54
55 this.tags = new QueuedTag[c];
56
57 for (i = 0; i < c; i++)
58 {
59 this.tags[i] = new QueuedTag()
60 {
61 Name = Event.Tags[i].Key,
62 Value = Event.Tags[i].Value
63 };
64 }
65 }
66 }
67
72
76 public DateTime Timestamp
77 {
78 get => this.timestamp;
79 set => this.timestamp = value;
80 }
81
86 {
87 get => this.type;
88 set => this.type = value;
89 }
90
94 [DefaultValue(EventLevel.Minor)]
96 {
97 get => this.level;
98 set => this.level = value;
99 }
100
104 [DefaultValueStringEmpty]
105 public string Message
106 {
107 get => this.message;
108 set => this.message = value;
109 }
110
114 [DefaultValueStringEmpty]
115 public string Object
116 {
117 get => this.obj;
118 set => this.obj = value;
119 }
120
124 [DefaultValueStringEmpty]
125 public string Actor
126 {
127 get => this.actor;
128 set => this.actor = value;
129 }
130
134 [DefaultValueStringEmpty]
135 public string EventId
136 {
137 get => this.eventId;
138 set => this.eventId = value;
139 }
140
144 [DefaultValueStringEmpty]
145 public string Facility
146 {
147 get => this.facility;
148 set => this.facility = value;
149 }
150
154 [DefaultValueStringEmpty]
155 public string Module
156 {
157 get => this.module;
158 set => this.module = value;
159 }
160
164 [DefaultValueStringEmpty]
165 public string StackTrace
166 {
167 get => this.stackTrace;
168 set => this.stackTrace = value;
169 }
170
174 [DefaultValueNull]
176 {
177 get => this.tags;
178 set => this.tags = value;
179 }
180
182 public override string ToString()
183 {
184 return this.message;
185 }
186 }
187}
Class representing an event.
Definition: Event.cs:11
string Message
Free-text event message.
Definition: Event.cs:132
EventType Type
Type of event.
Definition: Event.cs:122
string Object
Object related to the event.
Definition: Event.cs:137
EventLevel Level
Event Level.
Definition: Event.cs:127
string Actor
Actor responsible for the action causing the event.
Definition: Event.cs:142
string Module
Module where the event is reported.
Definition: Event.cs:157
DateTime Timestamp
Timestamp of event.
Definition: Event.cs:117
KeyValuePair< string, object >[] Tags
Variable set of tags providing event-specific information.
Definition: Event.cs:167
string EventId
Computer-readable Event ID identifying type of even.
Definition: Event.cs:147
string Facility
Facility can be either a facility in the network sense or in the system sense.
Definition: Event.cs:152
string StackTrace
Stack Trace of event.
Definition: Event.cs:162
Class representing a queued event.
Definition: QueuedEvent.cs:12
string EventId
Computer-readable Event ID identifying type of even.
Definition: QueuedEvent.cs:136
QueuedTag[] Tags
Variable set of tags providing event-specific information.
Definition: QueuedEvent.cs:176
EventLevel Level
Event Level.
Definition: QueuedEvent.cs:96
override string ToString()
Definition: QueuedEvent.cs:182
string Object
Object related to the event.
Definition: QueuedEvent.cs:116
DateTime Timestamp
Timestamp of event.
Definition: QueuedEvent.cs:77
QueuedEvent()
Class representing a persisted event.
Definition: QueuedEvent.cs:28
EventType Type
Type of event.
Definition: QueuedEvent.cs:86
string Message
Free-text event message.
Definition: QueuedEvent.cs:106
string Module
Module where the event is reported.
Definition: QueuedEvent.cs:156
string StackTrace
Stack Trace of event.
Definition: QueuedEvent.cs:166
string Facility
Facility can be either a facility in the network sense or in the system sense.
Definition: QueuedEvent.cs:146
QueuedEvent(Event Event)
Class representing a persisted event.
Definition: QueuedEvent.cs:36
string Actor
Actor responsible for the action causing the event.
Definition: QueuedEvent.cs:126
Grade CanEncodeJson
To what extent the object supports JSON encoding.
Definition: QueuedEvent.cs:71
Class representing a tag on a queued event.
Definition: QueuedTag.cs:9
Provides a JSON Encoding hint for an object that implements this interface.
EventLevel
Event level.
Definition: EventLevel.cs:7
EventType
Type of event.
Definition: EventType.cs:7
Grade
Grade enumeration
Definition: Grade.cs:7