X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffreenet%2Fwot%2FOwnIdentity.java;h=371622939ce4dee62f7e8466d48cac073d4038dd;hb=8df45b32ccb53609dd90a5580e06a6f8e43a86a0;hp=cfcab65d7dc9079411582ed7322541b9586cff25;hpb=da6c0a57ac23f13e25a2347237ef3d9ac52ac332;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/freenet/wot/OwnIdentity.java b/src/main/java/net/pterodactylus/sone/freenet/wot/OwnIdentity.java index cfcab65..3716229 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/wot/OwnIdentity.java +++ b/src/main/java/net/pterodactylus/sone/freenet/wot/OwnIdentity.java @@ -65,11 +65,12 @@ public class OwnIdentity extends Identity { * * @param context * The context to add + * @throws PluginException + * if an error occured communicating with the Web of Trust + * plugin */ - public void addContext(String context) { - if (contexts.add(context)) { - /* TODO - add. */ - } + public void addContext(String context) throws PluginException { + webOfTrustConnector.addContext(this, context); } /** @@ -77,11 +78,40 @@ public class OwnIdentity extends Identity { * * @param context * The context to remove + * @throws PluginException + * if an error occured communicating with the Web of Trust + * plugin */ - public void removeContext(String context) { - if (contexts.remove(context)) { - /* TODO - remove */ - } + public void removeContext(String context) throws PluginException { + webOfTrustConnector.removeContext(this, context); + } + + /** + * Sets the property with the given name to the given value. + * + * @param name + * The name of the property to set + * @param value + * The new value of the property + * @throws PluginException + * if an error occured communicating with the Web of Trust + * plugin + */ + public void setProperty(String name, String value) throws PluginException { + webOfTrustConnector.setProperty(this, name, value); + } + + /** + * Removes the property with the given name. + * + * @param name + * The name of the property to remove + * @throws PluginException + * if an error occured communicating with the Web of Trust + * plugin + */ + public void removeProperty(String name) throws PluginException { + webOfTrustConnector.removeProperty(this, name); } //