|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.iscream.cms.server.client.Register
The Register class holds theshold values, the last level of alert for each attribute for a monitor and the time of last alert sent for each alert level. This class is used by monitor classes so they can determine how often they should send alerts when breaching alert levels. It also stores (and keeps uptodate (via the configuration proxy) the threshold values for the monitor.
Field Summary | |
private String |
_attributeName
The attribute name, as obtained from the configuration. |
private ConfigurationProxy |
_cp
A reference to the configuration proxy in use |
private String |
_hostname
The host this register is for |
private long |
_initialAlertTime
Initial times that an alert was first raised. |
private int |
_lastAlertLevel
An array of last alert levels for each attribute this register is looking after. |
private long |
_lastAlertTimeout
An array of last alert timeout levels for each attribute this register is looking after. |
private int |
_lastThresholdLevel
An array of last threshold levels for each attribute this register is looking after. |
private int |
_maxLevelCount
The number of times the maximum level alert has occured IN A ROW, this is escalated by the escalate(int) method, and reset by the setLastAlertLevel(int, int) method |
private String |
_monitorName
The monitor this register is for |
private long[] |
_times
An array of arrays containing time an alert of each level was last sent for each attribute. |
static String |
REVISION
The current CVS revision of this class |
Constructor Summary | |
Register(String hostname,
String monitorName)
Construct a Register with the hostname and monitorName (for obtaining the threshold values). |
|
Register(String hostname,
String monitorName,
String attributeName)
Construct a Register with the hostname and monitorName (for obtaining the threshold values). |
Method Summary | |
void |
escalateAlert()
Advances the alert level to the next one up. |
long |
getAlertTimeout(int level)
Gets the alert timeout value for the given level of alert. |
long |
getInitialAlertTime()
Returns the time that the first alert was sent for an attribute that has passed a threshold value |
int |
getLastAlertLevel()
Gets the last alert level |
long |
getLastAlertTimeout()
Gets the timeout value of the last alert sent |
int |
getLastThresholdLevel()
Gets the last threshold level |
int |
getNextAlertLevel()
Either advances to the next alert level, or if the maximum alert level has been reached, simply returns that. |
double |
getThreshold(int level)
Gets the threshold value for the given level of alert. |
private String |
getThresholdConfig(int level,
String attributeName)
Obtains a threshold value from the configuration for a given level. |
long |
getTimeLastSent()
Gets the time an alert was sent at the given level. |
void |
setLastAlertLevel(int level)
Sets the last alert level Note that if this is setting to an OK level alert, it resets _maxLevelCount. |
void |
setLastAlertTimeout(long timeout)
Sets the timeout value of the last alert sent |
void |
setLastThresholdLevel(int level)
Sets the last threshold level |
void |
setTimeLastSent(long value)
Gets the time an alert was sent at the given level. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String REVISION
private String _hostname
private String _monitorName
private String _attributeName
private int _lastAlertLevel
private int _lastThresholdLevel
private long _lastAlertTimeout
private long[] _times
private long _initialAlertTime
private ConfigurationProxy _cp
private int _maxLevelCount
Constructor Detail |
public Register(String hostname, String monitorName)
hostname
- the hostname this register is formonitorName
- the monitor this register is forpublic Register(String hostname, String monitorName, String attributeName)
hostname
- the hostname this register is formonitorName
- the monitor this register is forattributeName
- the specific attribute this register is forMethod Detail |
private String getThresholdConfig(int level, String attributeName) throws PropertyNotFoundException
level
- the alert level to get the attribute forattributeName
- the attribute to get the threshold for
PropertyNotFoundException
public int getLastAlertLevel()
public void setLastThresholdLevel(int level)
level
- the new last threshold levelpublic int getLastThresholdLevel()
public void setLastAlertLevel(int level)
level
- the new last alert levelpublic long getTimeLastSent()
public void setTimeLastSent(long value)
value
- the new timepublic double getThreshold(int level)
level
- the alert levelpublic long getAlertTimeout(int level)
level
- the alert levelpublic int getNextAlertLevel()
public long getLastAlertTimeout()
public void setLastAlertTimeout(long timeout)
timeout
- the new valuepublic long getInitialAlertTime()
public void escalateAlert()
|
![]() |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |