projects
/
jFCPlib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rework connection sequence to return whether it was successful
[jFCPlib.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
fcp
/
quelaton
/
ListPeersCommandImpl.java
diff --git
a/src/main/java/net/pterodactylus/fcp/quelaton/ListPeersCommandImpl.java
b/src/main/java/net/pterodactylus/fcp/quelaton/ListPeersCommandImpl.java
index
5638b98
..
97f3842
100644
(file)
--- a/
src/main/java/net/pterodactylus/fcp/quelaton/ListPeersCommandImpl.java
+++ b/
src/main/java/net/pterodactylus/fcp/quelaton/ListPeersCommandImpl.java
@@
-23,6
+23,8
@@
public class ListPeersCommandImpl implements ListPeersCommand {
private final ListeningExecutorService threadPool;
private final ConnectionSupplier connectionSupplier;
private final ListeningExecutorService threadPool;
private final ConnectionSupplier connectionSupplier;
+ private final AtomicBoolean includeMetadata = new AtomicBoolean(false);
+ private final AtomicBoolean includeVolatile = new AtomicBoolean(false);
public ListPeersCommandImpl(ExecutorService threadPool, ConnectionSupplier connectionSupplier) {
this.threadPool = MoreExecutors.listeningDecorator(threadPool);
public ListPeersCommandImpl(ExecutorService threadPool, ConnectionSupplier connectionSupplier) {
this.threadPool = MoreExecutors.listeningDecorator(threadPool);
@@
-30,9
+32,21
@@
public class ListPeersCommandImpl implements ListPeersCommand {
}
@Override
}
@Override
+ public ListPeersCommand includeMetadata() {
+ includeMetadata.set(true);
+ return this;
+ }
+
+ @Override
+ public ListPeersCommand includeVolatile() {
+ includeVolatile.set(true);
+ return this;
+ }
+
+ @Override
public Future<Collection<Peer>> execute() {
String identifier = new RandomIdentifierGenerator().generate();
public Future<Collection<Peer>> execute() {
String identifier = new RandomIdentifierGenerator().generate();
- ListPeers listPeers = new ListPeers(identifier);
+ ListPeers listPeers = new ListPeers(identifier
, includeMetadata.get(), includeVolatile.get()
);
return threadPool.submit(() -> new ListPeersReplySequence().send(listPeers).get());
}
return threadPool.submit(() -> new ListPeersReplySequence().send(listPeers).get());
}