public class ZooKeeperDiscovery extends com.google.common.cache.CacheLoader<String,org.apache.curator.x.discovery.ServiceProvider<Payload>> implements ExtendedDiscovery, io.dropwizard.lifecycle.Managed, com.google.common.cache.RemovalListener<String,org.apache.curator.x.discovery.ServiceProvider<Payload>>
Constructor and Description |
---|
ZooKeeperDiscovery(org.apache.curator.framework.CuratorFramework curator,
ZooKeeperDiscoveryFactory factory,
SoaInfo soaInfo,
io.dropwizard.setup.Environment environment,
Collection<String> instanceDeploymentGroups) |
Modifier and Type | Method and Description |
---|---|
Collection<DiscoveryInstance> |
getAllInstances(String serviceName) |
DiscoveryInstance |
getInstance(String serviceName) |
Collection<String> |
getServiceNames() |
org.apache.curator.x.discovery.ServiceProvider<Payload> |
load(String serviceName) |
void |
noteError(String serviceName,
DiscoveryInstance errorInstance,
int statusCode,
Throwable exception) |
void |
noteSuccess(String serviceName,
DiscoveryInstance instance,
int statusCode) |
void |
onRemoval(com.google.common.cache.RemovalNotification<String,org.apache.curator.x.discovery.ServiceProvider<Payload>> notification) |
Collection<DiscoveryInstance> |
queryForAllInstances(String serviceName) |
Collection<String> |
queryForServiceNames() |
void |
setForcedState(String serviceName,
String instanceId,
ForcedState forcedState) |
void |
setHealthyState(HealthyState newHealthyState) |
void |
setMetaData(Map<String,String> newMetaData) |
void |
start() |
void |
stop() |
public ZooKeeperDiscovery(org.apache.curator.framework.CuratorFramework curator, ZooKeeperDiscoveryFactory factory, SoaInfo soaInfo, io.dropwizard.setup.Environment environment, Collection<String> instanceDeploymentGroups)
public Collection<String> getServiceNames()
getServiceNames
in interface Discovery
public Collection<String> queryForServiceNames()
queryForServiceNames
in interface ExtendedDiscovery
public void setHealthyState(HealthyState newHealthyState)
setHealthyState
in interface Discovery
public void setMetaData(Map<String,String> newMetaData)
setMetaData
in interface Discovery
public void setForcedState(String serviceName, String instanceId, ForcedState forcedState)
setForcedState
in interface ExtendedDiscovery
public org.apache.curator.x.discovery.ServiceProvider<Payload> load(String serviceName) throws Exception
public void onRemoval(com.google.common.cache.RemovalNotification<String,org.apache.curator.x.discovery.ServiceProvider<Payload>> notification)
public Collection<DiscoveryInstance> queryForAllInstances(String serviceName)
queryForAllInstances
in interface ExtendedDiscovery
public Collection<DiscoveryInstance> getAllInstances(String serviceName)
getAllInstances
in interface Discovery
public DiscoveryInstance getInstance(String serviceName)
getInstance
in interface Discovery
public void noteError(String serviceName, DiscoveryInstance errorInstance, int statusCode, Throwable exception)
public void noteSuccess(String serviceName, DiscoveryInstance instance, int statusCode)
noteSuccess
in interface Discovery
public void start() throws Exception
start
in interface io.dropwizard.lifecycle.Managed
Exception
Copyright © 2014–2016 Soabase. All rights reserved.