Class Status
java.lang.Object
io.vertx.ext.healthchecks.Status
Represents the outcome of a health check procedure. Each procedure produces a
Status indicating either OK
or KO. Optionally, it can also provide additional data.- Author:
- Clement Escoffier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetData()booleanisOk()booleanstatic StatusKO()Creates a status when something bad is detected.static StatusKO(JsonObject data) Creates a status when something bad is detected.static StatusOK()Creates a status when everything is fine.static StatusOK(JsonObject data) Creates a status when everything is fine and adds metadata.setData(JsonObject data) Sets the metadata.setKO()Sets the outcome of the status to KO.setOk(boolean ok) Sets whether or not the current status is positive (UP) or negative (DOWN).setOK()Sets the outcome of the status to OK.setProcedureInError(boolean procedureInError) Sets whether or not the procedure attached to this status has failed (timeout, error...).toJson()Builds the JSON representation of the currentStatusinstance.
-
Constructor Details
-
Method Details
-
OK
-
OK
Creates a status when everything is fine and adds metadata.- Returns:
- the created
Status
-
KO
-
KO
Creates a status when something bad is detected. Also add some metadata.- Returns:
- the created
Status
-
toJson
Builds the JSON representation of the currentStatusinstance.- Returns:
- the json object
-
isOk
public boolean isOk()- Returns:
- whether or not the current status is positive or negative.
-
setOk
Sets whether or not the current status is positive (UP) or negative (DOWN).- Parameters:
ok-truefor UP,falsefor DOWN- Returns:
- the current status
-
setKO
-
setOK
-
getData
- Returns:
- the additional metadata.
-
setData
Sets the metadata.- Parameters:
data- the data- Returns:
- the current status
-
isProcedureInError
public boolean isProcedureInError()- Returns:
- whether or not the status denotes a failure of a procedure.
-
setProcedureInError
Sets whether or not the procedure attached to this status has failed (timeout, error...).- Parameters:
procedureInError-trueif the procedure has not been completed correctly.- Returns:
- the current status
-