4using System.Threading.Tasks;
18 private readonly List<ISniffer> sniffers =
new List<ISniffer>();
20 private bool hasSniffers =
false;
26 : base(
"Events", null)
51 #region ICommunicationLayer
67 if (!this.sniffers.Contains(Sniffer))
70 this.sniffers.Add(Sniffer);
71 this.sniffersStatic = this.sniffers.ToArray();
72 this.hasSniffers =
true;
96 if (!this.sniffers.Remove(Sniffer))
99 this.sniffersStatic = this.sniffers.ToArray();
100 this.hasSniffers = this.sniffers.Count > 0;
132 return (IEnumerator<ISniffer>)this.sniffersStatic.GetEnumerator();
139 IEnumerator IEnumerable.GetEnumerator()
143 return this.sniffersStatic.GetEnumerator();
153 if (this.hasSniffers)
155 foreach (
ISniffer Sniffer
in this.sniffersStatic)
168 if (this.hasSniffers)
170 foreach (
ISniffer Sniffer
in this.sniffersStatic)
183 public void ReceiveBinary(
bool ConstantBuffer,
byte[] Data,
int Offset,
int Count)
185 if (this.hasSniffers)
187 foreach (
ISniffer Sniffer
in this.sniffersStatic)
198 if (this.hasSniffers)
200 foreach (
ISniffer Sniffer
in this.sniffersStatic)
213 if (this.hasSniffers)
215 foreach (
ISniffer Sniffer
in this.sniffersStatic)
228 public void TransmitBinary(
bool ConstantBuffer,
byte[] Data,
int Offset,
int Count)
230 if (this.hasSniffers)
232 foreach (
ISniffer Sniffer
in this.sniffersStatic)
243 if (this.hasSniffers)
245 foreach (
ISniffer Sniffer
in this.sniffersStatic)
256 if (this.hasSniffers)
258 foreach (
ISniffer Sniffer
in this.sniffersStatic)
269 if (this.hasSniffers)
271 foreach (
ISniffer Sniffer
in this.sniffersStatic)
282 if (this.hasSniffers)
284 foreach (
ISniffer Sniffer
in this.sniffersStatic)
295 if (this.hasSniffers)
297 foreach (
ISniffer Sniffer
in this.sniffersStatic)
308 if (this.hasSniffers)
310 foreach (
ISniffer Sniffer
in this.sniffersStatic)
321 if (this.hasSniffers)
323 foreach (
ISniffer Sniffer
in this.sniffersStatic)
335 if (this.hasSniffers)
337 foreach (
ISniffer Sniffer
in this.sniffersStatic)
349 public void ReceiveBinary(DateTime Timestamp,
bool ConstantBuffer,
byte[] Data)
351 if (this.hasSniffers)
353 foreach (
ISniffer Sniffer
in this.sniffersStatic)
367 public void ReceiveBinary(DateTime Timestamp,
bool ConstantBuffer,
byte[] Data,
int Offset,
int Count)
369 if (this.hasSniffers)
371 foreach (
ISniffer Sniffer
in this.sniffersStatic)
372 Sniffer.
ReceiveBinary(Timestamp, ConstantBuffer, Data, Offset, Count);
383 if (this.hasSniffers)
385 foreach (
ISniffer Sniffer
in this.sniffersStatic)
399 if (this.hasSniffers)
401 foreach (
ISniffer Sniffer
in this.sniffersStatic)
415 public void TransmitBinary(DateTime Timestamp,
bool ConstantBuffer,
byte[] Data,
int Offset,
int Count)
417 if (this.hasSniffers)
419 foreach (
ISniffer Sniffer
in this.sniffersStatic)
420 Sniffer.
TransmitBinary(Timestamp, ConstantBuffer, Data, Offset, Count);
431 if (this.hasSniffers)
433 foreach (
ISniffer Sniffer
in this.sniffersStatic)
445 if (this.hasSniffers)
447 foreach (
ISniffer Sniffer
in this.sniffersStatic)
459 if (this.hasSniffers)
461 foreach (
ISniffer Sniffer
in this.sniffersStatic)
473 if (this.hasSniffers)
475 foreach (
ISniffer Sniffer
in this.sniffersStatic)
487 if (this.hasSniffers)
489 foreach (
ISniffer Sniffer
in this.sniffersStatic)
499 public void Exception(DateTime Timestamp,
string Exception)
501 if (this.hasSniffers)
503 foreach (
ISniffer Sniffer
in this.sniffersStatic)
513 public void Exception(DateTime Timestamp, Exception Exception)
515 if (this.hasSniffers)
517 foreach (
ISniffer Sniffer
in this.sniffersStatic)
Static class managing the application event log. Applications and services log events on this static ...
static IEventSink[] Sinks
Registered sinks.
static void Register(IEventSink EventSink)
Registers an event sink with the event log. Call Unregister(IEventSink) to unregister it,...
static bool Unregister(IEventSink EventSink)
Unregisters an event sink from the event log.
Defines the Reports data source. This data source contains a tree structure of reports published by d...
static async Task< bool > RegisterRootNode(ReportNode ReportRoot)
Registers a new report root node.
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 ...
Event sink that forwards logged events to a sniffer.
ISniffer Sniffer
Recipient sniffer.
Root node of Events report folder.
bool Remove(ISniffer Sniffer)
Removes a sniffer, if registered.
void Exception(DateTime Timestamp, Exception Exception)
Called to inform the viewer of an exception state.
void Error(DateTime Timestamp, string Error)
Called to inform the viewer of an error state.
void ReceiveBinary(DateTime Timestamp, int Count)
Called when binary data has been received.
void TransmitText(string Text)
Called when text has been transmitted.
void Information(DateTime Timestamp, string Comment)
Called to inform the viewer of something.
EventsRoot()
Root node of Events report folder.
void TransmitText(DateTime Timestamp, string Text)
Called when text has been transmitted.
void ReceiveText(DateTime Timestamp, string Text)
Called when text has been received.
void Warning(string Warning)
Called to inform the viewer of a warning state.
void TransmitBinary(DateTime Timestamp, bool ConstantBuffer, byte[] Data)
Called when binary data has been transmitted.
void ReceiveBinary(int Count)
Called when binary data has been received.
void TransmitBinary(DateTime Timestamp, bool ConstantBuffer, byte[] Data, int Offset, int Count)
Called when binary data has been transmitted.
void Add(ISniffer Sniffer)
Adds a sniffer to the node.
bool DecoupledEvents
If events raised from the communication layer are decoupled, i.e. executed in parallel with the sourc...
void Information(string Comment)
Called to inform the viewer of something.
void AddRange(IEnumerable< ISniffer > Sniffers)
Adds a range of sniffers to the node.
void ReceiveBinary(DateTime Timestamp, bool ConstantBuffer, byte[] Data)
Called when binary data has been received.
void ReceiveBinary(bool ConstantBuffer, byte[] Data, int Offset, int Count)
Called when binary data has been received.
void ReceiveBinary(bool ConstantBuffer, byte[] Data)
Called when binary data has been received.
void TransmitBinary(bool ConstantBuffer, byte[] Data, int Offset, int Count)
Called when binary data has been transmitted.
void TransmitBinary(int Count)
Called when binary data has been transmitted.
void ReceiveBinary(DateTime Timestamp, bool ConstantBuffer, byte[] Data, int Offset, int Count)
Called when binary data has been received.
void ReceiveText(string Text)
Called when text has been received.
void Warning(DateTime Timestamp, string Warning)
Called to inform the viewer of a warning state.
ISniffer[] Sniffers
Registered sniffers.
void Exception(Exception Exception)
Called to inform the viewer of an exception state.
IEnumerator< ISniffer > GetEnumerator()
Returns an enumerator that iterates through the collection.
void TransmitBinary(DateTime Timestamp, int Count)
Called when binary data has been transmitted.
static async Task RegisterReports()
Registers protocol reports.
void Error(string Error)
Called to inform the viewer of an error state.
override Task< string > GetTypeNameAsync(Language Language)
Gets the type name of the node.
void TransmitBinary(bool ConstantBuffer, byte[] Data)
Called when binary data has been transmitted.
bool HasSniffers
If there are sniffers registered on the object.
void Exception(string Exception)
Called to inform the viewer of an exception state.
void Exception(DateTime Timestamp, string Exception)
Called to inform the viewer of an exception state.
Abstract base class for server report folders, requiring admin privileges to be seen and executed.
Service Module hosting the XMPP broker and its components.
Interface for all event sinks.
Interface for observable classes implementing communication protocols.
Interface for sniffers. Sniffers can be added to ICommunicationLayer classes to eavesdrop on communic...
void TransmitText(string Text)
Called when text has been transmitted.
void ReceiveText(string Text)
Called when text has been received.
void Information(string Comment)
Called to inform the viewer of something.
void Error(string Error)
Called to inform the viewer of an error state.
void Exception(string Exception)
Called to inform the viewer of an exception state.
void ReceiveBinary(int Count)
Called when binary data has been received.
void TransmitBinary(int Count)
Called when binary data has been transmitted.
void Warning(string Warning)
Called to inform the viewer of a warning state.