2using System.Collections.Generic;
3using System.Threading.Tasks;
25 private bool registerInGateway =
false;
35 public override string Resource =>
"/Settings/InternetGateway.md";
48 get => this.registerInGateway;
49 set => this.registerInGateway = value;
67 if (this.registerInGateway && (this.registrator is
null))
69 List<InternetGatewayRegistration> Ports =
new List<InternetGatewayRegistration>();
75 if (Port >= 0 && Port <= ushort.MaxValue)
79 ApplicationName =
"TAG Neuron " + Protocol +
"-" + Port.
ToString(),
80 ExternalPort = (ushort)Port,
81 LocalPort = (ushort)Port,
97 await this.registrator.
Start();
117 this.setRegistration = WebServer.
Register(
"/Settings/SetRegistration",
null, this.SetRegistration,
true,
false,
true);
119 return base.InitSetup(WebServer);
135 if (!(Obj is Dictionary<string, object> Parameters))
138 if (!Parameters.TryGetValue(
"clicked", out Obj) || !(Obj is
bool Clicked))
141 this.registerInGateway = Clicked;
143 Response.StatusCode = 200;
156 return base.UnregisterSetup(WebServer);
165 this.registerInGateway =
false;
166 return Task.FromResult(
true);
172 [Obsolete(
"Use DisposeAsync() instead.")]
190 if (!(this.registrator is
null))
193 this.registrator =
null;
210 return Task.FromResult(
false);
212 return Task.FromResult(
true);
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 class managing the runtime environment of the IoT Gateway.
static IUser AssertUserAuthenticated(HttpRequest Request, string Privilege)
Makes sure a request is being made from a session with a successful user login.
static string[] GetProtocols()
Gets the protocol names defined in the configuration file.
static int[] GetConfigPorts(string Protocol)
Gets the port numbers defined for a given protocol in the configuration file.
Abstract base class for system configurations.
bool TryGetEnvironmentVariable(string VariableName, bool Required, out string Value)
Tries to get a string-valued environment variable.
The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repe...
Represents an HTTP request.
bool HasData
If the request has data.
async Task< object > DecodeDataAsync()
Decodes data sent in request.
Base class for all HTTP resources.
Represets a response of an HTTP client request.
Implements an HTTP server.
HttpResource Register(HttpResource Resource)
Registers a resource with the server.
bool Unregister(HttpResource Resource)
Unregisters a resource from the server.
Represents a registraing in an UPnP-compatible Internet Gateway.
override string ToString()
Manages registration of TCP and UDP ports in an Internet Gateway
virtual async Task Start()
Starts the registration.
virtual async Task DisposeAsync()
IDisposable.Dispose
Static interface for database persistence. In order to work, a database provider has to be assigned t...
static async Task Update(object Object)
Updates an object in the database.
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 ...
Provides the user with options to register the broker in UPnP-compatible Internet Gateways.
override void SetStaticInstance(ISystemConfiguration Configuration)
Sets the static instance of the configuration.
static InternetGatewayConfiguration Instance
Current instance of configuration.
override string Resource
Resource to be redirected to, to perform the configuration.
void Dispose()
IDisposable.Dispose
override Task< bool > SimplifiedConfiguration()
Simplified configuration by configuring simple default values.
override string ConfigPrivilege
Minimum required privilege for a user to be allowed to change the configuration defined by the class.
override Task UnregisterSetup(HttpServer WebServer)
Unregisters the setup object.
override int Priority
Priority of the setting. Configurations are sorted in ascending order.
override async Task ConfigureSystem()
Is called during startup to configure the system.
const string BROKER_INET_GATEWAY_REG
true or 1 if the broker should register itself in any Internet Gateway it finds in the Local Area Net...
override Task< string > Title(Language Language)
Gets a title for the system configuration.
async Task DisposeAsync()
IDisposable.Dispose
override Task InitSetup(HttpServer WebServer)
Initializes the setup object.
bool RegisterInGateway
If a connection to the support account should be added.
override Task< bool > EnvironmentConfiguration()
Environment configuration by configuring values available in environment variables.
Service Module hosting the XMPP broker and its components.
Interface for system configurations. The gateway will scan all module for system configuration classe...