63 |
|
// Use XMLPacketMaker to make an XMLPacket object. |
64 |
|
XMLPacketMaker xmlPacketMaker = new XMLPacketMaker(xml); |
65 |
|
XMLPacket packet = xmlPacketMaker.createXMLPacket(); |
66 |
< |
String hostName = packet.getParam("packet.attributes.machine_name"); |
67 |
< |
if(!hostList.containsKey(hostName)) { |
66 |
> |
String packetType = packet.getParam("packet.attributes.type"); |
67 |
> |
|
68 |
> |
if (packetType.equals("heartbeat") || packetType.equals("data")) { |
69 |
> |
String hostName = packet.getParam("packet.attributes.machine_name"); |
70 |
> |
if(!hostList.containsKey(hostName)) { |
71 |
|
|
72 |
< |
HostDisplayPanel host = new HostDisplayPanel(hostName); |
73 |
< |
_tabbedPane.addTab(hostName, _serverIcon, host, "Monitor " + hostName); |
74 |
< |
hostList.put(hostName, host); |
75 |
< |
Conient.addMessage("New Host added: " + hostName); |
76 |
< |
} |
77 |
< |
if (!((HostDisplayPanel) hostList.get(hostName)).updateHost(packet)) { |
78 |
< |
//throw new Exception(hostName + " sent an invalid data packet stopping data update!"); |
79 |
< |
Conient.addMessage("WARNING{data panel}: " + hostName + " sent an invalid data packet"); |
72 |
> |
HostDisplayPanel host = new HostDisplayPanel(hostName); |
73 |
> |
_tabbedPane.addTab(hostName, _serverIcon, host, "Monitor " + hostName); |
74 |
> |
hostList.put(hostName, host); |
75 |
> |
Conient.addMessage("New Host added: " + hostName); |
76 |
> |
} |
77 |
> |
if (!((HostDisplayPanel) hostList.get(hostName)).updateHost(packet)) { |
78 |
> |
//throw new Exception(hostName + " sent an invalid data packet stopping data update!"); |
79 |
> |
Conient.addMessage("WARNING{data panel}: " + hostName + " sent an invalid data or heartbeat packet"); |
80 |
> |
} |
81 |
> |
} else { |
82 |
> |
Conient.addMessage("WARNING{data panel}: and unknown packet type was received - " + packetType); |
83 |
|
} |
84 |
|
} |
85 |
|
} |