Add JsonRpcMultiCommand

This commit is contained in:
AsamK 2021-11-10 19:21:51 +01:00
parent 64af4914ee
commit 9c67aabebb
8 changed files with 90 additions and 26 deletions

View file

@ -4,8 +4,8 @@ import com.fasterxml.jackson.core.type.TypeReference;
import net.sourceforge.argparse4j.inf.Namespace;
import org.asamk.signal.JsonWriter;
import org.asamk.signal.OutputType;
import org.asamk.signal.OutputWriter;
import org.asamk.signal.commands.exceptions.CommandException;
import org.asamk.signal.manager.Manager;
@ -19,10 +19,10 @@ public interface JsonRpcLocalCommand extends JsonRpcSingleCommand<Map<String, Ob
}
default void handleCommand(
Map<String, Object> request, Manager m, OutputWriter outputWriter
Map<String, Object> request, Manager m, JsonWriter jsonWriter
) throws CommandException {
Namespace commandNamespace = new JsonRpcNamespace(request == null ? Map.of() : request);
handleCommand(commandNamespace, m, outputWriter);
handleCommand(commandNamespace, m, jsonWriter);
}
default List<OutputType> getSupportedOutputTypes() {