46 |
|
_monitorName = monitorName; |
47 |
|
_lastAlertLevels = new int[numAttributes]; |
48 |
|
_lastThresholdLevels = new int[numAttributes]; |
49 |
+ |
_lastAlertTimeout = new long[numAttributes]; |
50 |
|
_times = new long[numAttributes][Alert.alertLevels.length]; |
51 |
|
// initialise the arrays to 0 |
52 |
|
for (int x = 0; x < _lastAlertLevels.length; x++) { |
53 |
|
_lastAlertLevels[x] = 0; |
54 |
|
_lastThresholdLevels[x] = 0; |
55 |
+ |
_lastAlertTimeout[x] = 0; |
56 |
|
for(int y = 0; y < Alert.alertLevels.length; y++) { |
57 |
|
_times[x][y] = 0; |
58 |
|
} |
208 |
|
} |
209 |
|
|
210 |
|
/** |
211 |
+ |
* Gets the timeout value of the last alert |
212 |
+ |
* sent |
213 |
+ |
* |
214 |
+ |
* @param attrubuteNum the attribute to get the last timeout for |
215 |
+ |
* @return the last timeout value |
216 |
+ |
*/ |
217 |
+ |
public long getLastAlertTimeout(int attributeNum) { |
218 |
+ |
return _lastAlertTimeout[attributeNum]; |
219 |
+ |
} |
220 |
+ |
|
221 |
+ |
/** |
222 |
+ |
* Sets the timeout value of the last alert |
223 |
+ |
* sent |
224 |
+ |
* |
225 |
+ |
* @param attrubuteNum the attribute to get the last timeout for |
226 |
+ |
* @param timeout the new value |
227 |
+ |
*/ |
228 |
+ |
public void setLastAlertTimeout(int attributeNum, long timeout) { |
229 |
+ |
_lastAlertTimeout[attributeNum] = timeout; |
230 |
+ |
} |
231 |
+ |
|
232 |
+ |
/** |
233 |
|
* Advances the alert level to the next one up. |
234 |
|
* |
235 |
|
* @param attributeNum the attribute to advance the alert for |
263 |
|
* after. |
264 |
|
*/ |
265 |
|
private int[] _lastThresholdLevels; |
266 |
+ |
|
267 |
+ |
/** |
268 |
+ |
* An array of last alert timeout levels for |
269 |
+ |
* each attribute this register is looking |
270 |
+ |
* after. |
271 |
+ |
*/ |
272 |
+ |
private long[] _lastAlertTimeout; |
273 |
|
|
274 |
|
/** |
275 |
|
* An array of arrays containing |