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(
"SensorServer"))
64 throw new Exception(
"Define provisioning clients before any sensor server extensions.");
66 if (Client.ContainsTag(
"ControlServer"))
67 throw new Exception(
"Define provisioning clients before any control server extensions.");
69 if (Client.ContainsTag(
"ConcentratorServer"))
70 throw new Exception(
"Define provisioning clients before any concentrator server extensions.");
73 Client.SetTag(
"ProvisioningClient", Extension);
75 Extension.CanControlQuestion += (Sender, e) =>
78 new KeyValuePair<string, object>(
"e", e),
79 new KeyValuePair<string, object>(
"Client", Client));
81 return Task.CompletedTask;
84 Extension.CanReadQuestion += (Sender, e) =>
87 new KeyValuePair<string, object>(
"e", e),
88 new KeyValuePair<string, object>(
"Client", Client));
90 return Task.CompletedTask;
93 Extension.IsFriendQuestion += (Sender, e) =>
96 new KeyValuePair<string, object>(
"e", e),
97 new KeyValuePair<string, object>(
"Client", Client));
99 return Task.CompletedTask;
102 Extension.CacheCleared += (Sender, e) =>
105 new KeyValuePair<string, object>(
"e", e),
106 new KeyValuePair<string, object>(
"Client", Client));
108 return Task.CompletedTask;
111 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.
Provisioning Client XMPP extension
override Task< object > Add(IActor Instance, Waher.Networking.XMPP.XmppClient Client)
Adds the extension to the client.
ProvisioningClientExtension(ISimulationNode Parent, Model Model)
Provisioning Client XMPP extension
override ISimulationNode Create(ISimulationNode Parent, Model Model)
Creates a new instance of the node.
override string LocalName
Local name of XML element defining contents of class.
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 provisioning 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...