Interface HealthCheckResult

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean betterThan​(HealthCheckResult r)
      Indicates whether this health check result is considered better than the provided result.
      int compare​(HealthCheckResult r1, HealthCheckResult r2)
      Compares the provided health check results to determine their relative order in a sorted list.
      int compareTo​(HealthCheckResult r)
      Compares the provided health check result with this health check result to determine their relative order in a sorted list.
      boolean equals​(java.lang.Object o)
      Indicates whether the provided object may be considered equal to this health check result.
      java.util.List<java.lang.String> getMessages()
      Retrieves a list of messages providing additional information about the reason for the associated state and score.
      int getScore()
      Retrieves the numeric score for the associated server, which may be used to help differentiate the server from other servers with the same state.
      HealthCheckState getState()
      Retrieves the health check state for the associated server.
      long getTime()
      Retrieves the time that this health check result was created.
      int hashCode()
      Retrieves a hash code for this health check result.
      java.lang.String toString()
      Retrieves a string representation of this health check result.
      boolean worseThan​(HealthCheckResult r)
      Indicates whether this health check result is considered worse than the provided result.
      • Methods inherited from interface java.util.Comparator

        reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Method Detail

      • getState

        HealthCheckState getState()
        Retrieves the health check state for the associated server.
        Returns:
        The health check state for the associated server.
      • getScore

        int getScore()
        Retrieves the numeric score for the associated server, which may be used to help differentiate the server from other servers with the same state. The value returned will be an integer between 10 (the most healthy) and 1 (the least healthy) for a state of AVAILABLE or DEGRADED, or zero for a state of UNAVAILABLE.
        Returns:
        The numeric score for the associated server.
      • getMessages

        java.util.List<java.lang.String> getMessages()
        Retrieves a list of messages providing additional information about the reason for the associated state and score.
        Returns:
        A list of messages providing additional information about the reason for the associated state and score, or an empty list if no messages are available.
      • getTime

        long getTime()
        Retrieves the time that this health check result was created. The value returned will be an offset in milliseconds since 12:00 a.m. on January 1, 1970.
        Returns:
        The time that this health check result was created.
      • hashCode

        int hashCode()
        Retrieves a hash code for this health check result.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        A hash code for this health check result.
      • equals

        boolean equals​(java.lang.Object o)
        Indicates whether the provided object may be considered equal to this health check result.
        Specified by:
        equals in interface java.util.Comparator<HealthCheckResult>
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - The object for which to make the determination.
        Returns:
        true if the provided object may be considered equal to this health check result, or false if not.
      • compareTo

        int compareTo​(HealthCheckResult r)
        Compares the provided health check result with this health check result to determine their relative order in a sorted list. The ordering will be based primarily on the health check state, and the score will be used to differentiate between servers with the same state.
        Specified by:
        compareTo in interface java.lang.Comparable<HealthCheckResult>
        Parameters:
        r - The health check result to be compared with this health check result. It must not be null.
        Returns:
        A negative value if this health check result should be ordered before the provided result, a positive value if this health check result should be ordered after the provided result, or zero if they are logically equivalent.
      • compare

        int compare​(HealthCheckResult r1,
                    HealthCheckResult r2)
        Compares the provided health check results to determine their relative order in a sorted list. The ordering will be based primarily on the health check state, and the score will be used to differentiate between servers with the same state.
        Specified by:
        compare in interface java.util.Comparator<HealthCheckResult>
        Parameters:
        r1 - The first health check result to be compared. It must not be null.
        r2 - The second health check result to be compared. It must not be null.
        Returns:
        A negative value if the first health check result should be ordered before the second, a positive value if the first health check result should be ordered after the second, or zero if they are logically equivalent.
      • betterThan

        boolean betterThan​(HealthCheckResult r)
        Indicates whether this health check result is considered better than the provided result.
        Parameters:
        r - The result for which to make the determination. It must not be null.
        Returns:
        true if this health check result is considered better than the provided result, or false if this health check result is worse than or equivalent to the provided result.
      • worseThan

        boolean worseThan​(HealthCheckResult r)
        Indicates whether this health check result is considered worse than the provided result.
        Parameters:
        r - The result for which to make the determination. It must not be null.
        Returns:
        true if this health check result is considered worse than the provided result, or false if this health check result is better than or equivalent to the provided result.
      • toString

        java.lang.String toString()
        Retrieves a string representation of this health check result.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of this health check result.