Mercurial > hg > Database > Alice
annotate src/main/java/alice/topology/HostMessage.java @ 557:1a860019b2fe dispose
add ip to HostMessage.class
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 20 Nov 2015 17:57:55 +0900 |
parents | 8968b24c1ce3 |
children | 0259a8aba18c |
rev | line source |
---|---|
345 | 1 package alice.topology; |
2 | |
3 import org.msgpack.annotation.Message; | |
4 | |
557
1a860019b2fe
add ip to HostMessage.class
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
476
diff
changeset
|
5 import java.net.InetAddress; |
1a860019b2fe
add ip to HostMessage.class
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
476
diff
changeset
|
6 import java.net.UnknownHostException; |
1a860019b2fe
add ip to HostMessage.class
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
476
diff
changeset
|
7 |
345 | 8 @Message |
9 public class HostMessage { | |
419 | 10 public String name; |
11 public int port; | |
557
1a860019b2fe
add ip to HostMessage.class
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
476
diff
changeset
|
12 public InetAddress ip; |
475 | 13 |
419 | 14 public String connectionName; |
475 | 15 public String absName; // this is absName which have these IP and port. |
16 | |
419 | 17 public String reverseName; |
428
93995b7a9a05
change HostMessage field from parentAbsName to remoteAbsName
sugi
parents:
424
diff
changeset
|
18 public String remoteAbsName; |
430 | 19 public String cookie; // MD5 |
345 | 20 |
476 | 21 public boolean alive; |
22 | |
419 | 23 public HostMessage() { } |
24 public HostMessage(String name, int port) { | |
25 this.name = name; | |
26 this.port = port; | |
27 } | |
28 | |
29 public HostMessage(String name, int port, String connectionName, String reverseName) { | |
30 this.name = name; | |
31 this.port = port; | |
32 this.connectionName = connectionName; | |
33 this.reverseName = reverseName; | |
557
1a860019b2fe
add ip to HostMessage.class
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
476
diff
changeset
|
34 try { |
1a860019b2fe
add ip to HostMessage.class
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
476
diff
changeset
|
35 this.ip = InetAddress.getByName(name); |
1a860019b2fe
add ip to HostMessage.class
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
476
diff
changeset
|
36 } catch (UnknownHostException e) { |
1a860019b2fe
add ip to HostMessage.class
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
476
diff
changeset
|
37 e.printStackTrace(); |
1a860019b2fe
add ip to HostMessage.class
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
476
diff
changeset
|
38 } |
419 | 39 } |
476 | 40 |
41 public boolean isAlive() { | |
42 return alive; | |
43 } | |
345 | 44 } |