2using System.Threading.Tasks;
6using System.Text.RegularExpressions;
26 : base(
@"^s2sgraph\s*.*$")
33 public override string Name =>
"S2SGraph";
43 public override async Task
Execute(
ChatState State,
string[] Arguments,
string OrgMessage, Match Details,
46 string Script = OrgMessage.Substring(8).Trim();
50 if (
string.IsNullOrEmpty(Script))
53 Color = SKColors.Empty;
62 StringBuilder sb =
new StringBuilder();
63 string Title = Gateway.HasDomain ? Gateway.Domain.Value :
Gateway.
XmppClient.BareJID;
65 sb.AppendLine(
"```dot");
66 sb.AppendLine(
"digraph G {");
67 sb.AppendLine(
"rankdir=LR");
75 sb.Append(
"\" -> \"");
79 if (Stat.
Type !=
"XMPP")
81 sb.Append(
" [label=\"");
92 await ResponseCallback(sb.ToString(),
string.Empty);
102 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.")
Static class managing the runtime environment of the IoT Gateway.
static XmppClient XmppClient
XMPP Client connection of gateway.
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.