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

What may be removed from a Snapcast server with Server.DeleteClient (task 12.8). More...

Collaboration diagram for de.yaacc.snapcast.ui.SnapcastClientRemoval:
Collaboration graph

Classes

class  Own
 The client of this phone's own session, if one runs.
 
interface  OwnSource
 Where the app says whether its own session runs and with which id. More...
 
enum  Verdict
 What the decision says. More...
 

Static Public Member Functions

static Own ownOf (boolean sessionActive, String clientId)
 The phone's own session as the app's runtime reports it.
 
static Verdict decide (SnapcastServerStatus fresh, String clientId, Own own)
 
static boolean offered (boolean connected, String clientId, Own own)
 Whether a row offers "Remove from server": an offline client that is not the phone's own.
 

Detailed Description

What may be removed from a Snapcast server with Server.DeleteClient (task 12.8).

Pure.

The server keeps an entry for every client it ever saw, also for one that is gone for good (a phone that was reinstalled, a client that reached the server under another address and so under another id), so such an offline entry stays in its group for ever. Removing it only forgets the entry; a client that is still around comes back by itself the next time it connects. The rules, in this order:

  • the id must be in the fresh status the caller read right before (Verdict#NOT_FOUND otherwise: it is gone already);
  • while a session of this phone's own client runs, or starts and its id is not known yet, the phone's own client is never removed, also not when it looks offline (Verdict#OWN_CLIENT, Verdict#OWN_CLIENT_UNKNOWN); the protection ends with the session. The own id is the one id the phone gives every server (task 12.11), known without a session, so an offline entry of this install is a ghost: it may be removed while no session runs (it returns by itself with the next session) and never while one does;
  • a client that the fresh status shows as connected is never removed (Verdict#CONNECTED). This is our rule: the notes of the server say that the call only forgets the configuration of a disconnected client, but a server that refused would only tell us after the fact, and an older one may not.

Ids are never part of a text; Own#toString and the verdicts carry none.

Member Function Documentation

◆ decide()

static Verdict de.yaacc.snapcast.ui.SnapcastClientRemoval.decide ( SnapcastServerStatus fresh,
String clientId,
Own own )
static
Parameters
freshthe status read from the server right before; null counts as "not found"
clientIdthe exact id from that status
ownthe phone's own session, from the app
Here is the call graph for this function:

◆ offered()

static boolean de.yaacc.snapcast.ui.SnapcastClientRemoval.offered ( boolean connected,
String clientId,
Own own )
static

Whether a row offers "Remove from server": an offline client that is not the phone's own.

The row is drawn from the model, which may be behind; the call decides again with a fresh status.

◆ ownOf()

static Own de.yaacc.snapcast.ui.SnapcastClientRemoval.ownOf ( boolean sessionActive,
String clientId )
static

The phone's own session as the app's runtime reports it.

Parameters
sessionActivea session runs or starts
clientIdthe id of its Hello, null while it is not known

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