X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Ffcp%2Fquelaton%2FModifyPeerCommandImpl.java;h=46563f036f507fe7e313cf98f5aa46b1a1b4e765;hb=7df2cd203237b9daf9fa3503a691878ad04cf1af;hp=4b3057222b172335a206ec41e9dd0ba2b7257c88;hpb=58ab179fee620c71e60a8908e7e10793dc837648;p=jFCPlib.git diff --git a/src/main/java/net/pterodactylus/fcp/quelaton/ModifyPeerCommandImpl.java b/src/main/java/net/pterodactylus/fcp/quelaton/ModifyPeerCommandImpl.java index 4b30572..46563f0 100644 --- a/src/main/java/net/pterodactylus/fcp/quelaton/ModifyPeerCommandImpl.java +++ b/src/main/java/net/pterodactylus/fcp/quelaton/ModifyPeerCommandImpl.java @@ -27,6 +27,7 @@ public class ModifyPeerCommandImpl implements ModifyPeerCommand { private final AtomicReference nodeIdentifier = new AtomicReference<>(); private final AtomicReference enabled = new AtomicReference<>(); private final AtomicReference allowLocalAddresses = new AtomicReference<>(); + private final AtomicReference burstOnly = new AtomicReference<>(); public ModifyPeerCommandImpl(ExecutorService threadPool, ConnectionSupplier connectionSupplier) { this.threadPool = MoreExecutors.listeningDecorator(threadPool); @@ -58,6 +59,12 @@ public class ModifyPeerCommandImpl implements ModifyPeerCommand { } @Override + public ModifyPeerCommand setBurstOnly() { + burstOnly.set(true); + return this; + } + + @Override public Executable> byName(String name) { nodeIdentifier.set(name); return this::execute; @@ -83,6 +90,7 @@ public class ModifyPeerCommandImpl implements ModifyPeerCommand { ModifyPeer modifyPeer = new ModifyPeer(new RandomIdentifierGenerator().generate(), nodeIdentifier.get()); Optional.ofNullable(enabled.get()).ifPresent(enabled -> modifyPeer.setEnabled(enabled)); Optional.ofNullable(allowLocalAddresses.get()).ifPresent(allowed -> modifyPeer.setAllowLocalAddresses(allowed)); + Optional.ofNullable(burstOnly.get()).ifPresent(burstOnly -> modifyPeer.setBurstOnly(burstOnly)); try (ModifyPeerDialog modifyPeerDialog = new ModifyPeerDialog()) { return modifyPeerDialog.send(modifyPeer).get(); }