Package io.vertx.ext.healthchecks
Class Status
- java.lang.Object
- 
- io.vertx.ext.healthchecks.Status
 
- 
 public class Status extends Object Represents the outcome of a health check procedure. Each procedure produces aStatusindicating either OK or KO. Optionally, it can also provide additional data.- Author:
- Clement Escoffier
 
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonObjectgetData()booleanisOk()booleanisProcedureInError()static 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.StatussetData(JsonObject data)Sets the metadata.StatussetKO()Sets the outcome of the status to KO.StatussetOk(boolean ok)Sets whether or not the current status is positive (UP) or negative (DOWN).StatussetOK()Sets the outcome of the status to OK.StatussetProcedureInError(boolean procedureInError)Sets whether or not the procedure attached to this status has failed (timeout, error...).JsonObjecttoJson()Builds the JSON representation of the currentStatusinstance.
 
- 
- 
- 
Constructor Detail- 
Statuspublic Status() Creates a new instance ofStatuswith default values.
 - 
Statuspublic Status(Status other) - Parameters:
- other- the status to copy, must not be- null
 
 - 
Statuspublic Status(JsonObject json) Creates a new instance ofStatusfrom the given JSON structure.- Parameters:
- json- the serialized form, must not be- null
 
 
- 
 - 
Method Detail- 
OKpublic static Status OK(JsonObject data) Creates a status when everything is fine and adds metadata.- Returns:
- the created Status
 
 - 
KOpublic static Status KO() Creates a status when something bad is detected.- Returns:
- the created Status
 
 - 
KOpublic static Status KO(JsonObject data) Creates a status when something bad is detected. Also add some metadata.- Returns:
- the created Status
 
 - 
toJsonpublic JsonObject toJson() Builds the JSON representation of the currentStatusinstance.- Returns:
- the json object
 
 - 
isOkpublic boolean isOk() - Returns:
- whether or not the current status is positive or negative.
 
 - 
setOkpublic Status setOk(boolean ok) Sets whether or not the current status is positive (UP) or negative (DOWN).- Parameters:
- ok-- truefor UP,- falsefor DOWN
- Returns:
- the current status
 
 - 
setKOpublic Status setKO() Sets the outcome of the status to KO.- Returns:
- the current status
 
 - 
setOKpublic Status setOK() Sets the outcome of the status to OK.- Returns:
- the current status
 
 - 
getDatapublic JsonObject getData() - Returns:
- the additional metadata.
 
 - 
setDatapublic Status setData(JsonObject data) Sets the metadata.- Parameters:
- data- the data
- Returns:
- the current status
 
 - 
isProcedureInErrorpublic boolean isProcedureInError() - Returns:
- whether or not the status denotes a failure of a procedure.
 
 - 
setProcedureInErrorpublic Status setProcedureInError(boolean procedureInError) 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
 
 
- 
 
-