Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ParentGraph.cs
1using System.Text;
2using System.Threading.Tasks;
4
6{
12 {
17 public ParentGraph()
18 {
19 }
20
24 public override string Name => "ParentGraph";
25
33 public override async Task Execute(ChatState State, string[] Arguments, string OrgMessage, ResponseCallbackHandler ResponseCallback)
34 {
35 StringBuilder sb = new StringBuilder();
36
37 sb.AppendLine("```dot");
38 sb.AppendLine("digraph G {");
39 sb.AppendLine("rankdir=LR");
40 sb.Append('"');
41 sb.Append(IoTGateway.Setup.XmppConfiguration.Instance.Host);
42 sb.Append("\" -> \"");
43 sb.Append(Gateway.HasDomain ? Gateway.Domain.Value : Gateway.XmppClient.BareJID);
44 sb.AppendLine("\" [dir=back];");
45 sb.AppendLine("}");
46 sb.AppendLine("```");
47
48 await ResponseCallback(sb.ToString(), string.Empty);
49 }
50
54 public override string[] HelpParagraphs => new string[] { "Returns a GraphViz graph of the current broker connected to its parent broker. Consolidating responses from multiple brokers generates a topology graph of all brokers." };
55 }
56}
Static class managing the runtime environment of the IoT Gateway.
Definition: Gateway.cs:147
static CaseInsensitiveString Domain
Domain name.
Definition: Gateway.cs:3087
static XmppClient XmppClient
XMPP Client connection of gateway.
Definition: Gateway.cs:4038
static bool HasDomain
If a domain name is configured.
Definition: Gateway.cs:3093
An administrative command with no parameters.
Returns a GraphViz graph of the current broker connected to its parent broker. Consolidating response...
Definition: ParentGraph.cs:12
ParentGraph()
Returns a GraphViz graph of the current broker connected to its parent broker. Consolidating response...
Definition: ParentGraph.cs:17
override string[] HelpParagraphs
Markdown description of syntax.
Definition: ParentGraph.cs:54
override async Task Execute(ChatState State, string[] Arguments, string OrgMessage, ResponseCallbackHandler ResponseCallback)
Executes the command.
Definition: ParentGraph.cs:33
delegate Task< string > ResponseCallbackHandler(string Markdown, string MessageId)
Delegate for response callback handler methods.