From 9a8d386e3b73f5ed509e5db7b0c5811be78399d6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 1 Mar 2020 10:36:04 +0100 Subject: [PATCH] =?utf8?q?=E2=9C=A8=20Add=20method=20to=20send=20ModifyCon?= =?utf8?q?fig=20request?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../java/net/pterodactylus/fcp/highlevel/FcpClient.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java b/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java index 274852a..473fe98 100644 --- a/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java +++ b/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java @@ -59,6 +59,7 @@ import net.pterodactylus.fcp.GetNode; import net.pterodactylus.fcp.ListPeerNotes; import net.pterodactylus.fcp.ListPeers; import net.pterodactylus.fcp.ListPersistentRequests; +import net.pterodactylus.fcp.ModifyConfig; import net.pterodactylus.fcp.ModifyPeer; import net.pterodactylus.fcp.ModifyPeerNote; import net.pterodactylus.fcp.NodeData; @@ -1174,6 +1175,22 @@ public class FcpClient implements Closeable { return results; } + public void modifyConfig(Map options) throws IOException, FcpException { + new ExtendedFcpAdapter() { + @Override + public void run() throws IOException { + ModifyConfig modifyConfig = new ModifyConfig(); + options.forEach(modifyConfig::setOption); + sendMessage(modifyConfig); + } + + @Override + public void receivedConfigData(FcpConnection fcpConnection, ConfigData configData) { + complete(); + } + }.execute(); + } + // // PRIVATE METHODS // -- 2.7.4