public class PreparedQueryDefinition extends Object
Constructor and Description |
---|
PreparedQueryDefinition()
Default constructor
|
PreparedQueryDefinition(JsonObject json)
Constructor from JSON
|
Modifier and Type | Method and Description |
---|---|
List<String> |
getDcs()
Specifies a fixed list of remote datacenters to forward the query to if there are no healthy nodes
in the local datacenter.
|
String |
getDnsTtl()
Get the TTL duration when query results are served over DNS.
|
String |
getId()
Get ID of the query
|
Map<String,String> |
getMeta()
Get a list of user-defined key/value pairs that will be used for filtering the query results to nodes
with the given metadata values present.
|
String |
getName()
Get an optional friendly name that can be used to execute a query instead of using its ID
|
int |
getNearestN()
Specifies that the query will be forwarded to up to NearestN other datacenters based on their estimated network
round trip time using Network Coordinates from the WAN gossip pool.
|
boolean |
getPassing()
Specifies the behavior of the query's health check filtering.
|
String |
getService()
Get the name of the service to query
|
String |
getSession()
Get the ID of an existing session.
|
List<String> |
getTags()
Get a list of service tags to filter the query results.
|
String |
getTemplateRegexp()
Get regular expression which is used to extract fields from the entire name, once this template is selected.
|
String |
getTemplateType()
The template type, which must be
name_prefix_match . |
String |
getToken()
Get the ACL token to use each time the query is executed.
|
PreparedQueryDefinition |
setDcs(List<String> dcs)
Specifies a fixed list of remote datacenters to forward the query to if there are no healthy nodes
in the local datacenter.
|
PreparedQueryDefinition |
setDnsTtl(String dnsTtl)
Set the TTL duration when query results are served over DNS.
|
PreparedQueryDefinition |
setId(String id)
Set ID of the query, always generated by Consul
|
PreparedQueryDefinition |
setMeta(Map<String,String> meta)
Set a list of user-defined key/value pairs that will be used for filtering the query results to nodes
with the given metadata values present.
|
PreparedQueryDefinition |
setName(String name)
Set an optional friendly name that can be used to execute a query instead of using its ID
|
PreparedQueryDefinition |
setNearestN(int nearestN)
Specifies that the query will be forwarded to up to NearestN other datacenters based on their estimated network
round trip time using Network Coordinates from the WAN gossip pool.
|
PreparedQueryDefinition |
setPassing(boolean passing)
Specifies the behavior of the query's health check filtering.
|
PreparedQueryDefinition |
setService(String service)
Set the name of the service to query
|
PreparedQueryDefinition |
setSession(String session)
Set the ID of an existing session.
|
PreparedQueryDefinition |
setTags(List<String> tags)
Set a list of service tags to filter the query results.
|
PreparedQueryDefinition |
setTemplateRegexp(String templateRegexp)
Set regular expression which is used to extract fields from the entire name, once this template is selected.
|
PreparedQueryDefinition |
setTemplateType(String templateType)
The template type, which must be
name_prefix_match . |
PreparedQueryDefinition |
setToken(String token)
Set the ACL token to use each time the query is executed.
|
JsonObject |
toJson()
Convert to JSON
|
public PreparedQueryDefinition()
public PreparedQueryDefinition(JsonObject json)
json
- the JSONpublic JsonObject toJson()
public String getId()
public PreparedQueryDefinition setId(String id)
id
- ID of the querypublic String getName()
public PreparedQueryDefinition setName(String name)
name
- name of the querypublic String getSession()
public PreparedQueryDefinition setSession(String session)
session
- id of sessionpublic String getService()
public PreparedQueryDefinition setService(String service)
service
- service namepublic String getToken()
public PreparedQueryDefinition setToken(String token)
token
- the ACL tokenpublic String getDnsTtl()
public PreparedQueryDefinition setDnsTtl(String dnsTtl)
dnsTtl
- the TTL durationpublic int getNearestN()
public PreparedQueryDefinition setNearestN(int nearestN)
nearestN
- number of nearest datacenters to querypublic List<String> getDcs()
public PreparedQueryDefinition setDcs(List<String> dcs)
dcs
- the list of remote datacenterspublic List<String> getTags()
public PreparedQueryDefinition setTags(List<String> tags)
tags
- list of service tagspublic boolean getPassing()
public PreparedQueryDefinition setPassing(boolean passing)
passing
- the passing flagpublic Map<String,String> getMeta()
public PreparedQueryDefinition setMeta(Map<String,String> meta)
meta
- list of key/value pairspublic String getTemplateType()
name_prefix_match
. This means that the template will apply to
any query lookup with a name whose prefix matches the Name field of the template.public PreparedQueryDefinition setTemplateType(String templateType)
name_prefix_match
. This means that the template will apply to
any query lookup with a name whose prefix matches the Name field of the template.templateType
- the query typepublic String getTemplateRegexp()
public PreparedQueryDefinition setTemplateRegexp(String templateRegexp)
templateRegexp
- a regular expressionCopyright © 2024 Eclipse. All rights reserved.