private synchronized void addFreetalkContext(WoTIdentity oid) throws Exception { SimpleFieldSet params = new SimpleFieldSet(true); params.putOverwrite("Message", "AddContext"); params.putOverwrite("Identity", oid.getID()); params.putOverwrite("Context", Freetalk.WOT_CONTEXT); sendFCPMessageBlocking(params, null, "ContextAdded"); }
public void solveIntroductionPuzzle(WoTOwnIdentity ownIdentity, String puzzleID, String solution) throws Exception { SimpleFieldSet params = new SimpleFieldSet(true); params.putOverwrite("Message", "SolveIntroductionPuzzle"); params.putOverwrite("Identity", ownIdentity.getID()); params.putOverwrite("Puzzle", puzzleID); params.putOverwrite("Solution", solution); sendFCPMessageBlocking(params, null, "PuzzleSolved"); }
/** * Not synchronized, the involved identities might be deleted during the query or some other WoT * client might modify the trust value during the query - which is not really a problem, you * should not be modifying trust values of your own identity with multiple clients simultaneously. */ public void setTrust(OwnIdentity truster, Identity trustee, byte trust, String comment) throws Exception { WoTOwnIdentity wotTruster = (WoTOwnIdentity) truster; WoTIdentity wotTrustee = (WoTIdentity) trustee; SimpleFieldSet request = new SimpleFieldSet(true); request.putOverwrite("Message", "SetTrust"); request.putOverwrite("Truster", wotTruster.getID()); request.putOverwrite("Trustee", wotTrustee.getID()); request.putOverwrite("Value", Integer.toString(trust)); request.putOverwrite("Comment", comment); sendFCPMessageBlocking(request, null, "TrustSet"); mWoTCache.putTrust(wotTruster, wotTrustee, trust); }