2using System.Threading.Tasks;
6using System.Text.RegularExpressions;
25 : base(
@"^s2sgraph\s*.*$")
32 public override string Name =>
"S2SGraph";
42 public override async Task
Execute(
ChatState State,
string[] Arguments,
string OrgMessage, Match Details,
45 string Script = OrgMessage.Substring(8).Trim();
49 if (
string.IsNullOrEmpty(Script))
52 Color = SKColors.Empty;
61 StringBuilder sb =
new StringBuilder();
62 string Title =
string.IsNullOrEmpty(IoTGateway.Gateway.Domain) ? IoTGateway.Gateway.XmppClient.BareJID : IoTGateway.Gateway.Domain.Value;
64 sb.AppendLine(
"```dot");
65 sb.AppendLine(
"digraph G {");
66 sb.AppendLine(
"rankdir=LR");
74 sb.Append(
"\" -> \"");
78 if (Stat.
Type !=
"XMPP")
80 sb.Append(
" [label=\"");
91 await ResponseCallback(sb.ToString(),
string.Empty);
101 new HelpItem(
"S2SGraph[ SCRIPT]",
"Returns a GraphViz graph of the current broker and how it is connected to other federated brokers. Such a graph illustrates the federated network. Optional script can be provided, and its result embedded in the graph. Consolidating responses from multiple brokers generates a S2S graph of all brokers.")
Mainstains information about connectivity from a specific endpoint.
string Type
Type of Endpoint
string Name
Name of Endpoint
Class managing a script expression.
async Task< object > EvaluateAsync(Variables Variables)
Evaluates the expression, using the variables provided in the Variables collection....
readonly Variables Session
Session variables
An administrative command whose syntax is validated with a regular expression.
Contains an item of information about a command.
Returns a GraphViz graph of the current broker and how it is connected to other federated brokers....
override HelpItem[] GetHelp()
Markdown description of syntax.
S2sGraph()
Returns a GraphViz graph of the current broker and how it is connected to other federated brokers....
override async Task Execute(ChatState State, string[] Arguments, string OrgMessage, Match Details, ResponseCallbackHandler ResponseCallback)
Executes the command.
override string Name
Command name
Executes script (if provided), and returns the result in the form of a GraphViz graph of the current ...
Service Module hosting the XMPP broker and its components.
delegate Task< string > ResponseCallbackHandler(string Markdown, string MessageId)
Delegate for response callback handler methods.