3using System.Threading.Tasks;
21 private readonly Dictionary<Guid, string> jidByConnection =
new Dictionary<Guid, string>();
24 private readonly
INode[] nodes;
28 this.nodes =
new INode[]
35 string IDataSource.SourceID =>
SourceID;
40 public event EventHandlerAsync<SourceEvent> OnEvent;
72 foreach (
INode Node
in this.nodes)
78 return Task.FromResult<
INode>(Node);
85 return Task.FromResult<
INode>(
null);
95 lock (this.jidByConnection)
100 await this.OnEvent.Raise(
this,
Event);
110 lock (this.jidByConnection)
118 await this.OnEvent.Raise(
this,
Event);
128 lock (this.jidByConnection)
130 if (!this.jidByConnection.TryGetValue(e.
Connection.
Id, out OldId))
131 OldId =
string.Empty;
136 lock (this.jidByConnection)
141 await this.OnEvent.Raise(
this,
Event);
149 internal async Task ServerConnectionAdded(
object _, Networking.XMPP.Server.ServerConnectionEventArgs e)
156 internal async Task ServerConnectionRemoved(
object _, Networking.XMPP.Server.ServerConnectionEventArgs e)
163 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.
const string SourceID
Source ID for the connections data source.
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.
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.
bool HasPrivilege(string Privilege)
If the origin has a given privilege.
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.