}
private ListenableFuture<Optional<Peer>> execute() {
- return threadPool.submit(this::executeSequence);
+ return threadPool.submit(this::executeDialog);
}
- private Optional<Peer> executeSequence() throws IOException, ExecutionException, InterruptedException {
+ private Optional<Peer> executeDialog() throws IOException, ExecutionException, InterruptedException {
AddPeer addPeer;
if (file.get() != null) {
addPeer = new AddPeer(new RandomIdentifierGenerator().generate(), file.get().getPath());
} else {
addPeer = new AddPeer(new RandomIdentifierGenerator().generate(), nodeRef.get());
}
- try (AddPeerSequence addPeerSequence = new AddPeerSequence()) {
- return addPeerSequence.send(addPeer).get();
+ try (AddPeerDialog addPeerDialog = new AddPeerDialog()) {
+ return addPeerDialog.send(addPeer).get();
}
}
- private class AddPeerSequence extends FcpDialog<Optional<Peer>> {
+ private class AddPeerDialog extends FcpDialog<Optional<Peer>> {
private final AtomicBoolean finished = new AtomicBoolean();
private final AtomicReference<Peer> peer = new AtomicReference<>();
- public AddPeerSequence() throws IOException {
+ public AddPeerDialog() throws IOException {
super(threadPool, connectionSupplier.get());
}
FcpConnection connection = new FcpConnection(hostname, port);
connection.connect();
ClientHello clientHello = new ClientHello(clientName.get(), "2.0");
- try (ClientHelloDialog nodeHelloSequence = new ClientHelloDialog(connection)) {
- if (nodeHelloSequence.send(clientHello).get()) {
+ try (ClientHelloDialog clientHelloDialog = new ClientHelloDialog(connection)) {
+ if (clientHelloDialog.send(clientHello).get()) {
return connection;
}
} catch (InterruptedException | ExecutionException e) {
import com.google.common.util.concurrent.MoreExecutors;
/**
- * An FCP reply sequence enables you to conveniently wait for a specific set of FCP replies.
+ * An FCP dialog enables you to conveniently wait for a specific set of FCP replies.
*
* @author <a href="bombe@freenetproject.org">David ‘Bombe’ Roden</a>
*/
@Override
public ListenableFuture<FcpKeyPair> execute() {
- return threadPool.submit(this::executeSequence);
+ return threadPool.submit(this::executeDialog);
}
- private FcpKeyPair executeSequence() throws InterruptedException, ExecutionException, IOException {
+ private FcpKeyPair executeDialog() throws InterruptedException, ExecutionException, IOException {
try (FcpKeyPairDialog fcpKeyPairDialog = new FcpKeyPairDialog()) {
return fcpKeyPairDialog.send(new GenerateSSK()).get();
}
@Override
public ListenableFuture<NodeData> execute() {
- return threadPool.submit(this::executeSequence);
+ return threadPool.submit(this::executeDialog);
}
- private NodeData executeSequence() throws InterruptedException, ExecutionException, IOException {
+ private NodeData executeDialog() throws InterruptedException, ExecutionException, IOException {
GetNode getNode = new GetNode(new RandomIdentifierGenerator().generate(), giveOpennetRef.get(),
includePrivate.get(), includeVolatile.get());
try (GetNodeDialog getNodeDialog = new GetNodeDialog()) {
}
private ListenableFuture<Optional<Peer>> execute() {
- return threadPool.submit(this::executeSequence);
+ return threadPool.submit(this::executeDialog);
}
- private Optional<Peer> executeSequence() throws IOException, ExecutionException, InterruptedException {
+ private Optional<Peer> executeDialog() throws IOException, ExecutionException, InterruptedException {
ListPeer listPeer = new ListPeer(new RandomIdentifierGenerator().generate(), nodeIdentifier.get());
- try (ListPeerSequence listPeerSequence = new ListPeerSequence()) {
- return Optional.ofNullable(listPeerSequence.send(listPeer).get());
+ try (ListPeerDialog listPeerDialog = new ListPeerDialog()) {
+ return Optional.ofNullable(listPeerDialog.send(listPeer).get());
}
}
- private class ListPeerSequence extends FcpDialog<Peer> {
+ private class ListPeerDialog extends FcpDialog<Peer> {
private final AtomicBoolean finished = new AtomicBoolean();
private final AtomicReference<Peer> peer = new AtomicReference<>();
- public ListPeerSequence() throws IOException {
+ public ListPeerDialog() throws IOException {
super(threadPool, connectionSupplier.get());
}
}
private ListenableFuture<Optional<PeerNote>> execute() {
- return threadPool.submit(this::executeSequence);
+ return threadPool.submit(this::executeDialog);
}
- private Optional<PeerNote> executeSequence() throws IOException, ExecutionException, InterruptedException {
+ private Optional<PeerNote> executeDialog() throws IOException, ExecutionException, InterruptedException {
ListPeerNotes listPeerNotes =
new ListPeerNotes(new RandomIdentifierGenerator().generate(), nodeIdentifier.get());
try (ListPeerNotesDialog listPeerNotesDialog = new ListPeerNotesDialog()) {
@Override
public ListenableFuture<Collection<Peer>> execute() {
- return threadPool.submit(this::executeSequence);
+ return threadPool.submit(this::executeDialog);
}
- private Collection<Peer> executeSequence() throws InterruptedException, ExecutionException, IOException {
+ private Collection<Peer> executeDialog() throws InterruptedException, ExecutionException, IOException {
String identifier = new RandomIdentifierGenerator().generate();
ListPeers listPeers = new ListPeers(identifier, includeMetadata.get(), includeVolatile.get());
try (ListPeersDialog listPeersDialog = new ListPeersDialog()) {
}
private ListenableFuture<Optional<Peer>> execute() {
- return threadPool.submit(this::executeSequence);
+ return threadPool.submit(this::executeDialog);
}
- private Optional<Peer> executeSequence() throws IOException, ExecutionException, InterruptedException {
+ private Optional<Peer> executeDialog() throws IOException, ExecutionException, InterruptedException {
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));