X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Ffcp%2FFcpConnection.java;h=0eda39ddf8b5d9396ef3289c8b7e23fead5f0dd0;hb=064ea7223eef47bdcef90d2c63f91620171fc955;hp=858b783b305517c9526eec51b943987ea6e75b0f;hpb=b171126719c983b590c51f22eb60a3e0afdf1fb9;p=jFCPlib.git diff --git a/src/main/java/net/pterodactylus/fcp/FcpConnection.java b/src/main/java/net/pterodactylus/fcp/FcpConnection.java index 858b783..0eda39d 100644 --- a/src/main/java/net/pterodactylus/fcp/FcpConnection.java +++ b/src/main/java/net/pterodactylus/fcp/FcpConnection.java @@ -31,8 +31,6 @@ import java.util.HashMap; import java.util.Map; import java.util.logging.Logger; -import net.pterodactylus.util.logging.Logging; - /** * An FCP connection to a Freenet node. * @@ -41,7 +39,7 @@ import net.pterodactylus.util.logging.Logging; public class FcpConnection implements Closeable { /** Logger. */ - private static final Logger logger = Logging.getLogger(FcpConnection.class.getName()); + private static final Logger logger = Logger.getLogger(FcpConnection.class.getName()); /** The default port for FCP v2. */ public static final int DEFAULT_PORT = 9481; @@ -158,6 +156,10 @@ public class FcpConnection implements Closeable { fcpListenerManager.removeListener(fcpListener); } + public synchronized boolean isClosed() { + return connectionHandler != null; + } + // // ACTIONS // @@ -263,6 +265,8 @@ public class FcpConnection implements Closeable { fcpListenerManager.fireReceivedDataFound(new DataFound(fcpMessage)); } else if ("SubscribedUSKUpdate".equals(messageName)) { fcpListenerManager.fireReceivedSubscribedUSKUpdate(new SubscribedUSKUpdate(fcpMessage)); + } else if ("SubscribedUSK".equals(messageName)) { + fcpListenerManager.fireReceivedSubscribedUSK(new SubscribedUSK(fcpMessage)); } else if ("IdentifierCollision".equals(messageName)) { fcpListenerManager.fireReceivedIdentifierCollision(new IdentifierCollision(fcpMessage)); } else if ("AllData".equals(messageName)) { @@ -299,6 +303,8 @@ public class FcpConnection implements Closeable { } } else if ("PluginInfo".equals(messageName)) { fcpListenerManager.fireReceivedPluginInfo(new PluginInfo(fcpMessage)); + } else if ("PluginRemoved".equals(messageName)) { + fcpListenerManager.fireReceivedPluginRemoved(new PluginRemoved(fcpMessage)); } else if ("NodeData".equals(messageName)) { fcpListenerManager.fireReceivedNodeData(new NodeData(fcpMessage)); } else if ("TestDDAReply".equals(messageName)) {