Implement “ping” command.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 1 Nov 2010 20:47:11 +0000 (21:47 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 1 Nov 2010 20:47:11 +0000 (21:47 +0100)
src/main/java/net/pterodactylus/sone/freenet/wot/WebOfTrustConnector.java

index 4758d95..a8806c1 100644 (file)
@@ -215,6 +215,17 @@ public class WebOfTrustConnector implements ConnectorListener {
                performRequest(SimpleFieldSetConstructor.create().put("Message", "RemoveProperty").put("Identity", ownIdentity.getId()).put("Property", name).get(), "PropertyRemoved");
        }
 
+       /**
+        * Pings the Web of Trust plugin. If the plugin can not be reached, a
+        * {@link PluginException} is thrown.
+        *
+        * @throws PluginException
+        *             if the plugin is not loaded
+        */
+       public void ping() throws PluginException {
+               performRequest(SimpleFieldSetConstructor.create().put("Message", "Ping").get(), "Pong");
+       }
+
        //
        // PRIVATE ACTIONS
        //