org.I0Itec.zkclient
Class InMemoryConnection
java.lang.Object
org.I0Itec.zkclient.InMemoryConnection
- All Implemented Interfaces:
- IZkConnection
public class InMemoryConnection
- extends java.lang.Object
- implements IZkConnection
|
Method Summary |
void |
close()
|
void |
connect(org.apache.zookeeper.Watcher watcher)
|
java.lang.String |
create(java.lang.String path,
byte[] data,
org.apache.zookeeper.CreateMode mode)
|
void |
delete(java.lang.String path)
|
boolean |
exists(java.lang.String path,
boolean watch)
|
java.util.List<java.lang.String> |
getChildren(java.lang.String path,
boolean watch)
|
long |
getCreateTime(java.lang.String path)
|
java.lang.String |
getServers()
|
org.apache.zookeeper.ZooKeeper.States |
getZookeeperState()
|
byte[] |
readData(java.lang.String path,
org.apache.zookeeper.data.Stat stat,
boolean watch)
|
void |
writeData(java.lang.String path,
byte[] data,
int expectedVersion)
|
org.apache.zookeeper.data.Stat |
writeDataReturnStat(java.lang.String path,
byte[] data,
int expectedVersion)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InMemoryConnection
public InMemoryConnection()
close
public void close()
throws java.lang.InterruptedException
- Specified by:
close in interface IZkConnection
- Throws:
java.lang.InterruptedException
connect
public void connect(org.apache.zookeeper.Watcher watcher)
- Specified by:
connect in interface IZkConnection
create
public java.lang.String create(java.lang.String path,
byte[] data,
org.apache.zookeeper.CreateMode mode)
throws org.apache.zookeeper.KeeperException,
java.lang.InterruptedException
- Specified by:
create in interface IZkConnection
- Throws:
org.apache.zookeeper.KeeperException
java.lang.InterruptedException
delete
public void delete(java.lang.String path)
throws java.lang.InterruptedException,
org.apache.zookeeper.KeeperException
- Specified by:
delete in interface IZkConnection
- Throws:
java.lang.InterruptedException
org.apache.zookeeper.KeeperException
exists
public boolean exists(java.lang.String path,
boolean watch)
throws org.apache.zookeeper.KeeperException,
java.lang.InterruptedException
- Specified by:
exists in interface IZkConnection
- Throws:
org.apache.zookeeper.KeeperException
java.lang.InterruptedException
getChildren
public java.util.List<java.lang.String> getChildren(java.lang.String path,
boolean watch)
throws org.apache.zookeeper.KeeperException,
java.lang.InterruptedException
- Specified by:
getChildren in interface IZkConnection
- Throws:
org.apache.zookeeper.KeeperException
java.lang.InterruptedException
getZookeeperState
public org.apache.zookeeper.ZooKeeper.States getZookeeperState()
- Specified by:
getZookeeperState in interface IZkConnection
readData
public byte[] readData(java.lang.String path,
org.apache.zookeeper.data.Stat stat,
boolean watch)
throws org.apache.zookeeper.KeeperException,
java.lang.InterruptedException
- Specified by:
readData in interface IZkConnection
- Throws:
org.apache.zookeeper.KeeperException
java.lang.InterruptedException
writeData
public void writeData(java.lang.String path,
byte[] data,
int expectedVersion)
throws org.apache.zookeeper.KeeperException,
java.lang.InterruptedException
- Specified by:
writeData in interface IZkConnection
- Throws:
org.apache.zookeeper.KeeperException
java.lang.InterruptedException
writeDataReturnStat
public org.apache.zookeeper.data.Stat writeDataReturnStat(java.lang.String path,
byte[] data,
int expectedVersion)
throws org.apache.zookeeper.KeeperException,
java.lang.InterruptedException
- Specified by:
writeDataReturnStat in interface IZkConnection
- Throws:
org.apache.zookeeper.KeeperException
java.lang.InterruptedException
getCreateTime
public long getCreateTime(java.lang.String path)
- Specified by:
getCreateTime in interface IZkConnection
getServers
public java.lang.String getServers()
- Specified by:
getServers in interface IZkConnection