Rename all remaining occurences of “sequence” to “dialog”
[jFCPlib.git] / src / main / java / net / pterodactylus / fcp / quelaton / GenerateKeypairCommandImpl.java
index d5f30d6..69fcf63 100644 (file)
@@ -1,8 +1,8 @@
 package net.pterodactylus.fcp.quelaton;
 
 import java.io.IOException;
+import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Future;
 import java.util.concurrent.atomic.AtomicReference;
 
 import net.pterodactylus.fcp.FcpKeyPair;
@@ -30,14 +30,20 @@ class GenerateKeypairCommandImpl implements GenerateKeypairCommand {
 
        @Override
        public ListenableFuture<FcpKeyPair> execute() {
-               return threadPool.submit(() -> new FcpKeyPairReplySequence().send(new GenerateSSK()).get());
+               return threadPool.submit(this::executeDialog);
        }
 
-       private class FcpKeyPairReplySequence extends FcpReplySequence<FcpKeyPair> {
+       private FcpKeyPair executeDialog() throws InterruptedException, ExecutionException, IOException {
+               try (FcpKeyPairDialog fcpKeyPairDialog = new FcpKeyPairDialog()) {
+                       return fcpKeyPairDialog.send(new GenerateSSK()).get();
+               }
+       }
+
+       private class FcpKeyPairDialog extends FcpDialog<FcpKeyPair> {
 
                private AtomicReference<FcpKeyPair> keyPair = new AtomicReference<>();
 
-               public FcpKeyPairReplySequence() throws IOException {
+               public FcpKeyPairDialog() throws IOException {
                        super(GenerateKeypairCommandImpl.this.threadPool, GenerateKeypairCommandImpl.this.connectionSupplier.get());
                }