Class PreparedQueryExecuteResponse


  • public class PreparedQueryExecuteResponse
    extends Object
    The results of executing prepared query
    Author:
    Ruslan Sennov
    • Constructor Detail

      • PreparedQueryExecuteResponse

        public PreparedQueryExecuteResponse()
        Default constructor
      • PreparedQueryExecuteResponse

        public PreparedQueryExecuteResponse​(JsonObject json)
        Constructor from JSON
        Parameters:
        json - the JSON
    • Method Detail

      • toJson

        public JsonObject toJson()
        Convert to JSON
        Returns:
        the JSON
      • getService

        public String 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

        public PreparedQueryExecuteResponse setService​(String service)
        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

        public String getDc()
        Get the datacenter that ultimately provided the list of nodes
        Returns:
        the datacenter that ultimately provided the list of nodes
      • setDc

        public PreparedQueryExecuteResponse setDc​(String dc)
        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

        public String 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

        public PreparedQueryExecuteResponse setDnsTtl​(String dnsTtl)
        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

        public PreparedQueryExecuteResponse setFailovers​(int failovers)
        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

        public List<ServiceEntry> 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

        public PreparedQueryExecuteResponse setNodes​(List<ServiceEntry> nodes)
        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