2using System.Collections.Generic;
3using System.Threading.Tasks;
16 private string componentAddress;
48 public override Task
FromXml(XmlElement Definition)
50 this.componentAddress =
XML.
Attribute(Definition,
"componentAddress");
52 return base.FromXml(Definition);
63 if (Client.ContainsTag(
"ConcentratorServer"))
64 throw new Exception(
"Define thing registry clients before any concentrator server extensions.");
67 Client.SetTag(
"ThingRegistryClient", Extension);
69 Extension.Claimed += (Sender, e) =>
72 new KeyValuePair<string, object>(
"e", e),
73 new KeyValuePair<string, object>(
"Client", Client));
75 return Task.CompletedTask;
78 Extension.Disowned += (Sender, e) =>
81 new KeyValuePair<string, object>(
"e", e),
82 new KeyValuePair<string, object>(
"Client", Client));
84 return Task.CompletedTask;
87 Extension.Removed += (Sender, e) =>
90 new KeyValuePair<string, object>(
"e", e),
91 new KeyValuePair<string, object>(
"Client", Client));
93 return Task.CompletedTask;
96 return Task.FromResult<
object>(Extension);
Root node of a simulation model
bool ExternalEvent(IExternalEventsNode Source, string Name, params KeyValuePair< string, object >[] Arguments)
Method called when an external event has been received.
Abstract base class for IoT XMPP extensions.
ThingRegistry Client XMPP extension
override Task< object > Add(IActor Instance, Waher.Networking.XMPP.XmppClient Client)
Adds the extension to the client.
override string LocalName
Local name of XML element defining contents of class.
override ISimulationNode Create(ISimulationNode Parent, Model Model)
Creates a new instance of the node.
ThingRegistryClientExtension(ISimulationNode Parent, Model Model)
ThingRegistry Client XMPP extension
override Task FromXml(XmlElement Definition)
Sets properties and attributes of class in accordance with XML definition.
Helps with common XML-related tasks.
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
Implements an XMPP thing registry client interface.
Manages an XMPP client connection. Implements XMPP, as defined in https://tools.ietf....
Basic interface for simulator nodes. Implementing this interface allows classes with default contruct...
ISimulationNode Parent
Parent node in the simulation model.
Basic interface for simulator nodes. Implementing this interface allows classes with default contruct...