Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ConcentratorSourceNode.cs
1using System.Collections.Generic;
2using System.Threading.Tasks;
8
9namespace Waher.Things.Xmpp
10{
14 [TypeAlias("Waher.Things.Xmpp.SourceNode")]
16 {
21 : base()
22 {
23 }
24
28 [Page(2, "XMPP", 100)]
29 [Header(5, "Source ID:")]
30 [ToolTip(6, "Source ID in concentrator.")]
31 public string RemoteSourceID { get; set; }
32
36 public override string LocalId => this.RemoteSourceID;
37
43 public override Task<string> GetTypeNameAsync(Language Language)
44 {
45 return Language.GetStringAsync(typeof(ConcentratorDevice), 6, "Source ID");
46 }
47
53 public override Task<bool> AcceptsParentAsync(INode Parent)
54 {
55 return Task.FromResult(Parent is ConcentratorDevice || Parent is XmppBrokerNode);
56 }
57
63 public override Task<bool> AcceptsChildAsync(INode Child)
64 {
65 return Task.FromResult(Child is ConcentratorPartitionNode || Child is ConcentratorNode);
66 }
67
71 public override Task<IEnumerable<ICommand>> Commands => this.GetCommands();
72
73 private async Task<IEnumerable<ICommand>> GetCommands()
74 {
75 List<ICommand> Result = new List<ICommand>();
76 Result.AddRange(await base.Commands);
77
78 ConcentratorDevice Concentrator = await this.GetAncestor<ConcentratorDevice>();
79 if (!(Concentrator is null))
80 Result.Add(new ScanSource(Concentrator, this));
81
82 return Result.ToArray();
83 }
84
85 }
86}
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.
Base class for all provisioned metering nodes.
Scans a source node on a concentrator node for its child sources and root nodes.
Definition: ScanSource.cs:15
Node representing an XMPP concentrator.
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.
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 ...
override string LocalId
If provided, an ID for the node, but unique locally between siblings. Can be null,...
override Task< string > GetTypeNameAsync(Language Language)
Gets the type name of the node.
override Task< IEnumerable< ICommand > > Commands
Available command objects. If no commands are available, null is returned.
ConcentratorSourceNode()
Node representing a data source in an XMPP 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...
Node representing an XMPP broker.
Interface for nodes that are published through the concentrator interface.
Definition: INode.cs:49