67 |
|
// find out which host this packet is actually for |
68 |
|
XMLPacketMaker xmlPacketMaker = new XMLPacketMaker(xml); |
69 |
|
XMLPacket packet = xmlPacketMaker.createXMLPacket(); |
70 |
– |
String host = packet.getParam("packet.attributes.machine_name"); |
70 |
|
|
71 |
< |
// look in the hostMap to see if anyone wants this data |
72 |
< |
if(_hostMap.containsKey(host)) { |
73 |
< |
LinkedList list = (LinkedList) _hostMap.get(host); |
74 |
< |
Iterator i = list.iterator(); |
75 |
< |
// push the data to the listening Handler's queue |
71 |
> |
String packetType = packet.getParam("packet.attributes.type"); |
72 |
> |
// check if we need to send it regardless |
73 |
> |
if(packetType.equals("data") || packetType.equals("heartbeat")) { |
74 |
> |
String host = packet.getParam("packet.attributes.machine_name"); |
75 |
> |
|
76 |
> |
// look in the hostMap to see if anyone wants this data |
77 |
> |
if(_hostMap.containsKey(host)) { |
78 |
> |
LinkedList list = (LinkedList) _hostMap.get(host); |
79 |
> |
Iterator i = list.iterator(); |
80 |
> |
// push the data to the listening Handler's queue |
81 |
> |
while(i.hasNext()) { |
82 |
> |
((Queue) i.next()).add(xml); |
83 |
> |
} |
84 |
> |
} |
85 |
> |
|
86 |
> |
// any handler in this list wants all packets, so send |
87 |
> |
// it on to them regardless |
88 |
> |
Iterator i = _allHostsList.iterator(); |
89 |
|
while(i.hasNext()) { |
90 |
|
((Queue) i.next()).add(xml); |
91 |
< |
} |
91 |
> |
} |
92 |
|
} |
93 |
< |
|
94 |
< |
// any handler in this list wants all packets, so send |
95 |
< |
// it on to them regardless |
96 |
< |
Iterator j = _allHostsList.iterator(); |
97 |
< |
while(j.hasNext()) { |
98 |
< |
((Queue) j.next()).add(xml); |
93 |
> |
else { |
94 |
> |
// send to all hosts because it's a special packet |
95 |
> |
Iterator i = _allHostsList.iterator(); |
96 |
> |
while(i.hasNext()) { |
97 |
> |
((Queue) i.next()).add(xml); |
98 |
> |
} |
99 |
|
} |
100 |
|
} |
101 |
|
} |