projects
/
jFCPlib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Inline interfaces used in ClientPut
[jFCPlib.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
fcp
/
quelaton
/
DefaultFcpClient.java
diff --git
a/src/main/java/net/pterodactylus/fcp/quelaton/DefaultFcpClient.java
b/src/main/java/net/pterodactylus/fcp/quelaton/DefaultFcpClient.java
index
8d2afc0
..
09b154b
100644
(file)
--- a/
src/main/java/net/pterodactylus/fcp/quelaton/DefaultFcpClient.java
+++ b/
src/main/java/net/pterodactylus/fcp/quelaton/DefaultFcpClient.java
@@
-33,11
+33,11
@@
public class DefaultFcpClient implements FcpClient {
private FcpConnection connect() throws IOException {
FcpConnection fcpConnection = this.fcpConnection.get();
private FcpConnection connect() throws IOException {
FcpConnection fcpConnection = this.fcpConnection.get();
- if (
fcpConnection != null
) {
+ if (
(fcpConnection != null) && !fcpConnection.isClosed()
) {
return fcpConnection;
}
fcpConnection = createConnection();
return fcpConnection;
}
fcpConnection = createConnection();
- this.fcpConnection.
compareAndSet(null,
fcpConnection);
+ this.fcpConnection.
set(
fcpConnection);
return fcpConnection;
}
return fcpConnection;
}
@@
-70,9
+70,24
@@
public class DefaultFcpClient implements FcpClient {
}
@Override
}
@Override
+ public ListPeerCommand listPeer() {
+ return new ListPeerCommandImpl(threadPool, this::connect);
+ }
+
+ @Override
public ListPeersCommand listPeers() {
return new ListPeersCommandImpl(threadPool, this::connect);
}
public ListPeersCommand listPeers() {
return new ListPeersCommandImpl(threadPool, this::connect);
}
+ @Override
+ public AddPeerCommand addPeer() {
+ return new AddPeerCommandImpl(threadPool, this::connect);
+ }
+
+ @Override
+ public ListPeerNotesCommand listPeerNotes() {
+ return new ListPeerNotesCommandImpl(threadPool, this::connect);
+ }
+
}
}