Class StatusMessage

java.lang.Object
com.nt.udc.log.StatusMessage
All Implemented Interfaces:
Serializable

public class StatusMessage extends Object implements 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 Details

  • 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/good
      alarmText - 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

      public String getFormattedDateTime()
      The getFormattedDateTime() method converts long time stored in a StatusMessage object to a readable string.
    • setAppId

      public void setAppId(String Id)
    • getAppId

      public String getAppId()
    • setEntityId

      public void setEntityId(String Id)
    • getEntityId

      public String getEntityId()
    • setFunctDesc

      public void setFunctDesc(String fd)
    • getFunctDesc

      public String getFunctDesc()
    • setStatus

      public void setStatus(int stat)
    • getStatus

      public int getStatus()
    • getStatusAsString

      public String getStatusAsString()
    • getNotificationId

      public int getNotificationId()
    • setNotificationId

      public void setNotificationId(int n)
    • getText

      public String getText()
    • setText

      public void setText(String txt)
    • getAdditionalText

      public String getAdditionalText()
    • setAdditionalText

      public void setAdditionalText(String txt)
    • isRunning

      public boolean isRunning()
    • setRunning

      public void setRunning(boolean flag)
    • compareSeverityTo

      public int compareSeverityTo(StatusMessage sm)
      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

      public String toString()
      Overrides:
      toString in class Object