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