From 9953bacf10a5dfc3422f035291547be7e7959cea Mon Sep 17 00:00:00 2001 From: Simon Schmitt <rimesime@mi.fu-berlin.de> Date: Fri, 12 Jun 2015 15:44:37 +0200 Subject: [PATCH] fixing some things --- Interface/AbstractWallet.java | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/Interface/AbstractWallet.java b/Interface/AbstractWallet.java index 1cc3a43..d4327bc 100644 --- a/Interface/AbstractWallet.java +++ b/Interface/AbstractWallet.java @@ -5,9 +5,11 @@ import java.io.Serializable; public abstract class AbstractWallet extends UntypedActor implements Serializable { - // Returns some neighbors that might be used as local - // and/or local neighborsUntypedActor + // Used to join the network (a pre known participant/Wallet must be known) public static class ActionJoin implements Serializable {} + + // Returns some neighbors that might be used as known + // and/or local neighbors public class ActionJoinAnswer implements Serializable { public final HashMap<String, ActorRef> someNeighbors = new HashMap<>(); } @@ -45,16 +47,21 @@ public abstract class AbstractWallet extends UntypedActor implements Serializabl } } - // Used to return a Wallet + // Used to return a Wallet reference (akka-style string which can + // be transformed to an ActorRef) public static class ActionSearchWalletReferenceAnswer implements Serializable { - final AbstractWallet w; - public ActionSearchWalletReferenceAnswer(AbstractWallet w) { - this.w = w; + final String address; + public ActionSearchWalletReferenceAnswer(String address) { + this.address = address; } } // Used to search a Wallet by name, i.e. the own wallet if we just - // joined the network + // joined the network; If a receiving participant holds the stored Wallet, + // he returns it, otherwise, he might use gossiping methods to go on + // with the search; + // Note: You should also forward the sender (the participant who actually + // searches for this Wallet, so that it can be returnd the direct way) public static class ActionSearchMyWallet implements Serializable { final String name; public ActionSearchMyWallet(String name) { @@ -62,6 +69,14 @@ public abstract class AbstractWallet extends UntypedActor implements Serializabl } } + // Used to return a searched Wallet + public static class ActionSearchMyWalletAnswer implements Serializable { + final AbstractWallet w; + public ActionSearchMyWalletAnswer(AbstractWallet w) { + this.w = w; + } + } + // Constructor public AbstractWallet(String name) { this.name = name; -- GitLab