X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Ffcp%2Fquelaton%2FModifyPeerCommandImpl.java;h=257bcfa0388f12ee25a489face17202f0baff450;hb=d0ef0149762409d60312db82e23d7845ac90fb2c;hp=687724548b23a0421ec28f31f95cead87e24c37e;hpb=8cfb423373226c1fa0b459230f79f25f7f5da9f3;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 6877245..257bcfa 100644 --- a/src/main/java/net/pterodactylus/fcp/quelaton/ModifyPeerCommandImpl.java +++ b/src/main/java/net/pterodactylus/fcp/quelaton/ModifyPeerCommandImpl.java @@ -29,6 +29,7 @@ public class ModifyPeerCommandImpl implements ModifyPeerCommand { private final AtomicReference allowLocalAddresses = new AtomicReference<>(); private final AtomicReference burstOnly = new AtomicReference<>(); private final AtomicReference listenOnly = new AtomicReference<>(); + private final AtomicReference ignoreSource = new AtomicReference<>(); public ModifyPeerCommandImpl(ExecutorService threadPool, ConnectionSupplier connectionSupplier) { this.threadPool = MoreExecutors.listeningDecorator(threadPool); @@ -84,6 +85,12 @@ public class ModifyPeerCommandImpl implements ModifyPeerCommand { } @Override + public ModifyPeerCommand ignoreSource() { + ignoreSource.set(true); + return this; + } + + @Override public Executable> byName(String name) { nodeIdentifier.set(name); return this::execute; @@ -111,6 +118,7 @@ public class ModifyPeerCommandImpl implements ModifyPeerCommand { Optional.ofNullable(allowLocalAddresses.get()).ifPresent(allowed -> modifyPeer.setAllowLocalAddresses(allowed)); Optional.ofNullable(burstOnly.get()).ifPresent(burstOnly -> modifyPeer.setBurstOnly(burstOnly)); Optional.ofNullable(listenOnly.get()).ifPresent(listenOnly -> modifyPeer.setListenOnly(listenOnly)); + Optional.ofNullable(ignoreSource.get()).ifPresent(ignoreSource -> modifyPeer.setIgnoreSource(ignoreSource)); try (ModifyPeerDialog modifyPeerDialog = new ModifyPeerDialog()) { return modifyPeerDialog.send(modifyPeer).get(); }