Package com.networknt.consul
Class ConsulRegistry
- java.lang.Object
-
- com.networknt.registry.support.FailbackRegistry
-
- com.networknt.registry.support.command.CommandFailbackRegistry
-
- com.networknt.consul.ConsulRegistry
-
- All Implemented Interfaces:
DiscoveryService
,Registry
,RegistryService
public class ConsulRegistry extends CommandFailbackRegistry
-
-
Field Summary
Fields Modifier and Type Field Description protected String
registryClassName
-
Constructor Summary
Constructors Constructor Description ConsulRegistry(URL url, ConsulClient client)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
available(URL arg0)
protected List<URL>
discoverService(URL url)
protected void
doAvailable(URL url)
protected void
doRegister(URL url)
protected void
doUnavailable(URL url)
protected void
doUnregister(URL url)
Collection<URL>
getRegisteredServiceUrls()
ConcurrentHashMap<String,ConcurrentHashMap<URL,ServiceListener>>
getServiceListeners()
URL
getUrl()
protected void
notify(URL arg0, NotifyListener arg1, List<URL> arg2)
protected void
subscribeService(URL url, ServiceListener serviceListener)
void
unavailable(URL arg0)
protected void
unsubscribeService(URL url, ServiceListener listener)
-
Methods inherited from class com.networknt.registry.support.command.CommandFailbackRegistry
doDiscover, doSubscribe, doUnsubscribe, getCommandManagerMap
-
Methods inherited from class com.networknt.registry.support.FailbackRegistry
discover, register, subscribe, unregister, unsubscribe
-
-
-
-
Field Detail
-
registryClassName
protected String registryClassName
-
-
Constructor Detail
-
ConsulRegistry
public ConsulRegistry(URL url, ConsulClient client)
-
-
Method Detail
-
getServiceListeners
public ConcurrentHashMap<String,ConcurrentHashMap<URL,ServiceListener>> getServiceListeners()
-
doRegister
protected void doRegister(URL url)
-
doUnregister
protected void doUnregister(URL url)
-
doAvailable
protected void doAvailable(URL url)
-
doUnavailable
protected void doUnavailable(URL url)
-
subscribeService
protected void subscribeService(URL url, ServiceListener serviceListener)
- Specified by:
subscribeService
in classCommandFailbackRegistry
-
unsubscribeService
protected void unsubscribeService(URL url, ServiceListener listener)
- Specified by:
unsubscribeService
in classCommandFailbackRegistry
-
discoverService
protected List<URL> discoverService(URL url)
- Specified by:
discoverService
in classCommandFailbackRegistry
-
getRegisteredServiceUrls
public Collection<URL> getRegisteredServiceUrls()
- Specified by:
getRegisteredServiceUrls
in interfaceRegistryService
-
available
public void available(URL arg0)
- Specified by:
available
in interfaceRegistryService
-
unavailable
public void unavailable(URL arg0)
- Specified by:
unavailable
in interfaceRegistryService
-
notify
protected void notify(URL arg0, NotifyListener arg1, List<URL> arg2)
-
-