2using System.Threading.Tasks;
54 [Page(7,
"Configuration")]
55 [Header(159,
"Broker:")]
56 [ToolTip(160,
"Host name of broker.")]
63 [Page(7,
"Configuration")]
64 [Header(161,
"Port:")]
65 [ToolTip(162,
"Port number of the broker.")]
68 public int Port {
get;
set; }
73 [Page(7,
"Configuration")]
74 [Header(163,
"Use Encryption (TLS)")]
75 [ToolTip(164,
"If TLS is used to connect to the broker.")]
77 public bool Tls {
get;
set; }
82 [Page(7,
"Configuration")]
83 [Header(165,
"User Name:")]
84 [ToolTip(166,
"User name to use when connecting to the broker.")]
90 [Page(7,
"Configuration")]
91 [Header(167,
"Password:")]
92 [ToolTip(168,
"Password to use when connecting to the broker.")]
93 [Text(
TextPosition.AfterField, 169,
"Note: Leave User Name and Password empty to either connect anonymously, or authenticate using mTLS where such is supported.")]
99 [Page(7,
"Configuration")]
100 [Header(170,
"Topic:")]
101 [ToolTip(171,
"Topic to publish events to.")]
122 LinkedList<Parameter> Parameters = (LinkedList<Parameter>)await base.GetDisplayableParametersAsync(
Language, Caller);
137 public override void Export(XmlWriter Output)
139 Output.WriteStartElement(
"MqttEventSink");
140 Output.WriteAttributeString(
"id", this.
SinkId);
141 Output.WriteAttributeString(
"broker", this.
Broker);
142 Output.WriteAttributeString(
"port", this.
Port.ToString());
145 if (!
string.IsNullOrEmpty(this.
UserName))
146 Output.WriteAttributeString(
"username", this.
UserName);
148 if (!
string.IsNullOrEmpty(this.
Password))
149 Output.WriteAttributeString(
"password", this.
Password);
151 Output.WriteAttributeString(
"topic", this.
Topic);
152 Output.WriteEndElement();
Helps with parsing of commong data types.
static string Encode(bool x)
Encodes a Boolean for use in XML and other formats.
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 ...
async Task< Namespace > GetNamespaceAsync(string Name)
Gets the namespace object, given its name, if available.
Contains information about a namespace in a language.
Task< LanguageString > GetStringAsync(int Id)
Gets the string object, given its ID, if available.
Abstract base class for gateway configuration nodes.
virtual INode Parent
Parent Node, or null if a root node.
GatewayConfigSource Source
Source hosting the node.
Abstract base class for event sink nodes.
string SinkId
Domain being redirected.
Representation of a MqttEventSink
MqttEventSinkNode()
Representation of a MqttEventSink
string Password
Password to connect to the broker.
string Topic
Topic to publish events to.
string UserName
User name to connect to the broker.
override Task< string > GetTypeNameAsync(Language Language)
Gets the type name of the node.
int Port
Port number of the broker.
bool Tls
If TLS is used to connect to the broker.
string Broker
Broker host name
override void Export(XmlWriter Output)
Exports the event sink definition to XML.
MqttEventSinkNode(GatewayConfigSource Source, ConfigurationNode Parent, string SinkId, string Broker, int Port, bool Tls, string UserName, string Password, string Topic)
Representation of a MqttEventSink
override async Task< IEnumerable< Parameter > > GetDisplayableParametersAsync(Language Language, RequestOrigin Caller)
Gets displayable parameters.
Data source mirroring the Gateway.config file.
References a port number.
Boolean-valued parameter.
Tokens available in request.
TextPosition
Where the instructions are to be place.