X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Ffcp%2Fquelaton%2FGetNodeCommandImpl.java;h=51ebd73615eb5a7bee15c1a32892c3805010c1a0;hb=33619cae4ed0a765a2f81f67e5923f4f427b177f;hp=7efffc0a3abeebd712d2cd961f00436ed24c1da4;hpb=e3f3a4323df8d53a0a59c2e4369abbcd8d60b940;p=jFCPlib.git diff --git a/src/main/java/net/pterodactylus/fcp/quelaton/GetNodeCommandImpl.java b/src/main/java/net/pterodactylus/fcp/quelaton/GetNodeCommandImpl.java index 7efffc0..51ebd73 100644 --- a/src/main/java/net/pterodactylus/fcp/quelaton/GetNodeCommandImpl.java +++ b/src/main/java/net/pterodactylus/fcp/quelaton/GetNodeCommandImpl.java @@ -2,6 +2,7 @@ package net.pterodactylus.fcp.quelaton; import java.io.IOException; import java.util.concurrent.ExecutorService; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; import net.pterodactylus.fcp.GetNode; @@ -20,6 +21,9 @@ public class GetNodeCommandImpl implements GetNodeCommand { private final ListeningExecutorService threadPool; private final ConnectionSupplier connectionSupplier; + private final AtomicBoolean giveOpennetRef = new AtomicBoolean(false); + private final AtomicBoolean includePrivate = new AtomicBoolean(false); + private final AtomicBoolean includeVolatile = new AtomicBoolean(false); public GetNodeCommandImpl(ExecutorService threadPool, ConnectionSupplier connectionSupplier) { this.threadPool = MoreExecutors.listeningDecorator(threadPool); @@ -27,8 +31,27 @@ public class GetNodeCommandImpl implements GetNodeCommand { } @Override + public GetNodeCommand opennetRef() { + giveOpennetRef.set(true); + return this; + } + + @Override + public GetNodeCommand includePrivate() { + includePrivate.set(true); + return this; + } + + @Override + public GetNodeCommand includeVolatile() { + includeVolatile.set(true); + return this; + } + + @Override public ListenableFuture execute() { - GetNode getNode = new GetNode(new RandomIdentifierGenerator().generate(), false, false, false); + GetNode getNode = new GetNode(new RandomIdentifierGenerator().generate(), giveOpennetRef.get(), + includePrivate.get(), includeVolatile.get()); return threadPool.submit(() -> new GetNodeReplySequence().send(getNode).get()); }