2using System.Collections.Generic;
3using System.Threading.Tasks;
17 private readonly Dictionary<Guid, string> jidByConnection =
new Dictionary<Guid, string>();
20 private readonly
INode[] nodes;
24 this.nodes =
new INode[]
36 public event EventHandlerAsync<SourceEvent> OnEvent;
68 foreach (
INode Node
in this.nodes)
74 return Task.FromResult<
INode>(Node);
81 return Task.FromResult<
INode>(
null);
91 lock (this.jidByConnection)
96 await this.OnEvent.Raise(
this,
Event);
106 lock (this.jidByConnection)
114 await this.OnEvent.Raise(
this,
Event);
124 lock (this.jidByConnection)
126 if (!this.jidByConnection.TryGetValue(e.
Connection.
Id, out OldId))
127 OldId =
string.Empty;
132 lock (this.jidByConnection)
137 await this.OnEvent.Raise(
this,
Event);
145 internal async Task ServerConnectionAdded(
object _, Networking.XMPP.Server.ServerConnectionEventArgs e)
152 internal async Task ServerConnectionRemoved(
object _, Networking.XMPP.Server.ServerConnectionEventArgs e)
159 internal async Task ServerConnectionUpdated(
object _, Networking.XMPP.Server.ServerConnectionEventArgs e)
Class representing an event.
Static class managing the application event log. Applications and services log events on this static ...
static void Exception(Exception Exception, string Object, string Actor, string EventId, EventLevel Level, string Facility, string Module, params KeyValuePair< string, object >[] Tags)
Logs an exception. Event type will be determined by the severity of the exception.
Client Connection event argument.
IClientConnection Connection
Client Connection
Abstract base class for XMPP client connections
Abstract base class for server connections.
Mainstains information about connectivity from a specific s2s endpoint.
bool TryGetClientConnection(string FullJID, out IClientConnection Connection)
Tries to get an active client connection.
bool TryGetS2sStatistics(CaseInsensitiveString Endpoint, out S2sEndpointStatistics Stat)
Tries to get available S2S Endpoint statistics for an endpoint.
bool TryGetS2sEndpoint(string RemoteDomain, out IS2SEndpoint Endpoint)
Tries to get a server-to-server connection state object.
Contains information about a language.
Task< string > GetStringAsync(Type Type, int Id, string Default)
Gets the string value of a string ID. If no such string exists, a string is created with the default ...
Basic access point for runtime language localization.
static async Task< Language > GetDefaultLanguageAsync()
Gets the default language.
bool HasChildren
If the source has any child sources.
IEnumerable< INode > RootNodes
Root node references. If no root nodes are available, null is returned.
Task< string > GetNameAsync(Language Language)
Gets the name of data source.
IEnumerable< IDataSource > ChildSources
Child sources. If no child sources are available, null is returned.
string SourceID
ID of data source.
Task< INode > GetNodeAsync(IThingReference NodeRef)
Gets the node, given a reference to it.
Task< bool > CanViewAsync(RequestOrigin Caller)
If the data source is visible to the caller.
DateTime LastChanged
When the source was last updated.
Service Module hosting the XMPP broker and its components.
Tokens available in request.
static readonly RequestOrigin Empty
Empty request origin.
string From
Address of caller.
static Task< NodeAdded > FromNode(INode Node, Language Language, RequestOrigin Caller, bool Sniffable)
Creates an event object from a node object.
static NodeRemoved FromNode(INode Node)
Creates an event object from a node object.
static Task< NodeUpdated > FromNode(INode Node, Language Language, RequestOrigin Caller)
Creates an event object from a node object.
Interface for observable classes implementing communication protocols.
Interface for client connections.
Guid Id
Identity of connection object.
string Type
Type of endpoint
Interface for XMPP S2S endpoints
Interface for datasources that are published through the concentrator interface.
Interface for nodes that are published through the concentrator interface.
Interface for thing references.
string Partition
Optional partition in which the Node ID is unique.
string SourceId
Optional ID of source containing node.