Package io.vertx.ext.consul
Class ServiceEntry
- java.lang.Object
-
- io.vertx.ext.consul.ServiceEntry
-
public class ServiceEntry extends Object
Holds properties of service, node and related checks- Author:
- Ruslan Sennov
-
-
Constructor Summary
Constructors Constructor Description ServiceEntry()Default constructorServiceEntry(JsonObject json)Constructor from JSONServiceEntry(ServiceEntry other)Copy constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CheckStatusaggregatedStatus()AggregatedStatus returns the "best" status for the list of health checks.booleanequals(Object o)List<Check>getChecks()Get list of checksNodegetNode()Get nodeServicegetService()Get serviceinthashCode()ServiceEntrysetChecks(List<Check> checks)Set list of checksServiceEntrysetNode(Node node)Set nodeServiceEntrysetService(Service service)Set serviceJsonObjecttoJson()Convert to JSON
-
-
-
Constructor Detail
-
ServiceEntry
public ServiceEntry()
Default constructor
-
ServiceEntry
public ServiceEntry(ServiceEntry other)
Copy constructor- Parameters:
other- the one to copy
-
ServiceEntry
public ServiceEntry(JsonObject json)
Constructor from JSON- Parameters:
json- the JSON
-
-
Method Detail
-
toJson
public JsonObject toJson()
Convert to JSON- Returns:
- the JSON
-
aggregatedStatus
public CheckStatus aggregatedStatus()
AggregatedStatus returns the "best" status for the list of health checks. Because a given entry may have many service and node-level health checks attached, this function determines the best representative of the status as as single string using the following heuristic: critical > warning > passing- Returns:
- an aggregated status
-
getNode
public Node getNode()
Get node- Returns:
- node
-
getService
public Service getService()
Get service- Returns:
- service
-
setNode
public ServiceEntry setNode(Node node)
Set node- Parameters:
node- node- Returns:
- reference to this, for fluency
-
setService
public ServiceEntry setService(Service service)
Set service- Parameters:
service- service- Returns:
- reference to this, for fluency
-
setChecks
public ServiceEntry setChecks(List<Check> checks)
Set list of checks- Parameters:
checks- list of checks- Returns:
- reference to this, for fluency
-
-