Package com.networknt.consul
Class ConsulRegistry
- java.lang.Object
-
- com.networknt.registry.support.AbstractRegistry
-
- com.networknt.consul.ConsulRegistry
-
- All Implemented Interfaces:
DiscoveryService,Registry,RegistryService
public class ConsulRegistry extends AbstractRegistry
-
-
Field Summary
-
Fields inherited from class com.networknt.registry.support.AbstractRegistry
registryClassName
-
-
Constructor Summary
Constructors Constructor Description ConsulRegistry(URL url, ConsulClient client)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoAvailable(URL url)protected List<URL>doDiscover(URL url)protected voiddoRegister(URL url)protected voiddoSubscribe(URL url, NotifyListener listener)Override the method incom.networknt.registry.support.commandCommandFailbackRegistryto skip calling thecom.networknt.registry.support.commandCommandFailbackRegistry#doDiscover()andcom.networknt.registry.support.commandCommandFailbackRegistry#notify()protected voiddoUnavailable(URL url)protected voiddoUnregister(URL url)protected voiddoUnsubscribe(URL url, NotifyListener listener)ConcurrentHashMap<String,ConcurrentHashMap<URL,NotifyListener>>getNotifyListeners()-
Methods inherited from class com.networknt.registry.support.AbstractRegistry
available, discover, getRegisteredServiceUrls, getUrl, notify, register, subscribe, unavailable, unregister, unsubscribe
-
-
-
-
Constructor Detail
-
ConsulRegistry
public ConsulRegistry(URL url, ConsulClient client)
-
-
Method Detail
-
getNotifyListeners
public ConcurrentHashMap<String,ConcurrentHashMap<URL,NotifyListener>> getNotifyListeners()
-
doRegister
protected void doRegister(URL url)
- Specified by:
doRegisterin classAbstractRegistry
-
doUnregister
protected void doUnregister(URL url)
- Specified by:
doUnregisterin classAbstractRegistry
-
doAvailable
protected void doAvailable(URL url)
- Specified by:
doAvailablein classAbstractRegistry
-
doUnavailable
protected void doUnavailable(URL url)
- Specified by:
doUnavailablein classAbstractRegistry
-
doSubscribe
protected void doSubscribe(URL url, NotifyListener listener)
Override the method incom.networknt.registry.support.commandCommandFailbackRegistryto skip calling thecom.networknt.registry.support.commandCommandFailbackRegistry#doDiscover()andcom.networknt.registry.support.commandCommandFailbackRegistry#notify()- Specified by:
doSubscribein classAbstractRegistry- Parameters:
url- The subscribed service URLlistener- The listener to be notified when service registration changed.
-
doUnsubscribe
protected void doUnsubscribe(URL url, NotifyListener listener)
- Specified by:
doUnsubscribein classAbstractRegistry
-
doDiscover
protected List<URL> doDiscover(URL url)
- Specified by:
doDiscoverin classAbstractRegistry
-
-