mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-31 19:40:38 +00:00
Implement jsonRpc command
Co-authored-by: technillogue <technillogue@gmail.com> Closes #668
This commit is contained in:
parent
6c00054407
commit
a8bbdb54d0
20 changed files with 863 additions and 31 deletions
30
src/main/java/org/asamk/signal/jsonrpc/JsonRpcSender.java
Normal file
30
src/main/java/org/asamk/signal/jsonrpc/JsonRpcSender.java
Normal file
|
@ -0,0 +1,30 @@
|
|||
package org.asamk.signal.jsonrpc;
|
||||
|
||||
import org.asamk.signal.JsonWriter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class JsonRpcSender {
|
||||
|
||||
private final JsonWriter jsonWriter;
|
||||
|
||||
public JsonRpcSender(final JsonWriter jsonWriter) {
|
||||
this.jsonWriter = jsonWriter;
|
||||
}
|
||||
|
||||
public void sendRequest(JsonRpcRequest request) {
|
||||
jsonWriter.write(request);
|
||||
}
|
||||
|
||||
public void sendBulkRequests(List<JsonRpcRequest> requests) {
|
||||
jsonWriter.write(requests);
|
||||
}
|
||||
|
||||
public void sendResponse(JsonRpcResponse response) {
|
||||
jsonWriter.write(response);
|
||||
}
|
||||
|
||||
public void sendBulkResponses(List<JsonRpcResponse> responses) {
|
||||
jsonWriter.write(responses);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue