类 AbstractEtcdClient<WatcherListener>
- java.lang.Object
-
- org.apache.dubbo.remoting.etcd.support.AbstractEtcdClient<WatcherListener>
-
- 所有已实现的接口:
EtcdClient
- 直接已知子类:
JEtcdClient
public abstract class AbstractEtcdClient<WatcherListener> extends Object implements EtcdClient
-
-
构造器概要
构造器 构造器 说明 AbstractEtcdClient(URL url)
-
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 List<String>addChildListener(String path, ChildListener listener)register children listener for specified path.abstract List<String>addChildWatcherListener(String path, WatcherListener listener)voidaddStateListener(StateListener listener)support connection notify if connection state was changed.abstract booleancheckExists(String path)voidclose()close current client and release all resourses.voidcreate(String path)save the specified path to the etcd registry.abstract WatcherListenercreateChildWatcherListener(String path, ChildListener listener)longcreateEphemeral(String path)save the specified path to the etcd registry.abstract voiddelete(String path)remove the specified from etcd registry.abstract voiddoClose()abstract longdoCreateEphemeral(String path)abstract voiddoCreatePersistent(String path)WatcherListenergetChildListener(String path, ChildListener listener)find watcher of the children listener for specified path.Set<StateListener>getSessionListeners()URLgetUrl()voidremoveChildListener(String path, ChildListener listener)unregister children lister for specified path.abstract voidremoveChildWatcherListener(String path, WatcherListener listener)voidremoveStateListener(StateListener listener)remove connection notify if connection state was changed.-
从接口继承的方法 org.apache.dubbo.remoting.etcd.EtcdClient
createLease, createLease, getChildren, getKVValue, isConnected, put, putEphemeral, revokeLease
-
-
-
-
构造器详细资料
-
AbstractEtcdClient
public AbstractEtcdClient(URL url)
-
-
方法详细资料
-
getUrl
public URL getUrl()
- 指定者:
getUrl在接口中EtcdClient
-
create
public void create(String path)
从接口复制的说明:EtcdClientsave the specified path to the etcd registry.- 指定者:
create在接口中EtcdClient- 参数:
path- the path to be saved
-
createEphemeral
public long createEphemeral(String path)
从接口复制的说明:EtcdClientsave the specified path to the etcd registry. if node disconnect from etcd, it will be deleted automatically by etcd when session timeout.- 指定者:
createEphemeral在接口中EtcdClient- 参数:
path- the path to be saved- 返回:
- the lease of current path.
-
addStateListener
public void addStateListener(StateListener listener)
从接口复制的说明:EtcdClientsupport connection notify if connection state was changed.- 指定者:
addStateListener在接口中EtcdClient- 参数:
listener- if state changed, listener will be triggered.
-
removeStateListener
public void removeStateListener(StateListener listener)
从接口复制的说明:EtcdClientremove connection notify if connection state was changed.- 指定者:
removeStateListener在接口中EtcdClient- 参数:
listener- remove already registered listener, if listener not exists nothing happened.
-
getSessionListeners
public Set<StateListener> getSessionListeners()
-
addChildListener
public List<String> addChildListener(String path, ChildListener listener)
从接口复制的说明:EtcdClientregister children listener for specified path.- 指定者:
addChildListener在接口中EtcdClient- 参数:
path- the path to be watched when children is added, delete or update.listener- when children is changed , listener will be triggered.- 返回:
- direct children directory, contains zero element list if children directory not exists.
-
getChildListener
public WatcherListener getChildListener(String path, ChildListener listener)
从接口复制的说明:EtcdClientfind watcher of the children listener for specified path.- 指定者:
getChildListener在接口中EtcdClient- 参数:
path- the path to be watched when children is added, delete or update.listener- when children is changed , listener will be triggered.- 返回:
- watcher if find else null
-
removeChildListener
public void removeChildListener(String path, ChildListener listener)
从接口复制的说明:EtcdClientunregister children lister for specified path.- 指定者:
removeChildListener在接口中EtcdClient- 参数:
path- the path to be unwatched .listener- when children is changed , lister will be triggered.
-
close
public void close()
从接口复制的说明:EtcdClientclose current client and release all resourses.- 指定者:
close在接口中EtcdClient
-
doClose
public abstract void doClose()
-
doCreatePersistent
public abstract void doCreatePersistent(String path)
-
doCreateEphemeral
public abstract long doCreateEphemeral(String path)
-
delete
public abstract void delete(String path)
从接口复制的说明:EtcdClientremove the specified from etcd registry.- 指定者:
delete在接口中EtcdClient- 参数:
path- the path to be removed
-
checkExists
public abstract boolean checkExists(String path)
-
createChildWatcherListener
public abstract WatcherListener createChildWatcherListener(String path, ChildListener listener)
-
addChildWatcherListener
public abstract List<String> addChildWatcherListener(String path, WatcherListener listener)
-
removeChildWatcherListener
public abstract void removeChildWatcherListener(String path, WatcherListener listener)
-
-