com.bazaarvoice.ostrich.HealthCheckResults Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ostrich-core Show documentation
Show all versions of ostrich-core Show documentation
Core classes that form Ostrich
package com.bazaarvoice.ostrich;
/**
* A container for multiple {@link HealthCheckResult}s with convenience methods to check if there is a healthy
* result, and also return one. May be empty, in which case all methods will return empty {@link Iterable}s
* or {@code null}.
*/
public interface HealthCheckResults {
/**
* @return {@code true} if there is a healthy result, {@code false} otherwise.
*/
boolean hasHealthyResult();
/**
* @return All results in the aggregate, regardless of health.
*/
Iterable getAllResults();
/**
* Returns a healthy result if {@link #hasHealthyResult} is {@code true}. Returns {@code null} when
* {@code hasHealthyResult} is false. If there are multiple healthy results, there is no guarantee as to which gets
* returned.
* @return A result in the aggregate whose {@link HealthCheckResult#isHealthy} method returns {@code true}, or
* {@code null} if there are none.
*/
HealthCheckResult getHealthyResult();
/**
* @return Results in the aggregate whose {@link HealthCheckResult#isHealthy} method returns {@code false}.
*/
Iterable getUnhealthyResults();
}