ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/client/Register.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/client/Register.java (file contents):
Revision 1.5 by ajm, Tue Mar 6 01:40:24 2001 UTC vs.
Revision 1.6 by ajm, Tue Mar 6 02:33:55 2001 UTC

# Line 46 | Line 46 | public class Register {
46          _monitorName = monitorName;
47          _lastAlertLevels = new int[numAttributes];
48          _lastThresholdLevels = new int[numAttributes];
49 +        _initialAlertTime = new long[numAttributes];
50          _lastAlertTimeout = new long[numAttributes];
51          _times = new long[numAttributes][Alert.alertLevels.length];
52          // initialise the arrays to 0
53          for (int x = 0; x < _lastAlertLevels.length; x++) {
54              _lastAlertLevels[x] = 0;
55 +            _initialAlertTime[x] = 0;
56              _lastThresholdLevels[x] = 0;
57              _lastAlertTimeout[x] = 0;
58              for(int y = 0; y < Alert.alertLevels.length; y++) {
# Line 107 | Line 109 | public class Register {
109       * Note that if this is setting to an OK
110       * level alert, it resets _maxLevelCount.
111       *
112 +     * This also sets the "initialAlertTime"
113 +     * if the next alert after OK is set.
114 +     * And resets it to 0 if it IS an OK.
115 +     *
116       * @param attributeNum the attribute to set
117       * @param level the new last alert level
118       */
# Line 114 | Line 120 | public class Register {
120          _lastAlertLevels[attributeNum] = level;
121          if (level == Alert.alertOK) {
122              _maxLevelCount = 0;
123 +            _initialAlertTime[attributeNum] = 0;
124          }
125 +        if (level == Alert.alertOK + 1) {
126 +            _initialAlertTime[attributeNum] = System.currentTimeMillis();
127 +        }
128      }
129      
130      /**
# Line 240 | Line 250 | public class Register {
250      }
251  
252      /**
253 +     * Returns the time that the first alert was sent
254 +     * for an attribute that has passed a threshold value
255 +     *
256 +     * @param attrubuteNum the attribute to get the first alert time for
257 +     */
258 +    public long getInitialAlertTime(int attributeNum) {
259 +        return _initialAlertTime[attributeNum];
260 +    }
261 +
262 +    /**
263       * Advances the alert level to the next one up.
264       *
265       * This keeps track of the number of the number
# Line 316 | Line 336 | public class Register {
336       * was last sent for each attribute.
337       */
338      private long[][] _times;
339 +    
340 +    /**
341 +     * Initial times that an alert was first
342 +     * raised.
343 +     */
344 +    private long[] _initialAlertTime;
345  
346      /**
347       * A reference to the configuration proxy in use

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines