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);
64 Client.SetTag(
"PubSub", Extension);
66 Extension.AffiliationNotification += (Sender, e) =>
69 new KeyValuePair<string, object>(
"e", e),
70 new KeyValuePair<string, object>(
"Client", Client));
72 return Task.CompletedTask;
75 Extension.ItemNotification += (Sender, e) =>
78 new KeyValuePair<string, object>(
"e", e),
79 new KeyValuePair<string, object>(
"Client", Client));
81 return Task.CompletedTask;
84 Extension.ItemRetracted += (Sender, e) =>
87 new KeyValuePair<string, object>(
"e", e),
88 new KeyValuePair<string, object>(
"Client", Client));
90 return Task.CompletedTask;
93 Extension.NodePurged += (Sender, e) =>
96 new KeyValuePair<string, object>(
"e", e),
97 new KeyValuePair<string, object>(
"Client", Client));
99 return Task.CompletedTask;
102 Extension.SubscriptionRequest += (Sender, e) =>
105 new KeyValuePair<string, object>(
"e", e),
106 new KeyValuePair<string, object>(
"Client", Client));
108 return Task.CompletedTask;
111 Extension.SubscriptionStatusChanged += (Sender, e) =>
114 new KeyValuePair<string, object>(
"e", e),
115 new KeyValuePair<string, object>(
"Client", Client));
117 return Task.CompletedTask;
120 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.
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.
PubSubExtension(ISimulationNode Parent, Model Model)
PubSub XMPP extension
override ISimulationNode Create(ISimulationNode Parent, Model Model)
Creates a new instance of the node.
override Task FromXml(XmlElement Definition)
Sets properties and attributes of class in accordance with XML definition.
Abstract base class for XMPP extensions.
Helps with common XML-related tasks.
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
Client managing communication with a Publish/Subscribe component. https://xmpp.org/extensions/xep-006...
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...