Author: bdelacretaz
Date: Tue Sep 17 14:16:51 2013
New Revision: 1524059
URL: http://svn.apache.org/r1524059
Log:
clarify Result
Modified:
sling/site/trunk/content/documentation/bundles/sling-health-check-tool.mdtext
Modified:
sling/site/trunk/content/documentation/bundles/sling-health-check-tool.mdtext
URL:
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/sling-health-check-tool.mdtext?rev=1524059&r1=1524058&r2=1524059&view=diff
==============================================================================
---
sling/site/trunk/content/documentation/bundles/sling-health-check-tool.mdtext
(original)
+++
sling/site/trunk/content/documentation/bundles/sling-health-check-tool.mdtext
Tue Sep 17 14:16:51 2013
@@ -21,10 +21,27 @@ A `HealthCheck` is just an OSGi service
*/
public Result execute();
}
-
-The Result provides a _Status_ (OK, WARN, CRITICAL etc.) and a human-readable
log which provides additional info, including optional DEBUG messages
-that help troubleshooting. The Result log is not stricly tied to a logging
model, so `HealthCheck`s are free to invent their own types of logging messages
-if needed. See the `org.apache.sling.hc.api.Result` class and its tests for
more details.
+
+Where `Result` is a simple immutable class that provides a `Status` (OK, WARN,
CRITICAL etc.) and one or more log-like messages that
+can provide more info about what, if anything, went wrong.
+
+ public class Result implements Iterable <ResultLog.Entry> {
+
+ public boolean isOk() {
+ return getStatus().equals(Status.OK);
+ }
+
+ public Status getStatus() {
+ return resultLog.getAggregateStatus();
+ }
+
+ @Override
+ public Iterator<ResultLog.Entry> iterator() {
+ return resultLog.iterator();
+ }
+
+ ... details omitted
+ }
`HealthCheck` services can be selected for execution based on their `hc.tags`
multi-value service property.