Package com.nt.udc.log
Class StatusMessage
java.lang.Object
com.nt.udc.log.StatusMessage
- All Implemented Interfaces:
Serializable
This class defines the structure of the status message object that is
used by the Log Server to communicate with the Log GUI.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final String
static final int
static final String
static final int
static final int
static final String
static final int
static final String
static final int
static final String
static final int
static final String
static final int
static final String
-
Constructor Summary
ConstructorsConstructorDescriptionStatusMessage
(long dateTime, String appid, String entityid, String functdesc, int stat, String txt) Constructor for the class.StatusMessage
(long dateTime, String snmpComponentName, String nodeId, String category, int severity, String alarmText, String addText) Message object used by the Logger class. -
Method Summary
Modifier and TypeMethodDescriptionint
Compares severity of this status message with that of the parameter status message.getAppId()
long
The getFormattedDateTime() method converts long time stored in a StatusMessage object to a readable string.int
int
getText()
boolean
void
setAdditionalText
(String txt) void
void
setDateTime
(long dateTime) void
setEntityId
(String Id) void
setFunctDesc
(String fd) void
setNotificationId
(int n) void
setRunning
(boolean flag) void
setStatus
(int stat) void
toString()
-
Field Details
-
GOOD
public static final int GOOD- See Also:
-
WARNING
public static final int WARNING- See Also:
-
MINOR
public static final int MINOR- See Also:
-
MAJOR
public static final int MAJOR- See Also:
-
ERROR
public static final int ERROR- See Also:
-
CRITICAL
public static final int CRITICAL- See Also:
-
HEARTBEAT
public static final int HEARTBEAT- See Also:
-
DEBUG
public static final int DEBUG- See Also:
-
GOOD_TEXT
- See Also:
-
WARNING_TEXT
- See Also:
-
MINOR_TEXT
- See Also:
-
MAJOR_TEXT
- See Also:
-
CRITICAL_TEXT
- See Also:
-
HEARTBEAT_TEXT
- See Also:
-
DEBUG_TEXT
- See Also:
-
-
Constructor Details
-
StatusMessage
public StatusMessage(long dateTime, String appid, String entityid, String functdesc, int stat, String txt) Constructor for the class. Message object used by the Logger class. Messages can be constructed with a status level.- Parameters:
dateTime
- When the StatusMessage as generated.appid
- String id for application associated with message.entityid
- Id of item with this status (ie. node id)functdesc
- Internal code used to clear bad statuses.stat
- Status level of message.txt
- Text of status message.
-
StatusMessage
public StatusMessage(long dateTime, String snmpComponentName, String nodeId, String category, int severity, String alarmText, String addText) Message object used by the Logger class. Messages are constructed with a status level.- Parameters:
dateTime
- When the StatusMessage as generated.snmpComponentName
- String id for application associated with message.nodeId
- Id of item with this status (ie. node id)category
- Category for this type of status condition.severity
- one of warning, minor, major, critical, or clear/goodalarmText
- Text describing the fault condition. This attribute should contain no variable content (i.e. time, address, nodeId) so that it can be used as an index key.addText
- Additional text describing the status condition. This field may contain detailed, variable information.
-
StatusMessage
public StatusMessage()
-
-
Method Details
-
setDateTime
public void setDateTime(long dateTime) -
getDateTime
public long getDateTime() -
getFormattedDateTime
The getFormattedDateTime() method converts long time stored in a StatusMessage object to a readable string. -
setAppId
-
getAppId
-
setEntityId
-
getEntityId
-
setFunctDesc
-
getFunctDesc
-
setStatus
public void setStatus(int stat) -
getStatus
public int getStatus() -
getStatusAsString
-
getNotificationId
public int getNotificationId() -
setNotificationId
public void setNotificationId(int n) -
getText
-
setText
-
getAdditionalText
-
setAdditionalText
-
isRunning
public boolean isRunning() -
setRunning
public void setRunning(boolean flag) -
compareSeverityTo
Compares severity of this status message with that of the parameter status message.- Parameters:
sm
- StatusMessage we are comparing this message to.- Returns:
- if "this" is less severe than "sm", return -1 if "this" is as severe as "sm", return 0 if "this" is more severe than "sm", return 1 Treat "GOOD" and "HEARTBEAT" as equal in severity.
-
toString
-