Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
GroupMessage.cs
1using System;
4
5namespace Waher.Groups
6{
10 [CollectionName("GroupMessages")]
11 [TypeName(TypeNameSerialization.None)]
12 [ArchivingTime(731)] // 2 years
13 [Index("NodeId", "Created")]
14 public class GroupMessage
15 {
16 private Guid objectId = Guid.Empty;
17 private Guid nodeId = Guid.Empty;
18 private MessageType type = MessageType.Information;
19 private string eventId = string.Empty;
20 private string body = string.Empty;
21 private DateTime created = DateTime.Now;
22 private DateTime updated = DateTime.MinValue;
23 private int count = 1;
24
28 public GroupMessage()
29 {
30 }
31
40 public GroupMessage(Guid NodeId, DateTime Timestamp, MessageType Type, string EventId, string Body)
41 {
42 this.nodeId = NodeId;
43 this.created = Timestamp;
44 this.updated = Timestamp;
45 this.type = Type;
46 this.eventId = EventId;
47 this.body = Body;
48 this.count = 1;
49 }
50
54 [ObjectId]
55 public Guid ObjectId
56 {
57 get => this.objectId;
58 set => this.objectId = value;
59 }
60
64 public Guid NodeId
65 {
66 get => this.nodeId;
67 set => this.nodeId = value;
68 }
69
73 public DateTime Created
74 {
75 get => this.created;
76 set => this.created = value;
77 }
78
82 [DefaultValueDateTimeMinValue]
83 public DateTime Updated
84 {
85 get => this.updated;
86 set => this.updated = value;
87 }
88
92 public int Count
93 {
94 get => this.count;
95 set => this.count = value;
96 }
97
101 [DefaultValue(MessageType.Information)]
103 {
104 get => this.type;
105 set => this.type = value;
106 }
107
111 [DefaultValueStringEmpty]
112 public string EventId
113 {
114 get => this.eventId;
115 set => this.eventId = value;
116 }
117
121 [DefaultValueStringEmpty]
122 public string Body
123 {
124 get => this.body;
125 set => this.body = value;
126 }
127 }
128}
Defines a message logged on a group node.
Definition: GroupMessage.cs:15
GroupMessage(Guid NodeId, DateTime Timestamp, MessageType Type, string EventId, string Body)
Defines a message logged on a geoup node.
Definition: GroupMessage.cs:40
string Body
Message body.
DateTime Updated
When node was last updated. If it has not been updated, value will be DateTime.MinValue.
Definition: GroupMessage.cs:84
string EventId
Optional Event ID.
Guid NodeId
Object ID of group node on which message has been logged.
Definition: GroupMessage.cs:65
int Count
Number of times the message has been reported (updated).
Definition: GroupMessage.cs:93
Guid ObjectId
Object ID in persistence layer.
Definition: GroupMessage.cs:56
GroupMessage()
Defines a message logged on a group node.
Definition: GroupMessage.cs:28
MessageType Type
Message Type
DateTime Created
When node was created.
Definition: GroupMessage.cs:74
TypeNameSerialization
How the type name should be serialized.