Class HeartbeatInfo


  • public class HeartbeatInfo
    extends java.lang.Object
    HeartbeatInfo stores a single heartbeat key/value message, together with a timestamp
    • Constructor Summary

      Constructors 
      Constructor Description
      HeartbeatInfo​(java.lang.String message, java.util.Date date)
      Message constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Date getDate()  
      java.lang.String getMessage()  
      boolean isExpired​(java.util.Date purgeDate)
      Test if a message is older than a purgeDate
      void setDate​(java.util.Date date)
      Set message timestamp
      void setMessage​(java.lang.String message)
      Set message content
      javax.json.JsonObject toJsonObject()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HeartbeatInfo

        public HeartbeatInfo​(java.lang.String message,
                             java.util.Date date)
        Message constructor
        Parameters:
        message - string
        date - Date
    • Method Detail

      • getMessage

        public java.lang.String getMessage()
        Returns:
        message contents
      • getDate

        public java.util.Date getDate()
        Returns:
        message timestamp
      • setMessage

        public void setMessage​(java.lang.String message)
        Set message content
        Parameters:
        message - string to set
      • setDate

        public void setDate​(java.util.Date date)
        Set message timestamp
        Parameters:
        date - to set
      • isExpired

        public boolean isExpired​(java.util.Date purgeDate)
        Test if a message is older than a purgeDate
        Parameters:
        purgeDate - Date
        Returns:
        true if getDate() is before purgeDate
      • toJsonObject

        public javax.json.JsonObject toJsonObject()
        Returns:
        JSON object of the message