Class PreparedQueryExecuteResponse
java.lang.Object
io.vertx.ext.consul.PreparedQueryExecuteResponse
The results of executing prepared query
- Author:
- Ruslan Sennov
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorConstructor from JSON -
Method Summary
Modifier and TypeMethodDescriptiongetDc()Get the datacenter that ultimately provided the list of nodesGet the TTL duration when query results are served over DNS.intGet the number of remote datacenters that were queried while executing the query.getNodes()Get the list of healthy nodes providing the given service, as specified by the constraints of the prepared query.Get the service name that the query was selecting.Set the datacenter that ultimately provided the list of nodesSet the TTL duration when query results are served over DNS.setFailovers(int failovers) Set the number of remote datacenters that were queried while executing the query.setNodes(List<ServiceEntry> nodes) Set the list of healthy nodes providing the given service, as specified by the constraints of the prepared query.setService(String service) Set the service name that the query was selecting.toJson()Convert to JSON
-
Constructor Details
-
PreparedQueryExecuteResponse
public PreparedQueryExecuteResponse()Default constructor -
PreparedQueryExecuteResponse
Constructor from JSON- Parameters:
json- the JSON
-
-
Method Details
-
toJson
-
getService
Get the service name that the query was selecting. This is useful for context in case an empty list of nodes is returned.- Returns:
- the service name that the query was selecting.
-
setService
Set the service name that the query was selecting. This is useful for context in case an empty list of nodes is returned.- Parameters:
service- the service name that the query was selecting.- Returns:
- reference to this, for fluency
-
getDc
Get the datacenter that ultimately provided the list of nodes- Returns:
- the datacenter that ultimately provided the list of nodes
-
setDc
Set the datacenter that ultimately provided the list of nodes- Parameters:
dc- the datacenter that ultimately provided the list of nodes- Returns:
- reference to this, for fluency
-
getDnsTtl
Get the TTL duration when query results are served over DNS. If this is specified, it will take precedence over any Consul agent-specific configuration.- Returns:
- the TTL duration
-
setDnsTtl
Set the TTL duration when query results are served over DNS. If this is specified, it will take precedence over any Consul agent-specific configuration.- Parameters:
dnsTtl- the TTL duration- Returns:
- reference to this, for fluency
-
getFailovers
public int getFailovers()Get the number of remote datacenters that were queried while executing the query.- Returns:
- the number of remote datacenters that were queried while executing the query.
-
setFailovers
Set the number of remote datacenters that were queried while executing the query.- Parameters:
failovers- the number of remote datacenters that were queried while executing the query.- Returns:
- reference to this, for fluency
-
getNodes
Get the list of healthy nodes providing the given service, as specified by the constraints of the prepared query.- Returns:
- the list of healthy nodes providing the given service, as specified by the constraints of the prepared query.
-
setNodes
Set the list of healthy nodes providing the given service, as specified by the constraints of the prepared query.- Parameters:
nodes- the list of healthy nodes providing the given service, as specified by the constraints of the prepared query.- Returns:
- reference to this, for fluency
-