uk.org.iscream.cms.server.client.monitors
Class Swap__Monitor

java.lang.Object
  extended byjava.lang.Thread
      extended byuk.org.iscream.cms.server.client.MonitorSkeleton
          extended byuk.org.iscream.cms.server.client.monitors.Swap__Monitor
All Implemented Interfaces:
PluginMonitor, Runnable

public class Swap__Monitor
extends MonitorSkeleton

This Monitor watches the Swap for all machines

Version:
$Id: Swap__Monitor.java,v 1.13 2003/03/10 14:39:33 tdb Exp $
Author:
$Author: tdb $

Field Summary
private  ConfigurationProxy _cp
          A reference to the configuration proxy in use
private  HashMap _hosts
          A HashMap of Registers (or groups of Registers), one for each host we're monitoring.
private  String _name
          This is the friendly identifier of the component this class is running in.
 String DESC
          A description of this monitor
 String REVISION
          The current CVS revision of this class
 
Fields inherited from class uk.org.iscream.cms.server.client.MonitorSkeleton
_alerterQueue, _logger, _qID, _running
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Swap__Monitor()
           
 
Method Summary
 void analysePacket(XMLPacket packet)
          Analyse a packet of data, and generate an alert if necessary.
private  int checkAttributeThreshold(double value, Register reg, boolean negateCheck)
          Checks a piece of current data, and returns the threshold it breaches, if any.
 String getDescription()
          return the String representation of what the monitor does
protected  Queue getQueue()
          Returns a reference to a specific Queue for this monitor.
 String toString()
          Overrides the Object.toString() method to provide clean logging (every class should have this).
 
Methods inherited from class uk.org.iscream.cms.server.client.MonitorSkeleton
getQueueId, processAlert, run
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REVISION

public final String REVISION
The current CVS revision of this class

See Also:
Constant Field Values

DESC

public final String DESC
A description of this monitor

See Also:
Constant Field Values

_name

private String _name
This is the friendly identifier of the component this class is running in. eg, a Filter may be called "filter1", If this class does not have an owning component, a name from the configuration can be placed here. This name could also be changed to null for utility classes.


_cp

private ConfigurationProxy _cp
A reference to the configuration proxy in use


_hosts

private HashMap _hosts
A HashMap of Registers (or groups of Registers), one for each host we're monitoring.

Constructor Detail

Swap__Monitor

public Swap__Monitor()
Method Detail

analysePacket

public void analysePacket(XMLPacket packet)
Analyse a packet of data, and generate an alert if necessary.

Specified by:
analysePacket in class MonitorSkeleton
Parameters:
packet - the XMLPacket to analyse

toString

public String toString()
Overrides the Object.toString() method to provide clean logging (every class should have this). This uses the uk.org.iscream.cms.util.NameFormat class to format the toString()

Returns:
the name of this class and its CVS revision

getDescription

public String getDescription()
return the String representation of what the monitor does

Specified by:
getDescription in interface PluginMonitor
Specified by:
getDescription in class MonitorSkeleton
Returns:
the description

checkAttributeThreshold

private int checkAttributeThreshold(double value,
                                    Register reg,
                                    boolean negateCheck)
Checks a piece of current data, and returns the threshold it breaches, if any. The option to negate the check can be used in situations where being *below* the threshold is an 'alertable' situation. In this specific case, we'd do this with kb disk checks.

Parameters:
value - the current value
reg - the Register for the host
negateCheck - whether to negate the check
Returns:
the threshold level breached, if any

getQueue

protected Queue getQueue()
Returns a reference to a specific Queue for this monitor. This Queue returns only the data packets (based on type) that we want too look at.

Specified by:
getQueue in class MonitorSkeleton
Returns:
a reference to a Queue


Copyright © 2000-2003 i-scream. All Rights Reserved.