- // ACTIONS
- //
-
- /**
- * Adds a context to the given own identity.
- *
- * @param ownIdentity
- * The own identity
- * @param context
- * The context to add
- */
- public void addContext(OwnIdentity ownIdentity, String context) {
- if (ownIdentity.hasContext(context)) {
- return;
- }
- try {
- webOfTrustConnector.addContext(ownIdentity, context);
- wotPluginConnected = true;
- ownIdentity.addContext(context);
- } catch (PluginException pe1) {
- logger.log(Level.WARNING, "Could not add context " + context + " to OwnIdentity " + ownIdentity + ".", pe1);
- wotPluginConnected = false;
- }
- }
-
- /**
- * Removes a context from the given own identity.
- *
- * @param ownIdentity
- * The own identity
- * @param context
- * The context to remove
- */
- public void removeContext(OwnIdentity ownIdentity, String context) {
- if (!ownIdentity.hasContext(context)) {
- return;
- }
- try {
- webOfTrustConnector.removeContext(ownIdentity, context);
- wotPluginConnected = true;
- ownIdentity.removeContext(context);
- } catch (PluginException pe1) {
- logger.log(Level.WARNING, "Could not remove context " + context + " from OwnIdentity " + ownIdentity + ".", pe1);
- wotPluginConnected = false;
- }
- }
-
- /**
- * Sets the property with the given name to the given value.
- *
- * @param ownIdentity
- * The own identity
- * @param name
- * The name of the property
- * @param value
- * The value of the property
- */
- public void setProperty(OwnIdentity ownIdentity, String name, String value) {
- try {
- webOfTrustConnector.setProperty(ownIdentity, name, value);
- wotPluginConnected = true;
- ownIdentity.setProperty(name, value);
- } catch (PluginException pe1) {
- logger.log(Level.WARNING, "Could not set property “" + name + "” to “" + value + "” for OwnIdentity: " + ownIdentity, pe1);
- wotPluginConnected = false;
- }
- }
-
- /**
- * Removes the property with the given name.
- *
- * @param ownIdentity
- * The own identity
- * @param name
- * The name of the property to remove
- */
- public void removeProperty(OwnIdentity ownIdentity, String name) {
- try {
- webOfTrustConnector.removeProperty(ownIdentity, name);
- wotPluginConnected = true;
- ownIdentity.removeProperty(name);
- } catch (PluginException pe1) {
- logger.log(Level.WARNING, "Could not remove property “" + name + "” from OwnIdentity: " + ownIdentity, pe1);
- wotPluginConnected = false;
- }
- }
-
- //