Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ServiceRegistration.cs
1using System;
2using System.Collections.Generic;
5
7{
8 [CollectionName("ServiceRegistrations")]
9 [ArchivingTime]
10 [Index("BareJid")]
12 {
13 private DateTime created = DateTime.MinValue;
14 private DateTime updated = DateTime.MinValue;
15 private Annotation[] annotations = null;
16 private Dictionary<CaseInsensitiveString, Annotation> annotationsSorted = null;
17 private string[] features = null;
18 private string[] assemblies = null;
19 private string objectId = null;
21 private string clientName = string.Empty;
22 private string clientVersion = string.Empty;
23 private string clientOS = string.Empty;
24 private string language = string.Empty;
27
28 public ServiceRegistration()
29 {
30 }
31
32 [ObjectId]
33 public string ObjectId
34 {
35 get => this.objectId;
36 set => this.objectId = value;
37 }
38
39 [DefaultValueNull]
40 public Annotation[] Annotations
41 {
42 get => this.annotations;
43 set
44 {
45 this.annotations = value;
46 this.annotationsSorted = null;
47 }
48 }
49
50 [DefaultValueNull]
51 public string[] Features
52 {
53 get => this.features;
54 set => this.features = value;
55 }
56
57 [DefaultValueNull]
58 public string[] Assemblies
59 {
60 get => this.assemblies;
61 set => this.assemblies = value;
62 }
63
64 public CaseInsensitiveString BareJid
65 {
66 get => this.bareJid;
67 set => this.bareJid = value;
68 }
69
70 [DefaultValueStringEmpty]
71 public string ClientName
72 {
73 get => this.clientName;
74 set => this.clientName = value;
75 }
76
77 [DefaultValueStringEmpty]
78 public string ClientVersion
79 {
80 get => this.clientVersion;
81 set => this.clientVersion = value;
82 }
83
84 [DefaultValueStringEmpty]
85 public string ClientOS
86 {
87 get => this.clientOS;
88 set => this.clientOS = value;
89 }
90
91 [DefaultValueStringEmpty]
92 public string Language
93 {
94 get => this.language;
95 set => this.language = value;
96 }
97
98 [DefaultValueStringEmpty]
99 public CaseInsensitiveString Host
100 {
101 get => this.host;
102 set => this.host = value;
103 }
104
105 [DefaultValueStringEmpty]
106 public CaseInsensitiveString Domain
107 {
108 get => this.domain;
109 set => this.domain = value;
110 }
111
112 public DateTime Created
113 {
114 get => this.created;
115 set => this.created = value;
116 }
117
118 [DefaultValueDateTimeMinValue]
119 public DateTime Updated
120 {
121 get => this.updated;
122 set => this.updated = value;
123 }
124
125 public string this[CaseInsensitiveString TagName]
126 {
127 get
128 {
129 if (this.annotationsSorted is null)
130 {
131 Dictionary<CaseInsensitiveString, Annotation> Sorted = new Dictionary<CaseInsensitiveString, Annotation>();
132
133 foreach (Annotation A in this.annotations)
134 Sorted[A.Tag] = A;
135
136 this.annotationsSorted = Sorted;
137 }
138
139 if (this.annotationsSorted.TryGetValue(TagName, out Annotation Result))
140 return Result.Value;
141 else
142 return string.Empty;
143 }
144 }
145
146 }
147}
Represents a case-insensitive string.
static readonly CaseInsensitiveString Empty
Empty case-insensitive string