32 |
|
//---PUBLIC METHODS--- |
33 |
|
|
34 |
|
public void analysePacket(XMLPacket packet) { |
35 |
< |
if (packet.getParam("packet.attributes.type").equals("data")) { |
36 |
< |
String source = packet.getParam("packet.attributes.machine_name"); |
37 |
< |
if (!_hosts.containsKey(source)) { |
38 |
< |
HashMap attributeRegisters = new HashMap(); |
39 |
< |
initAttributeRegsiters(source, attributeRegisters); |
40 |
< |
_hosts.put(source, attributeRegisters); |
41 |
< |
} |
35 |
> |
String source = packet.getParam("packet.attributes.machine_name"); |
36 |
> |
if (!_hosts.containsKey(source)) { |
37 |
> |
HashMap attributeRegisters = new HashMap(); |
38 |
> |
initAttributeRegsiters(source, attributeRegisters); |
39 |
> |
_hosts.put(source, attributeRegisters); |
40 |
> |
} |
41 |
|
|
42 |
< |
HashMap attributeRegisters = (HashMap) _hosts.get(source); |
43 |
< |
for(int attributeNum = 0; attributeNum < _attributes.length; attributeNum++) { |
44 |
< |
Register reg = (Register) attributeRegisters.get(_attributes[attributeNum]); |
45 |
< |
// find out the threshold level we're at |
46 |
< |
String attribute = _attributes[attributeNum]; |
47 |
< |
String attributeName = _attributeNames[attributeNum]; |
48 |
< |
String currentValue = packet.getParam(attribute); |
49 |
< |
int newThreshold = checkAttributeThreshold(currentValue, reg); |
50 |
< |
processAlert(newThreshold, attributeName, reg, source, currentValue); |
52 |
< |
} |
42 |
> |
HashMap attributeRegisters = (HashMap) _hosts.get(source); |
43 |
> |
for(int attributeNum = 0; attributeNum < _attributes.length; attributeNum++) { |
44 |
> |
Register reg = (Register) attributeRegisters.get(_attributes[attributeNum]); |
45 |
> |
// find out the threshold level we're at |
46 |
> |
String attribute = _attributes[attributeNum]; |
47 |
> |
String attributeName = _attributeNames[attributeNum]; |
48 |
> |
String currentValue = packet.getParam(attribute); |
49 |
> |
int newThreshold = checkAttributeThreshold(currentValue, reg); |
50 |
> |
processAlert(newThreshold, attributeName, reg, source, currentValue); |
51 |
|
} |
52 |
|
} |
53 |
|
|
101 |
|
} |
102 |
|
|
103 |
|
//---ACCESSOR/MUTATOR METHODS--- |
104 |
+ |
|
105 |
+ |
protected Queue getQueue() { |
106 |
+ |
return MonitorManager.getInstance().getDataQueue(); |
107 |
+ |
} |
108 |
|
|
109 |
|
//---ATTRIBUTES--- |
110 |
|
|