Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ConcentratorNode.cs
2using System.Threading.Tasks;
6
7namespace Waher.Things.Xmpp
8{
13 {
18 : base()
19 {
20 }
21
25 [Page(2, "XMPP", 100)]
26 [Header(10, "Node ID:")]
27 [ToolTip(11, "Node ID in data source (and partition).")]
28 public string RemoteNodeID { get; set; }
29
33 public override string LocalId => this.RemoteNodeID;
34
40 public override Task<string> GetTypeNameAsync(Language Language)
41 {
42 return Language.GetStringAsync(typeof(ConcentratorDevice), 54, "Node");
43 }
44
50 public override Task<bool> AcceptsParentAsync(INode Parent)
51 {
52 return Task.FromResult(
58 }
59
65 public override Task<bool> AcceptsChildAsync(INode Child)
66 {
67 return Task.FromResult(Child is ConcentratorNode);
68 }
69
73 public override Task<IEnumerable<ICommand>> Commands => this.GetCommands();
74
75 private async Task<IEnumerable<ICommand>> GetCommands()
76 {
77 List<ICommand> Result = new List<ICommand>();
78 Result.AddRange(await base.Commands);
79
80 ConcentratorDevice Concentrator = await this.GetAncestor<ConcentratorDevice>();
81 if (!(Concentrator is null))
82 Result.Add(new ScanNode(Concentrator, this));
83
84 return Result.ToArray();
85 }
86
87 }
88}
Contains information about a language.
Definition: Language.cs:17
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 ...
Definition: Language.cs:209
INode Parent
Parent Node, or null if a root node.
Scans a node on a concentrator node for its child nodes.
Definition: ScanNode.cs:15
Node representing an XMPP concentrator.
Base class for nodes in a remote concentrator.
override Task< bool > AcceptsParentAsync(INode Parent)
If the node accepts a presumptive parent, i.e. can be added to that parent (if that parent accepts th...
override Task< string > GetTypeNameAsync(Language Language)
Gets the type name of the node.
override string LocalId
If provided, an ID for the node, but unique locally between siblings. Can be null,...
override Task< IEnumerable< ICommand > > Commands
Available command objects. If no commands are available, null is returned.
override Task< bool > AcceptsChildAsync(INode Child)
If the node accepts a presumptive child, i.e. can receive as a child (if that child accepts the node ...
ConcentratorNode()
Base class for nodes in a remote concentrator.
Node representing a partition in a data source in an XMPP concentrator.
Node representing a data source in an XMPP concentrator.
Node representing an XMPP broker.
Abstract base class for devices on the XMPP network.
Definition: XmppDevice.cs:13
Interface for nodes that are published through the concentrator interface.
Definition: INode.cs:49