Class PollStatus

  • All Implemented Interfaces:
    java.io.Serializable

    @Embeddable
    public class PollStatus
    extends java.lang.Object
    implements java.io.Serializable
    Represents the status of a node, interface or services
    See Also:
    Serialized Form
    • Field Detail

      • PROPERTY_RESPONSE_TIME

        public static final java.lang.String PROPERTY_RESPONSE_TIME
        See Also:
        Constant Field Values
      • SERVICE_UNRESPONSIVE

        public static final int SERVICE_UNRESPONSIVE

        The constant that defines a service that is up but is most likely suffering due to excessive load or latency issues and because of that has not responded within the configured timeout period.

        See Also:
        Constant Field Values
      • SERVICE_UNAVAILABLE

        public static final int SERVICE_UNAVAILABLE

        The constant that defines a service that is not working normally and should be scheduled using the downtime models.

        See Also:
        Constant Field Values
      • SERVICE_AVAILABLE

        public static final int SERVICE_AVAILABLE

        The constant that defines a service as being in a normal state. If this is returned by the poll() method then the framework will re-schedule the service for its next poll using the standard uptime interval

        See Also:
        Constant Field Values
      • SERVICE_UNKNOWN

        public static final int SERVICE_UNKNOWN
        The constant the defines a status is unknown. Used mostly internally
        See Also:
        Constant Field Values
    • Method Detail

      • decode

        public static PollStatus decode​(java.lang.String statusName)

        decode

        Parameters:
        statusName - a String object.
        Returns:
        a PollStatus object.
      • decode

        public static PollStatus decode​(java.lang.String statusName,
                                        java.lang.String reason)

        decode

        Parameters:
        statusName - a String object.
        reason - a String object.
        Returns:
        a PollStatus object.
      • decode

        public static PollStatus decode​(java.lang.String statusName,
                                        java.lang.Double responseTime)

        decode

        Parameters:
        statusName - a String object.
        responseTime - a Double object.
        Returns:
        a PollStatus object.
      • decode

        public static PollStatus decode​(java.lang.String statusName,
                                        java.lang.String reason,
                                        java.lang.Double responseTime)

        decode

        Parameters:
        statusName - a String object.
        reason - a String object.
        responseTime - a Double object.
        Returns:
        a PollStatus object.
      • get

        public static PollStatus get​(int status,
                                     java.lang.String reason)

        get

        Parameters:
        status - a int.
        reason - a String object.
        Returns:
        a PollStatus object.
      • get

        public static PollStatus get​(int status,
                                     java.lang.Double responseTime)

        get

        Parameters:
        status - a int.
        responseTime - a Double object.
        Returns:
        a PollStatus object.
      • get

        public static PollStatus get​(int status,
                                     java.lang.String reason,
                                     java.lang.Double responseTime)

        get

        Parameters:
        status - a int.
        reason - a String object.
        responseTime - a Double object.
        Returns:
        a PollStatus object.
      • up

        public static PollStatus up​(java.lang.Double responseTime)

        up

        Parameters:
        responseTime - a Double object.
        Returns:
        a PollStatus object.
      • available

        public static PollStatus available​(java.lang.Double responseTime)

        available

        Parameters:
        responseTime - a Double object.
        Returns:
        a PollStatus object.
      • unknown

        public static PollStatus unknown()
        Deprecated.
        We should specify a reason on every PollStatus object.
        Returns:
        a PollStatus object.
      • unknown

        public static PollStatus unknown​(java.lang.String reason)

        unknown

        Parameters:
        reason - a String object.
        Returns:
        a PollStatus object.
      • unresponsive

        public static PollStatus unresponsive()
        Deprecated.
        We should specify a reason on every PollStatus object.
        Returns:
        a PollStatus object.
      • unresponsive

        public static PollStatus unresponsive​(java.lang.String reason)

        unresponsive

        Parameters:
        reason - a String object.
        Returns:
        a PollStatus object.
      • down

        public static PollStatus down()
        Deprecated.
        We should specify a reason on every PollStatus object.
        Returns:
        a PollStatus object.
      • unavailable

        public static PollStatus unavailable()
        Deprecated.
        We should specify a reason on every PollStatus object.
        Returns:
        a PollStatus object.
      • down

        public static PollStatus down​(java.lang.String reason)

        down

        Parameters:
        reason - a String object.
        Returns:
        a PollStatus object.
      • unavailable

        public static PollStatus unavailable​(java.lang.String reason)

        unavailable

        Parameters:
        reason - a String object.
        Returns:
        a PollStatus object.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()

        hashCode

        Overrides:
        hashCode in class java.lang.Object
        Returns:
        a int.
      • isUp

        public boolean isUp()

        isUp

        Returns:
        a boolean.
      • isAvailable

        public boolean isAvailable()

        isAvailable

        Returns:
        a boolean.
      • isUnresponsive

        public boolean isUnresponsive()

        isUnresponsive

        Returns:
        a boolean.
      • isUnavailable

        public boolean isUnavailable()

        isUnavailable

        Returns:
        a boolean.
      • isDown

        public boolean isDown()

        isDown

        Returns:
        a boolean.
      • isUnknown

        public boolean isUnknown()

        isUnknown

        Returns:
        a boolean.
      • toString

        public java.lang.String toString()

        toString

        Overrides:
        toString in class java.lang.Object
        Returns:
        a String object.
      • getTimestamp

        public java.util.Date getTimestamp()

        getTimestamp

        Returns:
        a Date object.
      • setTimestamp

        public void setTimestamp​(java.util.Date timestamp)

        setTimestamp

        Parameters:
        timestamp - a Date object.
      • getReason

        public java.lang.String getReason()

        getReason

        Returns:
        a String object.
      • setReason

        public void setReason​(java.lang.String reason)

        setReason

        Parameters:
        reason - a String object.
      • getResponseTime

        public java.lang.Double getResponseTime()

        getResponseTime

        Returns:
        a Double object.
      • setResponseTime

        public void setResponseTime​(java.lang.Double responseTime)

        setResponseTime

        Parameters:
        responseTime - a Double object.
      • getProperties

        public java.util.Map<java.lang.String,​java.lang.Number> getProperties()

        getProperties

        Returns:
        a Map object.
      • setProperties

        public void setProperties​(java.util.Map<java.lang.String,​java.lang.Number> p)

        setProperties

        Parameters:
        p - a Map object.
      • getProperty

        public java.lang.Number getProperty​(java.lang.String key)

        getProperty

        Parameters:
        key - a String object.
        Returns:
        a Number object.
      • setProperty

        public void setProperty​(java.lang.String key,
                                java.lang.Number value)

        setProperty

        Parameters:
        key - a String object.
        value - a Number object.
      • getStatusCode

        public int getStatusCode()

        getStatusCode

        Returns:
        a int.
      • getStatusName

        public java.lang.String getStatusName()

        getStatusName

        Returns:
        a String object.