public class UsualStrategy extends BaseStrategy
| 构造器和说明 |
|---|
UsualStrategy(IProvider provider) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
checkExists(String key)
Check exist.
|
boolean |
checkExists(String key,
org.apache.zookeeper.Watcher watcher)
Check exist.
|
void |
createAllNeedPath(String key,
String value,
org.apache.zookeeper.CreateMode createMode)
Create target node and all need created.
|
void |
createCurrentOnly(String key,
String value,
org.apache.zookeeper.CreateMode createMode)
Only create target node.
|
void |
deleteAllChildren(String key)
Delete target node and children nodes.
|
void |
deleteCurrentBranch(String key)
Delete the current node with force and delete the super node whose only child node is current node recursively.
|
void |
deleteOnlyCurrent(String key)
Only delete target node..
|
void |
deleteOnlyCurrent(String key,
org.apache.zookeeper.AsyncCallback.VoidCallback callback,
Object ctx)
Only delete target node..
|
List<String> |
getChildren(String key)
Get children's keys.
|
byte[] |
getData(String key)
Get string type data.
|
void |
getData(String key,
org.apache.zookeeper.AsyncCallback.DataCallback callback,
Object ctx)
Get string type data.
|
void |
update(String key,
String value)
Update.
|
getDataString, transactionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetProviderpublic UsualStrategy(IProvider provider)
public byte[] getData(String key) throws org.apache.zookeeper.KeeperException, InterruptedException
IActionkey - keyorg.apache.zookeeper.KeeperException - zookeeper exceptionInterruptedException - interrupted exceptionpublic void getData(String key, org.apache.zookeeper.AsyncCallback.DataCallback callback, Object ctx) throws org.apache.zookeeper.KeeperException, InterruptedException
IActionkey - keycallback - callbackctx - contextorg.apache.zookeeper.KeeperException - zookeeper exceptionInterruptedException - interrupted exceptionpublic boolean checkExists(String key) throws org.apache.zookeeper.KeeperException, InterruptedException
IActionkey - keyorg.apache.zookeeper.KeeperException - zookeeper exceptionInterruptedException - interrupted exceptionpublic boolean checkExists(String key, org.apache.zookeeper.Watcher watcher) throws org.apache.zookeeper.KeeperException, InterruptedException
IActionkey - keywatcher - watcherorg.apache.zookeeper.KeeperException - zookeeper exceptionInterruptedException - interrupted exceptionpublic List<String> getChildren(String key) throws org.apache.zookeeper.KeeperException, InterruptedException
IActionkey - keyorg.apache.zookeeper.KeeperException - zookeeper exceptionInterruptedException - interrupted exceptionpublic void createCurrentOnly(String key, String value, org.apache.zookeeper.CreateMode createMode) throws org.apache.zookeeper.KeeperException, InterruptedException
IActionkey - keyvalue - valuecreateMode - createModeorg.apache.zookeeper.KeeperException - zookeeper exceptionInterruptedException - interrupted exceptionpublic void update(String key, String value) throws org.apache.zookeeper.KeeperException, InterruptedException
IActionkey - keyvalue - valueorg.apache.zookeeper.KeeperException - zookeeper exceptionInterruptedException - interrupted exceptionpublic void deleteOnlyCurrent(String key) throws org.apache.zookeeper.KeeperException, InterruptedException
IActionkey - keyorg.apache.zookeeper.KeeperException - zookeeper exceptionInterruptedException - interrupted exceptionpublic void deleteOnlyCurrent(String key, org.apache.zookeeper.AsyncCallback.VoidCallback callback, Object ctx) throws org.apache.zookeeper.KeeperException, InterruptedException
IActionkey - keycallback - callbackctx - contextorg.apache.zookeeper.KeeperException - zookeeper exceptionInterruptedException - interrupted exceptionpublic void createAllNeedPath(String key, String value, org.apache.zookeeper.CreateMode createMode) throws org.apache.zookeeper.KeeperException, InterruptedException
IGroupActionkey - keyvalue - valuecreateMode - create modeorg.apache.zookeeper.KeeperException - zookeeper exceptionInterruptedException - interrupted exceptionpublic void deleteAllChildren(String key) throws org.apache.zookeeper.KeeperException, InterruptedException
IGroupActionkey - keyorg.apache.zookeeper.KeeperException - zookeeper exceptionInterruptedException - interrupted exceptionpublic void deleteCurrentBranch(String key) throws org.apache.zookeeper.KeeperException, InterruptedException
IGroupActionkey - keyorg.apache.zookeeper.KeeperException - zookeeper exceptionInterruptedException - interrupted exceptionCopyright © 2018. All rights reserved.