public class Consultant extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Consultant.Builder
Allows you to build a custom Consultant object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConfigListener(ConfigListener listener) |
void |
addSettingListener(String key,
SettingListener listener) |
static Consultant.Builder |
builder() |
void |
deregisterService() |
String |
getConsulHost() |
Properties |
getProperties() |
ServiceIdentifier |
getServiceIdentifier() |
List<ServiceInstance> |
list(String serviceName)
Deprecated.
|
Optional<InetSocketAddress> |
locate(String serviceName)
Deprecated.
|
ServiceLocator |
locateAll(String serviceName)
Returns a ServiceLocator with which services matching the specified service name can be found.
|
ServiceLocator |
locateAll(String serviceName,
RoutingStrategy routingStrategy)
Returns a ServiceLocator with which services matching the specified service name can be found.
|
void |
registerService(int port) |
boolean |
removeConfigListener(ConfigListener listener) |
boolean |
removeSettingListener(String key,
SettingListener listener) |
void |
shutdown()
Tears any outstanding resources down.
|
public static Consultant.Builder builder()
public void registerService(int port)
public void deregisterService()
@Deprecated public List<ServiceInstance> list(String serviceName)
public ServiceLocator locateAll(String serviceName)
serviceName - The name of the service to locate instances of.public ServiceLocator locateAll(String serviceName, RoutingStrategy routingStrategy)
serviceName - The name of the service to locate instances of.routingStrategy - The RoutingStrategy to use to locate instances.@Deprecated public Optional<InetSocketAddress> locate(String serviceName)
serviceName - The name of the service to locate.public void addConfigListener(ConfigListener listener)
public boolean removeConfigListener(ConfigListener listener)
public void addSettingListener(String key, SettingListener listener)
public boolean removeSettingListener(String key, SettingListener listener)
public void shutdown()
throws InterruptedException
InterruptedException - If it got interrupted while waiting for any open taskspublic String getConsulHost()
public ServiceIdentifier getServiceIdentifier()
public Properties getProperties()
Copyright © 2018. All rights reserved.