2using System.Collections.Generic;
3using System.Threading.Tasks;
27 : base(
"Legal/GetIdentity",
28 new KeyValuePair<Type,
Expression>(typeof(Dictionary<string, object>), new
Expression(jsonPattern)),
53 string LegalId = (string)Parameters[
"PLegalId"].AssociatedObjectValue;
54 int i = LegalId.IndexOf(
'@');
58 string LegalDomain = LegalId.Substring(i + 1);
74 await Client.
SendIqGet(LegalDomain,
"<getLegalIdentity id=\"" +
XML.
Encode(LegalId) +
"\" xmlns=\"" +
75 LegalNamespace +
"\"/>", async (Sender, e) =>
79 if (e.Ok && !((E = e.FirstElement) is
null) && E.LocalName ==
"identity")
81 await Response.Return(new NamedDictionary<string, object>(
"IdentityResponse", AgentNamespace)
94 User.UserName +
"@" + (
Gateway.
Domain?.Value ??
string.Empty),
95 LegalDomain,
string.Empty,
"<getLegalIdentity id=\"" +
XML.
Encode(LegalId) +
"\" xmlns=\"" +
96 LegalNamespace +
"\"/>", async (Sender, e) =>
100 if (e.Ok && !((E = e.FirstElement) is
null) && E.LocalName ==
"identity")
A Named dictionary is a dictionary, with a local name and a namespace. Use it to return content that ...
Static class managing loading of resources stored as embedded resources or in content files.
static string LoadResourceAsText(string ResourceName)
Loads a text resource from an embedded resource.
Helps with common XML-related tasks.
static string Encode(string s)
Encodes a string for use in XML.
Static class managing the runtime environment of the IoT Gateway.
static CaseInsensitiveString Domain
Domain name.
static XmppClient XmppClient
XMPP Client connection of gateway.
The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repe...
Represents an HTTP request.
Represets a response of an HTTP client request.
async Task SendResponse()
Sends the response back to the client. If the resource is synchronous, there's no need to call this m...
The server is currently unable to handle the request due to a temporary overloading or maintenance of...
Manages an XMPP client connection. Implements XMPP, as defined in https://tools.ietf....
static XmppException GetExceptionObject(XmlElement StanzaElement)
Gets an XMPP Exception object corresponding to its XML definition.
Task< uint > SendIqGet(string To, string Xml, EventHandlerAsync< IqResultEventArgs > Callback, object State)
Sends an IQ Get request.
Static class that dynamically manages types and interfaces available in the runtime environment.
static bool TryGetModuleParameter(string Name, out object Value)
Tries to get a module parameter value.
Class managing a script expression.
Provisioning and registry service component.
static string NamespaceLegalIdentity(NamespaceSet Version)
Returns the namespace for legal identities.
Abstract base class for agent resources supporting the POST method.
static AccountUser AssertUserAuthenticated(HttpRequest Request)
Makes sure the request is made by an authenticated API user.
const string AgentNamespace
https://waher.se/Schema/BrokerAgent.xsd
static Exception ToHttpException(XmppException ex)
Tries to convert an XMPP Exception to an HTTP Exception.
override async Task POST(HttpRequest Request, HttpResponse Response, Dictionary< string, IElement > Parameters)
Executes the POST method on the resource.
override bool Synchronous
If the resource is synchronous (i.e. returns a response in the method handler), or if it is asynchron...
GetIdentity()
Gets an identity.
Service Module hosting the XMPP broker and its components.
NamespaceSet
Namespace versions