YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.snapcast.discovery.SnapcastDiscoveryLog Class Reference

What the mDNS discovery saw since the scan started, kept for the report the user can read and copy (task 11.6): the callbacks of NsdManager (start, stop, found, lost, resolve) with the failure codes, and exact counters per browsed type. More...

Collaboration diagram for de.yaacc.snapcast.discovery.SnapcastDiscoveryLog:
Collaboration graph

Classes

class  Event
 One event.
 
enum  Kind
 What happened. More...
 
class  Snapshot
 A copy of the log at one moment; later events do not change it.
 
class  TypeStats
 The numbers of one browsed type.
 

Public Member Functions

 SnapcastDiscoveryLog (MonotonicClock clock)
 
synchronized void scanStarted ()
 A new scan starts: what the last one saw is forgotten.
 
synchronized int scanId ()
 The number of the scan that runs now; a callback records with the number it was started with.
 
synchronized void record (int forScan, Kind kind, String type, String name, int code, String detail)
 As record(Kind, String, String, int, String), for a callback of the scan with this number: when a newer scan has started meanwhile (the page was hidden and shown again), a late callback of the earlier one, such as the confirmation of its stop, is dropped and does not change the new scan's lines.
 
synchronized void record (Kind kind, String type, String name, int code, String detail)
 Records an event.
 
synchronized Snapshot snapshot ()
 

Static Public Attributes

static final int CAPACITY = 40
 The most events kept.
 

Detailed Description

What the mDNS discovery saw since the scan started, kept for the report the user can read and copy (task 11.6): the callbacks of NsdManager (start, stop, found, lost, resolve) with the failure codes, and exact counters per browsed type.

Bounded: the last {@value CAPACITY} events, the counters are numbers and exist for the browsed types only, so a network that announces a flood of services (or of types) grows nothing. Names and details come from the network and are cleaned and cut here. Never written to the app log (a name or an address of the local network is display text only). Thread safe.

Member Function Documentation

◆ record()

synchronized void de.yaacc.snapcast.discovery.SnapcastDiscoveryLog.record ( Kind kind,
String type,
String name,
int code,
String detail )

Records an event.

Parameters
typethe service type as the platform reported it
namethe service name, or empty
codethe failure code of NsdManager, 0 if the event has none
detailan address and port, or empty
Here is the call graph for this function:

The documentation for this class was generated from the following file: