X-Git-Url: https://git.pterodactylus.net/?p=WoTNS.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fwotns%2Ffreenet%2Fwot%2FWebOfTrustConnector.java;h=4274caf22cf4287898c3776c85d7a2e4260998b4;hp=8a16efc3d24822d1302773e2ada51d2579300d85;hb=9251a40d3196f48d8c72b604ee8944bf391d26b0;hpb=622c4a4d3ebed447d5708a41cf3e1e82e18fa29b diff --git a/src/main/java/net/pterodactylus/wotns/freenet/wot/WebOfTrustConnector.java b/src/main/java/net/pterodactylus/wotns/freenet/wot/WebOfTrustConnector.java index 8a16efc..4274caf 100644 --- a/src/main/java/net/pterodactylus/wotns/freenet/wot/WebOfTrustConnector.java +++ b/src/main/java/net/pterodactylus/wotns/freenet/wot/WebOfTrustConnector.java @@ -70,6 +70,10 @@ public class WebOfTrustConnector implements ConnectorListener { // ACTIONS // + /** + * Stops the web of trust connector and disconnects from the plugin + * connector. + */ public void stop() { pluginConnector.removeConnectorListener(WOT_PLUGIN_NAME, PLUGIN_CONNECTION_IDENTIFIER, this); } @@ -82,7 +86,6 @@ public class WebOfTrustConnector implements ConnectorListener { * if the own identities can not be loaded */ public Set loadAllOwnIdentities() throws WebOfTrustException { - @SuppressWarnings("hiding") Reply reply = performRequest(SimpleFieldSetConstructor.create().put("Message", "GetOwnIdentities").get()); SimpleFieldSet fields = reply.getFields(); int ownIdentityCounter = -1; @@ -110,10 +113,10 @@ public class WebOfTrustConnector implements ConnectorListener { * @param ownIdentity * The own identity * @return All trusted identities - * @throws PluginException + * @throws WebOfTrustException * if an error occured talking to the Web of Trust plugin */ - public Set loadTrustedIdentities(OwnIdentity ownIdentity) throws PluginException { + public Set loadTrustedIdentities(OwnIdentity ownIdentity) throws WebOfTrustException { return loadTrustedIdentities(ownIdentity, null); } @@ -126,11 +129,10 @@ public class WebOfTrustConnector implements ConnectorListener { * @param context * The context to filter, or {@code null} * @return All trusted identities - * @throws PluginException + * @throws WebOfTrustException * if an error occured talking to the Web of Trust plugin */ - public Set loadTrustedIdentities(OwnIdentity ownIdentity, String context) throws PluginException { - @SuppressWarnings("hiding") + public Set loadTrustedIdentities(OwnIdentity ownIdentity, String context) throws WebOfTrustException { Reply reply = performRequest(SimpleFieldSetConstructor.create().put("Message", "GetIdentitiesByScore").put("TreeOwner", ownIdentity.getId()).put("Selection", "+").put("Context", (context == null) ? "" : context).get()); SimpleFieldSet fields = reply.getFields(); Set identities = new HashSet(); @@ -191,7 +193,6 @@ public class WebOfTrustConnector implements ConnectorListener { * if an error occured talking to the Web of Trust plugin */ public String getProperty(Identity identity, String name) throws PluginException { - @SuppressWarnings("hiding") Reply reply = performRequest(SimpleFieldSetConstructor.create().put("Message", "GetProperty").put("Identity", identity.getId()).put("Property", name).get()); return reply.getFields().get("Property"); } @@ -405,7 +406,7 @@ public class WebOfTrustConnector implements ConnectorListener { * {@inheritDoc} */ @Override - public void receivedReply(@SuppressWarnings("hiding") PluginConnector pluginConnector, SimpleFieldSet fields, Bucket data) { + public void receivedReply(PluginConnector pluginConnector, SimpleFieldSet fields, Bucket data) { String messageName = fields.get("Message"); logger.log(Level.FINEST, "Received Reply from Plugin: " + messageName); synchronized (reply) {