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

Something that can make a JSON-RPC call: the connection, or a fake in a test. More...

Inheritance diagram for de.yaacc.snapcast.control.SnapcastCaller:
Inheritance graph
Collaboration diagram for de.yaacc.snapcast.control.SnapcastCaller:
Collaboration graph

Classes

interface  ResultHandler
 Turns the result of an answer into the value of the call; see callOrdered. More...
 

Public Member Functions

JSONObject call (String method, JSONObject params) throws SnapcastException
 Calls a method and waits for the answer.
 
default< T > T callOrdered (String method, JSONObject params, ResultHandler< T > handler) throws SnapcastException
 Calls a method and runs handler with the result in the order of the lines of the connection: after every notification that arrived before the answer and before every one that arrived behind it.
 

Detailed Description

Something that can make a JSON-RPC call: the connection, or a fake in a test.

Member Function Documentation

◆ call()

JSONObject de.yaacc.snapcast.control.SnapcastCaller.call ( String method,
JSONObject params ) throws SnapcastException

Calls a method and waits for the answer.

Parameters
paramsthe parameters, or null for none
Returns
the result object of the answer
Exceptions
SnapcastExceptionwhen the server answers an error or the call fails

Implemented in de.yaacc.snapcast.control.SnapcastRpc.

Referenced by de.yaacc.snapcast.control.SnapcastCaller.callOrdered().

Here is the caller graph for this function:

◆ callOrdered()

default< T > T de.yaacc.snapcast.control.SnapcastCaller.callOrdered ( String method,
JSONObject params,
ResultHandler< T > handler ) throws SnapcastException

Calls a method and runs handler with the result in the order of the lines of the connection: after every notification that arrived before the answer and before every one that arrived behind it.

The handler runs on the thread that delivers the notifications, and the call returns its value. Use it for everything that changes the model (a status read, a change of our own), so that an answer can never overwrite a newer notification. The default runs the handler on the calling thread (a fake without notifications needs no more).

Exceptions
SnapcastExceptionwhen the call fails or the handler throws one
IllegalStateExceptionwhen called from inside a delivery of the listeners (the real connection only; a fake that runs the handler on the calling thread has no such limit)

Referenced by de.yaacc.snapcast.control.SnapcastOperations.addStream(), de.yaacc.snapcast.control.SnapcastOperations.deleteClient(), de.yaacc.snapcast.control.SnapcastOperations.getStatus(), de.yaacc.snapcast.control.SnapcastOperations.removeStream(), de.yaacc.snapcast.control.SnapcastOperations.setClientLatency(), de.yaacc.snapcast.control.SnapcastOperations.setClientName(), de.yaacc.snapcast.control.SnapcastOperations.setClientVolume(), de.yaacc.snapcast.control.SnapcastOperations.setGroupClients(), de.yaacc.snapcast.control.SnapcastOperations.setGroupMute(), de.yaacc.snapcast.control.SnapcastOperations.setGroupName(), and de.yaacc.snapcast.control.SnapcastOperations.setGroupStream().

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

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