Mercurial > hg > Database > Christie
comparison src/main/java/christie/topology/manager/CheckComingHost.java @ 41:cf5a75bc3e55
add
author | akahori |
---|---|
date | Tue, 31 Jul 2018 17:46:32 +0900 |
parents | |
children | 6664efac18ee |
comparison
equal
deleted
inserted
replaced
40:342931aea0b8 | 41:cf5a75bc3e55 |
---|---|
1 package christie.topology.manager; | |
2 | |
3 import christie.annotation.Peek; | |
4 import christie.annotation.Take; | |
5 import christie.codegear.CodeGear; | |
6 import christie.codegear.CodeGearManager; | |
7 import christie.topology.HostMessage; | |
8 | |
9 import java.util.HashMap; | |
10 | |
11 public class CheckComingHost extends CodeGear { | |
12 | |
13 @Take | |
14 HostMessage hostMessage; | |
15 | |
16 @Peek | |
17 HashMap<String, String> absCookieTable; | |
18 | |
19 public CheckComingHost(){ | |
20 } | |
21 | |
22 @Override | |
23 public void run(CodeGearManager cgm) { | |
24 | |
25 boolean match = false; | |
26 // check cookie | |
27 if (hostMessage.cookie != null) { | |
28 if (absCookieTable.containsKey(hostMessage.cookie)){ | |
29 match = true; | |
30 hostMessage.absName = absCookieTable.get(hostMessage.cookie); | |
31 System.out.println("match"); | |
32 } | |
33 } | |
34 | |
35 if (match){ | |
36 // coming host has ever joined this App | |
37 getLocalDGM().put("reconnectHost", hostMessage); | |
38 | |
39 // TODO: これから実装する | |
40 //new SearchHostName(); | |
41 } else { | |
42 getLocalDGM().put("orderHash", "order"); | |
43 getLocalDGM().put("newHost", hostMessage); | |
44 } | |
45 | |
46 cgm.setup(new CheckComingHost()); | |
47 } | |
48 | |
49 | |
50 | |
51 | |
52 } |