On Wed, Aug 14, 2013 at 11:12 AM, Felix Meschberger <[email protected]> wrote:
> ...I suggest the Result constructor to take the result status and reason.
> Both will become final fields of the result....

This makes sense for an HC that produces a single result, which is
valid in *some* cases.

Almost all the HealthChecks that I have implemented under
contrib/extensions/healthcheck/healthchecks make good use of more
detailed results, which pretty much look like a log where the most
critical message sets the overall result level.

We've discussed it with Carsten offline in the meantime and the best
seems to be to allow both the single result and log-based use cases,
as follows:

Result is immutable.

Result has two constructors, one that takes a Status and a message
String and one that takes a ResultLog, and sets the Result status to
ResultLog.getStatus().

The ResultLog is a list of messages, each with a Status and a message
String. It's getStatus() method returns the highest Status that was
added to it.

I think this gives enough flexibility while not forcing either the
single-result or log-based model.

-Bertrand

Reply via email to