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 CheckStatus
aggregatedStatus()
AggregatedStatus returns the "best" status for the list of health checks.boolean
equals(Object o)
List<Check>
getChecks()
Get list of checksNode
getNode()
Get nodeService
getService()
Get serviceint
hashCode()
ServiceEntry
setChecks(List<Check> checks)
Set list of checksServiceEntry
setNode(Node node)
Set nodeServiceEntry
setService(Service service)
Set serviceJsonObject
toJson()
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
-
-