2using System.Collections.Generic;
4using System.Threading.Tasks;
27 params KeyValuePair<Type, Expression>[] PatternMatches)
28 : base(AgentResourceName, PatternMatches)
67 protected static bool IsValidJID(
string JID,
bool AllowDomainJID,
bool AllowBareJID,
bool AllowFullJID)
71 if (JID.EndsWith(
"@"))
75 int i = JID.IndexOf(
"@/");
77 JID = JID.Insert(i + 1,
"example.com");
101 DateTime Now = DateTime.Now;
112 StringBuilder Xml =
new StringBuilder();
115 return Xml.ToString();
118 private static string LegalIDXml(
LegalIdentity ID, StringBuilder Xml)
120 string BareJid =
null;
122 foreach (
Property P
in ID.Properties)
131 if (
string.IsNullOrEmpty(BareJid))
134 Xml.Append(
"<qlRef xmlns='");
136 Xml.Append(
"' bareJid='");
140 ID.Serialize(Xml,
true,
true,
true,
true,
true,
true,
true,
null,
XmppServerModule.Legal);
142 Xml.Append(
"</qlRef>");
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.
Abstract base class for XMPP client connections
const string QuickLoginNamespace
http://waher.se/Schema/QL.xsd
Manages an XMPP client connection. Implements XMPP, as defined in https://tools.ietf....
static readonly Regex DomainJidRegEx
Regular expression for Domain JIDs
static readonly Regex FullJidRegEx
Regular expression for Full JIDs
static readonly Regex BareJidRegEx
Regular expression for Bare JIDs
Represents a case-insensitive string.
static readonly CaseInsensitiveString Empty
Empty case-insensitive string
static bool IsNullOrEmpty(CaseInsensitiveString value)
Indicates whether the specified string is null or an CaseInsensitiveString.Empty string.
Static interface for database persistence. In order to work, a database provider has to be assigned t...
This filter selects objects that conform to all child-filters provided.
This filter selects objects that have a named field equal to a given value.
This filter selects objects that have a named field greater or equal to a given value.
This filter selects objects that have a named field lesser or equal to a given value.
CaseInsensitiveString Name
Property name
CaseInsensitiveString Value
Property value
Abstract base class for agent resources supporting the POST method.
Abstract base class for XMPP resources.
static bool IsValidJID(string JID)
Checks if a string is a valid Bare or Full JID.
static bool IsValidFullJID(string JID)
Checks if a string is a valid Full JID.
static bool IsValidBareJID(string JID)
Checks if a string is a valid Bare JID.
static bool IsValidJID(string JID, bool AllowDomainJID, bool AllowBareJID, bool AllowFullJID)
Checks if a string is a valid Bare or Full JID.
static async Task< string > GetApprovedLegalIDXml(string Account)
Gets XML containing the latest approvied Legal ID for an account, for inclusion in requests to peers.
AgentXmppPostResource(string AgentResourceName, params KeyValuePair< Type, Expression >[] PatternMatches)
Abstract base class for XMPP resources.
Service Module hosting the XMPP broker and its components.
IdentityState
Lists recognized legal identity states.