345
|
1 package alice.topology.node;
|
|
2
|
|
3 import alice.codesegment.CodeSegment;
|
|
4 import alice.datasegment.CommandType;
|
|
5 import alice.datasegment.DataSegment;
|
|
6 import alice.datasegment.Receiver;
|
|
7 import org.msgpack.type.Value;
|
|
8
|
|
9 public class IncomingReverseKey extends CodeSegment {
|
|
10
|
|
11 public Receiver reverseKey = ids.create(CommandType.TAKE);
|
|
12 public Receiver reverseCount = ids.create(CommandType.PEEK);
|
|
13
|
|
14 @Override
|
|
15 public void run() {
|
|
16 String reverseKey = ((Value)this.reverseKey.getVal()).asRawValue().getString();
|
|
17 String from = this.reverseKey.from;
|
|
18 DataSegment.getAccept(from).reverseKey = reverseKey;
|
|
19
|
|
20 int reverseCount = this.reverseCount.asInteger();
|
|
21 reverseCount++;
|
|
22 ods.update("local", "reverseCount", reverseCount);
|
|
23
|
|
24
|
|
25 IncomingReverseKey cs = new IncomingReverseKey();
|
|
26 cs.reverseKey.setKey("local", "reverseKey");
|
|
27 cs.reverseCount.setKey("local", "reverseCount");
|
|
28 }
|
|
29
|
|
30 }
|