|
YAACC - UPNP Client and Server
|
Something that can make a JSON-RPC call: the connection, or a fake in a test. More...


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. | |
Something that can make a JSON-RPC call: the connection, or a fake in a test.
| JSONObject de.yaacc.snapcast.control.SnapcastCaller.call | ( | String | method, |
| JSONObject | params ) throws SnapcastException |
Calls a method and waits for the answer.
| params | the parameters, or null for none |
result object of the answer | SnapcastException | when the server answers an error or the call fails |
Implemented in de.yaacc.snapcast.control.SnapcastRpc.
Referenced by de.yaacc.snapcast.control.SnapcastCaller.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).
| SnapcastException | when the call fails or the handler throws one |
| IllegalStateException | when 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().

