Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ConcentratorNode.cs
1using System.Collections.Generic;
2using System.Threading.Tasks;
7
8namespace Waher.Things.Xmpp
9{
13 [TypeAlias("Waher.Things.Xmpp.XmppNode")]
15 {
20 : base()
21 {
22 }
23
27 [Page(2, "XMPP", 100)]
28 [Header(10, "Node ID:")]
29 [ToolTip(11, "Node ID in data source (and partition).")]
30 public string RemoteNodeID { get; set; }
31
35 public override string LocalId => this.RemoteNodeID;
36
42 public override Task<string> GetTypeNameAsync(Language Language)
43 {
44 return Language.GetStringAsync(typeof(ConcentratorDevice), 54, "Node");
45 }
46
52 public override Task<bool> AcceptsParentAsync(INode Parent)
53 {
54 return Task.FromResult(
60 }
61
67 public override Task<bool> AcceptsChildAsync(INode Child)
68 {
69 return Task.FromResult(Child is ConcentratorNode);
70 }
71
75 public override Task<IEnumerable<ICommand>> Commands => this.GetCommands();
76
77 private async Task<IEnumerable<ICommand>> GetCommands()
78 {
79 List<ICommand> Result = new List<ICommand>();
80 Result.AddRange(await base.Commands);
81
82 ConcentratorDevice Concentrator = await this.GetAncestor<ConcentratorDevice>();
83 if (!(Concentrator is null))
84 Result.Add(new ScanNode(Concentrator, this));
85
86 return Result.ToArray();
87 }
88
89 }
90}
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