public class CatalogClient extends Object
Modifier and Type | Method and Description |
---|---|
void |
deregister(CatalogDeregistration deregistration)
Deregisters a service or node.
|
void |
deregister(CatalogDeregistration deregistration,
QueryOptions options)
Deregisters a service or node.
|
ClientConfig |
getConfig() |
List<String> |
getDatacenters()
Retrieves all datacenters.
|
ClientEventHandler |
getEventHandler() |
ConsulResponse<CatalogNode> |
getNode(String node)
Retrieves a single node.
|
ConsulResponse<CatalogNode> |
getNode(String node,
QueryOptions queryOptions)
Retrieves a single node for a given datacenter with
QueryOptions . |
void |
getNode(String node,
QueryOptions queryOptions,
ConsulResponseCallback<CatalogNode> callback)
Asynchronously retrieves the single node for a given datacenter with
QueryOptions . |
ConsulResponse<List<Node>> |
getNodes()
Retrieves all nodes.
|
ConsulResponse<List<Node>> |
getNodes(QueryOptions queryOptions)
Retrieves all nodes for a given datacenter with
QueryOptions . |
void |
getNodes(QueryOptions queryOptions,
ConsulResponseCallback<List<Node>> callback)
Asynchronously retrieves the nodes for a given datacenter with
QueryOptions . |
ConsulResponse<List<CatalogService>> |
getService(String service)
Retrieves the single service.
|
ConsulResponse<List<CatalogService>> |
getService(String service,
QueryOptions queryOptions)
Retrieves a single service for a given datacenter with
QueryOptions . |
void |
getService(String service,
QueryOptions queryOptions,
ConsulResponseCallback<List<CatalogService>> callback)
Asynchronously retrieves the single service for a given datacenter with
QueryOptions . |
ConsulResponse<Map<String,List<String>>> |
getServices()
Retrieves all services for a given datacenter.
|
void |
getServices(ConsulResponseCallback<Map<String,List<String>>> callback)
Asynchronously retrieves the services for a given datacenter.
|
ConsulResponse<Map<String,List<String>>> |
getServices(QueryOptions queryOptions)
Retrieves all services for a given datacenter.
|
void |
getServices(QueryOptions queryOptions,
ConsulResponseCallback<Map<String,List<String>>> callback)
Asynchronously retrieves the services for a given datacenter.
|
void |
register(CatalogRegistration registration)
Registers a service or node.
|
void |
register(CatalogRegistration registration,
QueryOptions options)
Registers a service or node.
|
protected final Http http
public List<String> getDatacenters()
public ConsulResponse<List<Node>> getNodes()
ConsulResponse
containing a list of
Node
objects.public ConsulResponse<List<Node>> getNodes(QueryOptions queryOptions)
QueryOptions
.
GET /v1/catalog/nodes?dc={datacenter}queryOptions
- The Query Options to use.ConsulResponse
containing a list of
Node
objects.public void getNodes(QueryOptions queryOptions, ConsulResponseCallback<List<Node>> callback)
QueryOptions
.
GET /v1/catalog/nodes?dc={datacenter}queryOptions
- The Query Options to use.callback
- Callback implemented by callee to handle results.
Node
objects.public ConsulResponse<Map<String,List<String>>> getServices()
ConsulResponse
containing a map of service name to list of tags.public void getServices(ConsulResponseCallback<Map<String,List<String>>> callback)
callback
- Callback implemented by callee to handle results.public ConsulResponse<Map<String,List<String>>> getServices(QueryOptions queryOptions)
queryOptions
- The Query Options to use.ConsulResponse
containing a map of service name to list of tags.public void getServices(QueryOptions queryOptions, ConsulResponseCallback<Map<String,List<String>>> callback)
queryOptions
- The Query Options to use.callback
- Callback implemented by callee to handle results.public ConsulResponse<List<CatalogService>> getService(String service)
ConsulResponse
containing
CatalogService
objects.public ConsulResponse<List<CatalogService>> getService(String service, QueryOptions queryOptions)
QueryOptions
.
GET /v1/catalog/service/{service}?dc={datacenter}queryOptions
- The Query Options to use.ConsulResponse
containing
CatalogService
objects.public void getService(String service, QueryOptions queryOptions, ConsulResponseCallback<List<CatalogService>> callback)
QueryOptions
.
GET /v1/catalog/service/{service}?dc={datacenter}queryOptions
- The Query Options to use.callback
- Callback implemented by callee to handle results.public ConsulResponse<CatalogNode> getNode(String node)
CatalogService
objects.public ConsulResponse<CatalogNode> getNode(String node, QueryOptions queryOptions)
QueryOptions
.
GET /v1/catalog/node/{node}?dc={datacenter}queryOptions
- The Query Options to use.CatalogService
objects.public void getNode(String node, QueryOptions queryOptions, ConsulResponseCallback<CatalogNode> callback)
QueryOptions
.
GET /v1/catalog/node/{node}?dc={datacenter}queryOptions
- The Query Options to use.callback
- Callback implemented by callee to handle results.public void register(CatalogRegistration registration)
registration
- A CatalogRegistration
public void register(CatalogRegistration registration, QueryOptions options)
registration
- A CatalogRegistration
public void deregister(CatalogDeregistration deregistration)
deregistration
- A CatalogDeregistration
public void deregister(CatalogDeregistration deregistration, QueryOptions options)
deregistration
- A CatalogDeregistration
public ClientConfig getConfig()
public ClientEventHandler getEventHandler()
Copyright © 2018. All rights reserved.