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

The whole state of a server as Server.GetStatus (and Server.OnUpdate) report it: the server's own information, the groups with their clients, and the streams. More...

Collaboration diagram for de.yaacc.snapcast.control.SnapcastServerStatus:
Collaboration graph

Public Member Functions

 SnapcastServerStatus (SnapcastServerInfo info, List< SnapcastGroup > groups, List< SnapcastStream > streams)
 
SnapcastServerInfo getInfo ()
 
List< SnapcastGroup > getGroups ()
 
List< SnapcastStream > getStreams ()
 
SnapcastGroup findGroup (String groupId)
 
SnapcastGroup findGroupOfClient (String clientId)
 
SnapcastClient findClient (String clientId)
 
SnapcastStream findStream (String streamId)
 
SnapcastServerStatus withGroup (SnapcastGroup group)
 Replaces the group with the id of group, keeping its place; this status if there is no such group.
 
SnapcastServerStatus withStream (SnapcastStream stream)
 Replaces the stream with the id of stream, keeping its place; this status if there is no such stream.
 
boolean equals (Object other)
 
int hashCode ()
 
String toString ()
 Counts only: names, hosts and addresses of a server do not go to logs.
 

Static Public Member Functions

static SnapcastServerStatus parseResult (String text) throws SnapcastException
 Reads a status from text: the result of a Server.GetStatus answer or the params of a Server.OnUpdate notification, that is {"server": {...}}.
 
static SnapcastServerStatus fromResult (JSONObject result) throws SnapcastException
 

Detailed Description

The whole state of a server as Server.GetStatus (and Server.OnUpdate) report it: the server's own information, the groups with their clients, and the streams.

Immutable: a change makes a new status (withGroup, withStream). Parsing is tolerant (unknown fields ignored, defaults for missing optional ones) and bounded by SnapcastLimits.

Member Function Documentation

◆ findClient()

SnapcastClient de.yaacc.snapcast.control.SnapcastServerStatus.findClient ( String clientId)
Returns
the client with this id in any group, or null

Referenced by de.yaacc.snapcast.ui.SnapcastClientRemoval.decide(), and de.yaacc.snapcast.client.ServerSays.of().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findGroup()

SnapcastGroup de.yaacc.snapcast.control.SnapcastServerStatus.findGroup ( String groupId)
Returns
the group with this id, or null

Referenced by de.yaacc.snapcast.ui.SnapcastLinkChoices.of(), de.yaacc.snapcast.ui.SnapcastStreamChoices.of(), and de.yaacc.snapcast.feed.SnapcastStreams.useFor().

Here is the caller graph for this function:

◆ findGroupOfClient()

SnapcastGroup de.yaacc.snapcast.control.SnapcastServerStatus.findGroupOfClient ( String clientId)
Returns
the group that has this client as a member, or null

Referenced by de.yaacc.snapcast.control.SnapcastServerStatus.findClient(), and de.yaacc.snapcast.client.ServerSays.of().

Here is the caller graph for this function:

◆ findStream()

SnapcastStream de.yaacc.snapcast.control.SnapcastServerStatus.findStream ( String streamId)
Returns
the stream with this id, or null

Referenced by de.yaacc.snapcast.feed.SnapcastStreams.ensure(), de.yaacc.snapcast.feed.SnapcastStreams.shutdown(), and de.yaacc.snapcast.feed.SnapcastStreams.useFor().

Here is the caller graph for this function:

◆ fromResult()

static SnapcastServerStatus de.yaacc.snapcast.control.SnapcastServerStatus.fromResult ( JSONObject result) throws SnapcastException
static
Parameters
resultan object with a server object inside
Exceptions
SnapcastExceptionof kind MALFORMED when there is none

Referenced by de.yaacc.snapcast.control.SnapcastModelUpdater.apply(), and de.yaacc.snapcast.control.SnapcastServerStatus.parseResult().

Here is the caller graph for this function:

◆ parseResult()

static SnapcastServerStatus de.yaacc.snapcast.control.SnapcastServerStatus.parseResult ( String text) throws SnapcastException
static

Reads a status from text: the result of a Server.GetStatus answer or the params of a Server.OnUpdate notification, that is {"server": {...}}.

Exceptions
SnapcastExceptionof kind MALFORMED when the text is no such object
Here is the call graph for this function:

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