From: David ‘Bombe’ Roden Date: Thu, 11 Jun 2009 20:18:16 +0000 (+0200) Subject: Implement RemoveContext message. X-Git-Tag: v0.1.1~31 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=74fe9fe074dc290124ae270e0ab9be851c716436;p=jFCPlib.git Implement RemoveContext message. --- diff --git a/src/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java b/src/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java index e240d42..1896894 100644 --- a/src/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java +++ b/src/net/pterodactylus/fcp/plugin/WebOfTrustPlugin.java @@ -328,6 +328,25 @@ public class WebOfTrustPlugin { } } + /** + * Removes the given context from the given identity. + * + * @param ownIdentity + * The identity to remove the context from + * @param context + * The context to remove + * @throws IOException + * if an I/O error occurs + * @throws FcpException + * if an FCP error occurs + */ + public void removeContext(OwnIdentity ownIdentity, String context) throws IOException, FcpException { + Map replies = fcpClient.sendPluginMessage("plugins.WoT.WoT", createParameters("Message", "RemoveContext", "Identity", ownIdentity.getIdentifier(), "Context", context)); + if (!replies.get("Message").equals("ContextRemoved")) { + throw new FcpException("WebOfTrust Plugin did not reply with “ContextRemoved” message!"); + } + } + // // PRIVATE METHODS //