From 74fe9fe074dc290124ae270e0ab9be851c716436 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 11 Jun 2009 22:18:16 +0200 Subject: [PATCH] Implement RemoveContext message. --- .../pterodactylus/fcp/plugin/WebOfTrustPlugin.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 // -- 2.7.4