4using System.Reflection;
6using System.Threading.Tasks;
37 public const string SourceID =
"GatewayConfig";
39 private readonly
static Dictionary<string, INode> nodesById =
new Dictionary<string, INode>();
40 private static IEnumerable<INode> nodes =
null;
42 private static WebServer webServer =
null;
44 private static Ports ports =
null;
47 private static DateTime writeTime = DateTime.MinValue;
49 internal static DateTime nodesTimestamp = DateTime.MinValue;
57 this.LoadConfiguration();
67 private void CheckLoadConfiguration()
69 if (nodes is
null || nodesTimestamp < this.
LastChanged)
70 this.LoadConfiguration();
73 private void LoadConfiguration()
78 if (!File.Exists(GatewayConfigFileName))
81 if (!File.Exists(GatewayConfigFileName))
82 throw new Exception(
"Gateway.config not found.");
99 Http2NoRfc7540Priorities = Gateway.HttpServer.Http2NoRfc7540Priorities
102 ports =
new Ports(
this);
106 List<INode> Nodes =
new List<INode>()
114 Dictionary<string, bool> ContentEncodingsFound =
new Dictionary<string, bool>();
116 foreach (XmlNode N
in Config.DocumentElement.ChildNodes)
118 if (N is XmlElement E)
122 case "ApplicationName":
123 generalInformation.ApplicationName = E.InnerText;
133 webServer.TrustClientCertificates =
XML.
Attribute(E,
"trustCertificates",
false);
135 foreach (XmlNode N2
in E.ChildNodes)
137 if (N2.LocalName ==
"Port" &&
int.TryParse(N2.InnerText, out
int PortNumber))
139 XmlElement E2 = (XmlElement)N2;
143 webServer.AddInternal(
new MTlsPort(
this, webServer, PortNumber, ClientCertificatesPort, TrustClientCertificatesPort));
148 case "Http2Settings":
149 webServer.Http2Enabled =
XML.
Attribute(E,
"enabled",
true);
150 webServer.Http2InitialStreamWindowSize =
XML.
Attribute(E,
"initialWindowSize", 2500000);
151 webServer.Http2InitialConnectionWindowSize =
XML.
Attribute(E,
"initialConnectionWindowSize", 5000000);
152 webServer.Http2MaxFrameSize =
XML.
Attribute(E,
"maxFrameSize", 16384);
153 webServer.Http2MaxConcurrentStreams =
XML.
Attribute(E,
"maxConcurrentStreams", 100);
154 webServer.Http2HeaderTableSize =
XML.
Attribute(E,
"headerTableSize", 8192);
155 webServer.Http2NoRfc7540Priorities =
XML.
Attribute(E,
"noRfc7540Priorities",
false);
156 webServer.Http2Profiling =
XML.
Attribute(E,
"profiling",
false);
157 webServer.HttpSniffersPerEndpoint =
XML.
Attribute(E,
"sniffersPerEndpoint",
false);
160 case "ContentEncodings":
161 foreach (XmlNode N2
in E.ChildNodes)
163 if (N2.LocalName ==
"ContentEncoding")
165 XmlElement E2 = (XmlElement)N2;
173 ContentEncodingsFound[Method] =
true;
175 webServer.AddInternal(
new ContentEncoding(
this, webServer, Method, Dynamic, Static));
182 case "ExportExceptions":
183 generalInformation.ExceptionFolder =
XML.
Attribute(E,
"folder",
"Exceptions");
188 databaseDefinition.DefaultCollectionName =
XML.
Attribute(E,
"defaultCollectionName",
string.Empty);
189 databaseDefinition.BlockSize =
XML.
Attribute(E,
"blockSize", 0);
190 databaseDefinition.BlocksInCache =
XML.
Attribute(E,
"blocksInCache", 0);
191 databaseDefinition.BlobBlockSize =
XML.
Attribute(E,
"blobBlockSize", 0);
192 databaseDefinition.TimeoutMs =
XML.
Attribute(E,
"timeoutMs", 0);
193 databaseDefinition.Encrypted =
XML.
Attribute(E,
"encrypted",
false);
194 databaseDefinition.Compiled =
XML.
Attribute(E,
"compiled",
false);
198 foreach (XmlNode N2
in E.ChildNodes)
200 if (N2.LocalName ==
"Port")
202 XmlElement E2 = (XmlElement)N2;
204 if (!
string.IsNullOrEmpty(Protocol) &&
int.TryParse(E2.InnerText, out
int PortNumber))
205 ports.AddInternal(
new Port(
this, ports, Protocol, PortNumber));
210 case "DefaultHttpResponseHeaders":
211 foreach (XmlNode N2
in E.ChildNodes)
213 if (N2.LocalName ==
"DefaultHttpResponseHeader")
215 XmlElement E2 = (XmlElement)N2;
224 foreach (XmlNode N2
in E.ChildNodes)
226 if (N2.LocalName ==
"FileFolder")
228 XmlElement E2 = (XmlElement)N2;
232 webServer.AddInternal(Folder);
234 foreach (XmlNode N3
in E2.ChildNodes)
236 if (N3.LocalName ==
"DefaultHttpResponseHeader")
238 XmlElement E3 = (XmlElement)N3;
248 case "VanityResources":
249 foreach (XmlNode N2
in E.ChildNodes)
251 if (N2.LocalName ==
"VanityResource")
253 XmlElement E2 = (XmlElement)N2;
256 webServer.AddInternal(
new VanityResource(
this, webServer, Regex, Url));
262 foreach (XmlNode N2
in E.ChildNodes)
264 if (N2.LocalName ==
"Redirection")
266 XmlElement E2 = (XmlElement)N2;
269 bool IncludeSubPaths =
XML.
Attribute(E2,
"includeSubPaths",
false);
271 webServer.AddInternal(
new Redirection(
this, webServer, Resource, Location, IncludeSubPaths, Permanent));
277 foreach (XmlNode N2
in E.ChildNodes)
279 if (!(N2 is XmlElement E2))
282 switch (E2.LocalName)
284 case "ProxyResource":
285 string LocalResource =
XML.
Attribute(E2,
"localResource");
286 string RemoteDomain =
XML.
Attribute(E2,
"remoteDomain");
287 string RemoteFolder =
XML.
Attribute(E2,
"remoteFolder");
290 bool UseSession =
XML.
Attribute(E2,
"useSession",
false);
292 string Privilege =
XML.
Attribute(E2,
"privilege",
string.Empty);
309 webServer.AddInternal(
new ProxyResource(
this, webServer, LocalResource, RemoteDomain, RemoteFolder,
310 RemotePort, Encrypted, UseSession, TimeoutMs, Privilege,
ProxyResource));
321 Privilege =
XML.
Attribute(E2,
"privilege",
string.Empty);
325 foreach (KeyValuePair<string, HttpReverseProxyResource> ReverseProxy
in
328 if (ReverseProxy.Key == LocalDomain &&
329 ReverseProxy.Value.RemoteHost == RemoteDomain &&
330 ReverseProxy.Value.RemoteFolder == RemoteFolder &&
331 ReverseProxy.Value.RemotePort == RemotePort)
337 webServer.AddInternal(
new ProxyDomain(
this, webServer, LocalDomain, RemoteDomain, RemoteFolder,
338 RemotePort, Encrypted, UseSession, TimeoutMs, Privilege,
ProxyResource));
345 if (loginAuditor is
null)
348 Nodes.Add(loginAuditor);
350 foreach (XmlNode N2
in E.ChildNodes)
352 if (!(N2 is XmlElement E2))
355 switch (E2.LocalName)
363 loginAuditor.AddInternal(
new IntervalNode(
this, NrAttempts, Interval));
372 foreach (XmlNode N3
in E2.ChildNodes)
374 if (N3 is XmlElement E3 && E3.LocalName ==
"Interval")
381 ExceptionNode.AddInternal(
new IntervalNode(
this, NrAttempts, Interval));
385 loginAuditor.AddInternal(ExceptionNode);
391 Log.
Error(
"Only one LoginAuditor element permitted.", GatewayConfigFileName);
395 if (eventSinks is
null)
398 Nodes.Add(eventSinks);
404 foreach (XmlNode N2
in E.ChildNodes)
406 if (!(N2 is XmlElement E2) || E2.NamespaceURI != E.NamespaceURI)
411 switch (E2.LocalName)
413 case "TextFileEventSink":
416 int DeleteAfterDays =
XML.
Attribute(E2,
"deleteAfterDays", 7);
421 case "XmlFileEventSink":
424 DeleteAfterDays =
XML.
Attribute(E2,
"deleteAfterDays", 7);
425 string TransformFileName =
XML.
Attribute(E2,
"transformFileName");
430 case "MqttEventSink":
442 case "PipeEventSink":
449 case "SocketEventSink":
458 case "SyslogEventSink":
469 case "WebHookEventSink":
472 int MaxSecondsUsed =
XML.
Attribute(E2,
"maxSecondsUsed", 0);
473 int MaxSecondsUnused =
XML.
Attribute(E2,
"maxSecondsUnused", 0);
474 bool CollectOnType =
XML.
Attribute(E2,
"collectOnType",
false);
475 bool CollectOnLevel =
XML.
Attribute(E2,
"collectOnLevel",
false);
476 bool CollectOnEventId =
XML.
Attribute(E2,
"collectOnEventId",
false);
477 bool CollectOnObject =
XML.
Attribute(E2,
"collectOnObject",
false);
478 bool CollectOnActor =
XML.
Attribute(E2,
"collectOnActor",
false);
479 bool CollectOnFacility =
XML.
Attribute(E2,
"collectOnFacility",
false);
480 bool CollectOnModule =
XML.
Attribute(E2,
"collectOnModule",
false);
483 MaxSecondsUsed, MaxSecondsUnused, CollectOnType, CollectOnLevel,
484 CollectOnEventId, CollectOnObject, CollectOnActor,
485 CollectOnFacility, CollectOnModule));
488 case "XmppEventSink":
505 string EventIdsString =
XML.
Attribute(E2,
"eventIds").Trim();
508 if (
string.IsNullOrEmpty(EventIdsString))
511 EventIds = EventIdsString.Split(
',', StringSplitOptions.RemoveEmptyEntries);
514 Debug, Informational, Notice, Warning, Error, Critical, Alert, Emergency,
527 DeleteAfterDays =
XML.
Attribute(E2,
"deleteAfterDays", 7);
546 Log.
Error(
"Only one EventSinks element permitted.", GatewayConfigFileName);
552 if (loginAuditor is
null)
555 Nodes.Add(loginAuditor);
558 if (eventSinks is
null)
561 Nodes.Add(eventSinks);
581 if (ContentEncodingsFound.ContainsKey(Encoding.
Label))
584 ContentEncodingsFound[Encoding.
Label] =
true;
592 nodes = Nodes.ToArray();
597 foreach (
INode Node
in nodes)
599 nodesById[Node.
NodeId] = Node;
605 nodesById[Child.
NodeId] = Child;
619 string IDataSource.SourceID =>
SourceID;
643 this.CheckLoadConfiguration();
651 public event EventHandlerAsync<SourceEvent>
OnEvent;
680 if (NodeRef is
null ||
682 !
string.IsNullOrEmpty(NodeRef.
Partition))
684 return Task.FromResult<
INode>(
null);
689 if (nodesById.TryGetValue(NodeRef.
NodeId, out
INode Node))
690 return Task.FromResult(Node);
692 return Task.FromResult<
INode>(
null);
698 return this.OnEvent.Raise(
this,
Event);
711 nodesById[Node.
NodeId] = Node;
725 if (nodesById.TryGetValue(Node.
NodeId, out
INode Node2) && Node == Node2)
728 foreach (KeyValuePair<string, INode> P
in nodesById)
732 nodesById.Remove(P.Key);
737 nodesById[Node.
NodeId] = Node;
741 internal async Task NodeDeleted(
INode Node,
bool External)
750 if (nodesById.TryGetValue(Node.
NodeId, out
INode Node2) && Node == Node2)
751 nodesById.Remove(Node.
NodeId);
755 private static void ScheduleSave()
757 if (writeTime > DateTime.MinValue)
760 writeTime = DateTime.MinValue;
766 private static async Task SaveFile(
object _)
773 if (File.Exists(BakFileName))
774 File.Delete(BakFileName);
776 if (File.Exists(ConfigFileName))
780 Log.
Notice(
"Gateway.config file updated.\r\n\r\nOld Config file:\r\n\r\n```\r\n" + OldConfig +
"\r\n```",
781 ConfigFileName,
string.Empty,
"GatewayConfigUpdated");
783 File.Move(ConfigFileName, BakFileName);
786 using (FileStream fs = File.Create(ConfigFileName))
788 using XmlWriter Xml = XmlWriter.Create(fs,
XML.
WriterSettings(
true,
false, Encoding.UTF8));
790 Xml.WriteStartDocument();
793 Xml.WriteComment(
"The configuration file in the program data folder, will have precedence over the configuration file in the installation folder.");
794 Xml.WriteComment(
"When upgrading, the configuration file in the installation folder will be updated, but the configuration file in the program data");
795 Xml.WriteComment(
"folder will be maintained. If you make changes to the configuration file, make a copy and place it in the program data folder, and");
796 Xml.WriteComment(
"edit it there. This will make sure you don't lose any changes when you update the software.");
798 Xml.WriteElementString(
"ApplicationName", generalInformation.
ApplicationName);
806 Xml.WriteStartElement(
"DefaultPage");
812 Xml.WriteEndElement();
817 Xml.WriteStartElement(
"MutualTls");
818 Xml.WriteAttributeString(
"clientCertificates", webServer.
ClientCertificates.ToString());
825 Xml.WriteStartElement(
"Port");
829 Xml.WriteEndElement();
833 Xml.WriteEndElement();
837 Dictionary<string, bool> Found =
new Dictionary<string, bool>();
839 Xml.WriteStartElement(
"ContentEncodings");
845 Xml.WriteStartElement(
"ContentEncoding");
849 Xml.WriteEndElement();
872 if (Found.ContainsKey(Encoding.
Label))
875 Found[Encoding.
Label] =
true;
877 Xml.WriteStartElement(
"ContentEncoding");
878 Xml.WriteAttributeString(
"method", Encoding.
Label);
881 Xml.WriteEndElement();
884 Xml.WriteEndElement();
887 Xml.WriteStartElement(
"Http2Settings");
891 Xml.WriteAttributeString(
"maxFrameSize", webServer.
Http2MaxFrameSize.ToString());
897 Xml.WriteEndElement();
899 Xml.WriteStartElement(
"Database");
900 Xml.WriteAttributeString(
"folder", databaseDefinition.
Folder);
902 Xml.WriteAttributeString(
"blockSize", databaseDefinition.
BlockSize.ToString());
903 Xml.WriteAttributeString(
"blocksInCache", databaseDefinition.
BlocksInCache.ToString());
904 Xml.WriteAttributeString(
"blobBlockSize", databaseDefinition.
BlobBlockSize.ToString());
905 Xml.WriteAttributeString(
"timeoutMs", databaseDefinition.
TimeoutMs.ToString());
908 Xml.WriteEndElement();
910 Xml.WriteStartElement(
"Ports");
918 Xml.WriteStartElement(
"Port");
921 Xml.WriteEndElement();
926 Xml.WriteEndElement();
930 Xml.WriteStartElement(
"DefaultHttpResponseHeaders");
936 Xml.WriteStartElement(
"DefaultHttpResponseHeader");
939 Xml.WriteEndElement();
943 Xml.WriteEndElement();
944 Xml.WriteStartElement(
"FileFolders");
946 Xml.WriteComment(
"Add a sequence of FileFolder elements. Each FileFolder element creates a web folder defined by the webFolder attribute. These folder resources are absolute");
947 Xml.WriteComment(
"resources. Each web folder will be mapped to a corresponding folder on the local machine or in the network, defined by the folderPath attribute. ");
948 Xml.WriteComment(
"");
949 Xml.WriteComment(
"Example:");
950 Xml.WriteComment(
"");
951 Xml.WriteComment(
"<FileFolder webFolder=\"/Folder\" folderPath=\"\\\\Server\\Path\"/>");
957 Xml.WriteStartElement(
"FileFolder");
960 Xml.WriteEndElement();
964 Xml.WriteEndElement();
969 Xml.WriteStartElement(
"VanityResources");
975 Xml.WriteStartElement(
"VanityResource");
978 Xml.WriteEndElement();
982 Xml.WriteEndElement();
984 Xml.WriteStartElement(
"Redirections");
990 Xml.WriteStartElement(
"Redirection");
995 Xml.WriteEndElement();
999 Xml.WriteEndElement();
1001 Xml.WriteStartElement(
"ReverseProxy");
1007 Xml.WriteStartElement(
"ProxyResource");
1019 Xml.WriteEndElement();
1023 Xml.WriteStartElement(
"ProxyDomain");
1035 Xml.WriteEndElement();
1039 Xml.WriteEndElement();
1044 Xml.WriteStartElement(
"ExportExceptions");
1045 Xml.WriteAttributeString(
"folder", generalInformation.
ExceptionFolder);
1046 Xml.WriteEndElement();
1049 if (!(loginAuditor is
null))
1051 IEnumerable<INode> Intervals = await loginAuditor.
ChildNodes;
1054 foreach (
INode _2
in Intervals)
1062 Xml.WriteStartElement(
"LoginAuditor");
1064 int NrIntervals = 0;
1066 foreach (
INode Node
in Intervals)
1070 Xml.WriteStartElement(
"Interval");
1071 Xml.WriteAttributeString(
"nrAttempts", Interval.NrAttempts.ToString());
1073 if (Interval.Interval.HasValue)
1074 Xml.WriteAttributeString(
"interval", Interval.Interval.Value.ToString());
1076 Xml.WriteEndElement();
1081 Xml.WriteStartElement(
"Exception");
1082 Xml.WriteAttributeString(
"endpoint", ExceptionNode.EndPoint);
1084 int NrIntervals2 = 0;
1090 Xml.WriteStartElement(
"Interval");
1091 Xml.WriteAttributeString(
"nrAttempts", Interval2.NrAttempts.ToString());
1093 if (Interval2.Interval.HasValue)
1094 Xml.WriteAttributeString(
"interval", Interval2.Interval.Value.ToString());
1096 Xml.WriteEndElement();
1100 if (NrIntervals2 == 0)
1102 Xml.WriteStartElement(
"Interval");
1103 Xml.WriteAttributeString(
"nrAttempts",
"1");
1104 Xml.WriteAttributeString(
"interval",
"PT1H");
1105 Xml.WriteEndElement();
1109 Xml.WriteEndElement();
1113 if (NrIntervals == 0)
1115 Xml.WriteStartElement(
"Interval");
1116 Xml.WriteAttributeString(
"nrAttempts",
"1");
1117 Xml.WriteAttributeString(
"interval",
"PT1H");
1118 Xml.WriteEndElement();
1121 Xml.WriteEndElement();
1125 if (!(eventSinks is
null))
1127 Xml.WriteStartElement(
"EventSinks");
1135 Xml.WriteEndElement();
1138 Xml.WriteEndElement();
1139 Xml.WriteEndDocument();
1144 await Task.Delay(5000);
1146 catch (Exception ex)
1152 writeTime = DateTime.MinValue;
1160 internal static async Task FileUpdated()
1164 if (writeTime > DateTime.MinValue)
1167 Log.
Notice(
"Gateway.config changed outside of the system. Loading configuration.");
1169 Dictionary<string, INode> OldNodes =
new Dictionary<string, INode>();
1170 List<INode> Updated =
new List<INode>();
1171 List<INode> Added =
new List<INode>();
1175 foreach (KeyValuePair<string, INode> P
in nodesById)
1176 OldNodes[P.Key] = P.Value;
1179 instance.LoadConfiguration();
1183 foreach (KeyValuePair<string, INode> P
in nodesById)
1185 if (OldNodes.Remove(P.Key))
1186 Updated.Add(P.Value);
1192 foreach (
INode Node
in OldNodes.Values)
1193 await instance.NodeDeleted(Node,
true);
1195 foreach (
INode Node
in Added)
1196 await instance.NodeAdded(Node,
true);
1198 foreach (
INode Node
in Updated)
1199 await instance.NodeUpdated(Node,
true);
1201 catch (Exception ex)
Helps with parsing of commong data types.
static string Encode(bool x)
Encodes a Boolean for use in XML and other formats.
Helps with common XML-related tasks.
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
static XmlDocument LoadFromFile(string FileName)
Loads an XML document from a file.
static XmlWriterSettings WriterSettings(bool Indent, bool OmitXmlDeclaration)
Gets an XML writer settings object.
Static class managing loading of XSL resources stored as embedded resources or in content files.
static XmlSchema LoadSchema(string ResourceName)
Loads an XML schema from an embedded resource.
static void Validate(string ObjectID, XmlDocument Xml, params XmlSchema[] Schemas)
Validates an XML document given a set of XML schemas.
Class representing an event.
Base class for event sinks.
Filters incoming events and passes remaining events to a secondary event sink.
Static class managing the application event log. Applications and services log events on this static ...
static void Exception(Exception Exception, string Object, string Actor, string EventId, EventLevel Level, string Facility, string Module, params KeyValuePair< string, object >[] Tags)
Logs an exception. Event type will be determined by the severity of the exception.
static void Error(string Message, string Object, string Actor, string EventId, EventLevel Level, string Facility, string Module, string StackTrace, params KeyValuePair< string, object >[] Tags)
Logs an error event.
static void Notice(string Message, string Object, string Actor, string EventId, EventLevel Level, string Facility, string Module, string StackTrace, params KeyValuePair< string, object >[] Tags)
Logs a notice event.
Static class managing the runtime environment of the IoT Gateway.
static HttpServer HttpServer
HTTP Server
static string ConfigFilePath
Full path to Gateway.config file.
const string GatewayConfigNamespace
http://waher.se/Schema/GatewayConfiguration.xsd
static string AppDataFolder
Application data folder.
static DateTime ScheduleEvent(Action< object > Callback, DateTime When, object State)
Schedules a one-time event.
const string GatewayConfigLocalName
GatewayConfiguration
static bool CancelScheduledEvent(DateTime When)
Cancels a scheduled event.
const string GatewayConfigLocalFileName
Gateway.config
string ResourceName
Name of resource.
An HTTP Reverse proxy resource. Incoming requests are reverted to a another web server for processing...
string RemoteHost
Host of remote web server.
int RemotePort
Port number of remote web server.
string RemoteFolder
Optional remote folder where remote content is hosted.
Implements an HTTP server.
int Http2HeaderTableSize
HTTP/2: Header table size.
int Http2InitialConnectionWindowSize
HTTP/2: Initial connection window size.
bool Http2Enabled
HTTP/2: Enabled or not.
int Http2InitialStreamWindowSize
HTTP/2: Initial stream window size.
const int DefaultHttpPort
Default HTTP Port (80).
int Http2MaxConcurrentStreams
HTTP/2: Maximum number of concurrent streams.
KeyValuePair< string, HttpReverseProxyResource >[] GetDomainProxies()
Gets all registered domain proxy resources.
const int DefaultHttpsPort
Default HTTPS port (443).
int Http2MaxFrameSize
HTTP/2: Maximum frame size.
A chunked list is a linked list of chunks of objects of type T .
void Add(T Item)
Adds an item to the collection.
T[] ToArray()
Returns an array containing all elements of the collection.
static async Task< string > ReadAllTextAsync(string FileName)
Reads a text file asynchronously.
Static class that dynamically manages types and interfaces available in the runtime environment.
static object[] NoParameters
Contains an empty array of parameter values.
static Type[] GetTypesImplementingInterface(string InterfaceFullName)
Gets all types implementing a given interface.
static ConstructorInfo GetDefaultConstructor(Type Type)
Gets the default constructor of a type, if one exists.
Contains information about a language.
Task< string > GetStringAsync(Type Type, int Id, string Default)
Gets the string value of a string ID. If no such string exists, a string is created with the default ...
Contains information about a namespace in a language.
Basic access point for runtime language localization.
static async Task< Language > GetDefaultLanguageAsync()
Gets the default language.
Abstract base class for gateway configuration nodes.
virtual Task< IEnumerable< INode > > ChildNodes
Child nodes. If no child nodes are available, null is returned.
virtual bool HasChildren
If the source has any child sources.
abstract string NodeId
ID of node.
Configures a Content-Encoding in the web server.
string Method
Content-Encoding method.
bool Static
If dynamically generated content can be compressed using this method.
bool Dynamic
If dynamically generated content can be compressed using this method.
Contains the local database definition.
int TimeoutMs
Timeout of database operations, in milliseconds.
int BlockSize
Number of bytes of each B-Tree block in the database.
int BlocksInCache
Number of blocks to maintain in internal memory.
string Folder
Folder, relative to the application data folder, where object database files will be stored.
bool Compiled
If object serializers should be compiled or not.
bool Encrypted
If the database is encrypted.
int BlobBlockSize
Number of bytes of each BLOB block in the database.
string DefaultCollectionName
Name of the collection to use, if the class definition lacks a collection definition.
Defines a default page for a host.
Abstract base class for event sink nodes.
Representation of a EventFilter
Representation of an EventQueue
Representation of a MqttEventSink
Representation of a PipeEventSink
Representation of a SocketEventSink
Representation of a SyslogEventSink
Representation of a TextFileEventSink
Representation of a WebHookEventSink
Representation of a XmlFileEventSink
Representation of a XmppEventSink
Contains configuration of custom event sinks.
string FolderPath
Path to folder with contents.
string WebFolder
Local resource that will be mapped to the file folder.
Data source mirroring the Gateway.config file.
DateTime LastChanged
When the source was last updated.
IEnumerable< IDataSource > ChildSources
Child sources. If no child sources are available, null is returned.
Task< string > GetNameAsync(Language Language)
Gets the name of data source.
Task< bool > CanViewAsync(RequestOrigin Caller)
If the data source is visible to the caller.
bool HasChildren
If the source has any child sources.
GatewayConfigSource()
Data source mirroring the Gateway.config file.
Task< INode > GetNodeAsync(IThingReference NodeRef)
Gets the node, given a reference to it.
EventHandlerAsync< SourceEvent > OnEvent
Event raised when a data source event has been raised.
IEnumerable< INode > RootNodes
Root node references. If no root nodes are available, null is returned.
void Dispose()
IDisposable.Dispose
const string SourceID
Source ID for the reports data source.
Represents an interval in a LoginAuditor configuration.
Contains information about a Login Auditor Exception.
Contains configuration of the Login Auditor.
mTLS-configuration for a specific port number.
bool TrustClientCertificates
If certificates are to be trusted, or if they are required to be valid.
int PortNumber
Port number
ClientCertificates ClientCertificates
mTLS-configuration
References a port number.
int PortNumber
Port number
Root node of port numbers to use.
Defines a proxy domain to act as a reverse proxy for a specific domain name.
string RemoteDomain
Location client is redirected to.
string LocalDomain
Domain being redirected.
string RemoteFolder
If sub-paths should be included in the redirection.
int TimeoutMs
If redirection is permanent (true) or temporary (false).
int RemotePort
If redirection is permanent (true) or temporary (false).
bool UseSession
If forwarded requests are encrypted (HTTPS) or not (HTTP).
bool Encrypted
If forwarded requests are encrypted (HTTPS) or not (HTTP).
string Privilege
Required privilege to access the resource. If not specified, the resource is public.
Defines a proxy resource to act as a reverse proxy.
bool Encrypted
If forwarded requests are encrypted (HTTPS) or not (HTTP).
string RemoteDomain
Location client is redirected to.
bool UseSession
If forwarded requests are encrypted (HTTPS) or not (HTTP).
string RemoteFolder
If sub-paths should be included in the redirection.
string LocalResource
Resource being redirected.
int TimeoutMs
If redirection is permanent (true) or temporary (false).
int RemotePort
If redirection is permanent (true) or temporary (false).
string Privilege
Required privilege to access the resource. If not specified, the resource is public.
bool IncludeSubPaths
If sub-paths should be included in the redirection.
string Resource
Resource being redirected.
bool Permanent
If redirection is permanent (true) or temporary (false).
string Location
Location client is redirected to.
Defines a vanity resource.
string Url
URL the resource points to. Can include references to named group in the regular expression.
string Regex
Regular expression defining a vanity resource or set of vanity resources.
Settings for the Web Server.
bool Http2Profiling
Maximum Frame Size, in bytes.
int Http2InitialConnectionWindowSize
Initial Connection Window Size, in bytes.
ClientCertificates ClientCertificates
mTLS-configuration
int Http2InitialStreamWindowSize
Initial Window Size, in bytes.
int Http2HeaderTableSize
Dynamic Header Table Size, in bytes.
int Http2MaxConcurrentStreams
Maximum number of concurrent streams.
int Http2MaxFrameSize
Maximum Frame Size, in bytes.
bool TrustClientCertificates
If certificates are to be trusted, or if they are required to be valid.
bool Http2Enabled
If HTTP/2 is enabled or not.
bool HttpSniffersPerEndpoint
Separate sniffers by remote endpoint.
bool Http2NoRfc7540Priorities
Maximum Frame Size, in bytes.
Tokens available in request.
static readonly RequestOrigin Empty
Empty request origin.
bool HasPrivilege(string Privilege)
If the origin has a given privilege.
static NodeRemoved FromNode(INode Node)
Creates an event object from a node object.
Abstract base class for all data source events.
Interface for content encodings in HTTP transfers.
bool SupportsStaticEncoding
If encoding can be used for static encoding.
void ConfigureSupport(bool Dynamic, bool Static)
Configures support for the algorithm.
bool SupportsDynamicEncoding
If encoding can be used for dynamic encoding.
string Label
Label identifying the Content-Encoding
Interface for datasources that are published through the concentrator interface.
Interface for nodes that are published through the concentrator interface.
Task< IEnumerable< INode > > ChildNodes
Child nodes. If no child nodes are available, null is returned.
Interface for thing references.
string Partition
Optional partition in which the Node ID is unique.
string SourceId
Optional ID of source containing node.
FromEventLevel
Allows events from a certain level.
SyslogEventSeparation
How events are separated in the Syslog event stream.
ClientCertificates
Client Certificate Options
Represents a duration value, as defined by the xsd:duration data type: http://www....
static readonly Duration Zero
Zero value