|
|
@@ -32,14 +32,16 @@ public class ServerNode implements Serializable {
|
|
|
|
|
|
private long lastKeepAlive;
|
|
|
|
|
|
- private String macId;
|
|
|
+ private long keepAliveTime;
|
|
|
|
|
|
- private long startTime;
|
|
|
- {
|
|
|
- macId= MacUtils.getMac(MacUtils.getInetAddress());
|
|
|
- startTime=System.currentTimeMillis();
|
|
|
- }
|
|
|
+ private final String macId= MacUtils.getMac(MacUtils.getInetAddress());
|
|
|
+
|
|
|
+ private final long startTime=System.currentTimeMillis();
|
|
|
|
|
|
+ public void setLastKeepAlive(long lastKeepAlive) {
|
|
|
+ this.lastKeepAlive = lastKeepAlive;
|
|
|
+ this.keepAliveTime=lastKeepAlive-startTime;
|
|
|
+ }
|
|
|
|
|
|
public boolean hasTag(String tag) {
|
|
|
return tags != null && tags.containsKey(tag);
|