|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.org.iscream.cms.server.client.Alert
public class Alert
An object to hold the state of an Alert. When an alert is generated, it has lots of information about the cirscumstances and source of the alert. This object holds the information. It is created by Monitors (specifically in the fireAlert method of MonitorSkeleton). It then places the alert in the alert queue for Alerters to read and process.
Field Summary | |
---|---|
private int |
_alertLevel
The alert level of this Alert object |
private String |
_attributeName
The textual representation of the attribute that caused the alert. |
private long |
_initialAlertTime
The time in milliseconds that this alert first occured. |
private int |
_lastAlert
The last alert level for this attribute |
private String |
_name
This is the friendly identifier of the component this class is running in. |
private String |
_source
The source of the alert, eg hostname |
private int |
_thresholdLevel
The threshold level that was broken |
private String |
_thresholdValue
The threshold value that was broken |
private String |
_timeTillNextAlert
The time in seconds till the next alert for this attribute will occur. |
private String |
_value
The attribute value that caused the alert |
static int |
alertCAUTION
An internal representation of the CAUTION alert |
static int |
alertCRITICAL
An internal representation of the CRITICAL alert |
static int |
alertFINAL
An internal representation of the FINAL alert This must ALWAYS be the highest. |
static String[] |
alertLevels
The textual names of the alert levels. |
static int |
alertNOTICE
An internal representation of the NOTICE alert |
static int |
alertOK
An internal representation of the OK alert This must ALWAYS be 0. |
static int |
alertWARNING
An internal representation of the WARNING alert |
static String |
REVISION
The current CVS revision of this class |
static String[] |
thresholdLevels
The textual names of the threshold levels. |
static int |
thresholdLOWER
An internal representation of a LOWER threshold |
static int |
thresholdNORMAL
An internal representation of a NORMAL threshold |
static int |
thresholdUPPER
An internal representation of an UPPER threshold |
Constructor Summary | |
---|---|
Alert(int alertLevel,
int lastAlert,
int thresholdLevel,
String source,
String thresholdValue,
String value,
String attributeName,
String timeTillNextAlert,
long initialAlertTime)
Construct an Alert object with the appropriate data |
Method Summary | |
---|---|
String |
getAttributeName()
Returns the textual representation of the name of the attribute that caused the alert. |
long |
getInitialAlertTime()
Returns the time in milliseconds when the initial alert for this problem with the attribute occured. |
int |
getLastLevel()
Returns the previous alert level for the attribute |
int |
getLevel()
Returns the alert level of this Alert object |
String |
getSource()
Returns the source of the alert |
int |
getThreshold()
Returns the threshold level that was broken |
String |
getThresholdValue()
Returns the value of the threshold level this alert broke |
String |
getTimeTillNextAlert()
Returns the time in seconds till the next alert will be sent |
String |
getValue()
Returns the value that the alert level was caused by |
String |
printAll()
Prints a String representation of the Alert object. |
String |
toString()
Overrides the Object.toString()
method to provide clean logging (every class should have this). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
public static final int thresholdNORMAL
public static final int thresholdLOWER
public static final int thresholdUPPER
public static final String[] thresholdLevels
public static final int alertOK
public static final int alertNOTICE
public static final int alertWARNING
public static final int alertCAUTION
public static final int alertCRITICAL
public static final int alertFINAL
public static final String[] alertLevels
private String _name
private int _alertLevel
private int _lastAlert
private int _thresholdLevel
private String _source
private String _value
private String _thresholdValue
private String _attributeName
private String _timeTillNextAlert
private long _initialAlertTime
Constructor Detail |
---|
public Alert(int alertLevel, int lastAlert, int thresholdLevel, String source, String thresholdValue, String value, String attributeName, String timeTillNextAlert, long initialAlertTime)
alertLevel
- the alert level for this Alert objectlastAlert
- the last alert level before this onethresholdLevel
- the threshold level that was broken to raise the alertsource
- the source of the alert eg, hostnamethresholdValue
- the configured value of the treshold level that was brokenvalue
- the value of the attribute that raised the alertattributeName
- the textual representation of the attribute that has raised the alerttimeTillNextAlert
- the time until the next alert will be sent concerning this attribute (in seconds)initialAlertTime
- the time the problem with this attribute first occuredMethod Detail |
---|
public String printAll()
public String toString()
Object.toString()
method to provide clean logging (every class should have this).
This uses the uk.org.iscream.cms.util.FormatName class
to format the toString()
toString
in class Object
public int getLevel()
public int getLastLevel()
public int getThreshold()
public String getSource()
public String getValue()
public String getThresholdValue()
public String getAttributeName()
public String getTimeTillNextAlert()
public long getInitialAlertTime()
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |