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/monitors/UserCount__Monitor.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/client/monitors/UserCount__Monitor.java (file contents):
Revision 1.1 by tdb, Fri Mar 23 01:17:09 2001 UTC vs.
Revision 1.2 by tdb, Fri Mar 23 02:32:49 2001 UTC

# Line 23 | Line 23 | public class UserCount__Monitor extends MonitorSkeleto
23       */
24      public final String REVISION = "$Revision$";
25      
26 +    /**
27 +     * A description of this monitor
28 +     */
29      public final String DESC = "Monitors number of logged on users.";
30      
31   //---STATIC METHODS---
# Line 30 | Line 33 | public class UserCount__Monitor extends MonitorSkeleto
33   //---CONSTRUCTORS---
34  
35   //---PUBLIC METHODS---
36 <
36 >    
37 >    /**
38 >     * Analyse a packet of data, and generate an alert if
39 >     * necessary.
40 >     *
41 >     * @param packet the XMLPacket to analyse
42 >     */
43      public void analysePacket(XMLPacket packet) {
44          // what host are we looking at
45          String source = packet.getParam("packet.attributes.machine_name");
# Line 76 | Line 85 | public class UserCount__Monitor extends MonitorSkeleto
85      }
86  
87   //---PRIVATE METHODS---
88 <
88 >    
89 >    /**
90 >     * Checks a piece of current data, and returns the
91 >     * threshold it breaches, if any.
92 >     *
93 >     * @param attributeString a String representing the current data value
94 >     * @param reg the Register for the host
95 >     * @return the threshold level breached, if any
96 >     */
97      private int checkAttributeThreshold(String attributeString, Register reg) {
98          for(int thresholdLevel = Alert.thresholdLevels.length - 1; thresholdLevel >= 0; thresholdLevel--) {
99              if (reg.getThreshold(thresholdLevel) != -1.0) {
# Line 95 | Line 112 | public class UserCount__Monitor extends MonitorSkeleto
112      }
113  
114   //---ACCESSOR/MUTATOR METHODS---
115 <
115 >    
116 >    /**
117 >     * Returns a reference to a specific Queue for this
118 >     * monitor. This Queue returns only the data packets
119 >     * (based on type) that we want too look at.
120 >     *
121 >     * @return a reference to a Queue
122 >     */
123      protected Queue getQueue() {
124          return MonitorManager.getInstance().getDataQueue();
125      }
# Line 112 | Line 136 | public class UserCount__Monitor extends MonitorSkeleto
136       * be changed to null for utility classes.
137       */
138      private String _name = "UserCount";
139 <
139 >    
140 >    /**
141 >     * A HashMap of Registers (or groups of Registers), one
142 >     * for each host we're monitoring.
143 >     */
144      private HashMap _hosts = new HashMap();
145  
146   //---STATIC ATTRIBUTES---

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines