org.I0Itec.zkclient
Class ZkConnection

java.lang.Object
  extended by org.I0Itec.zkclient.ZkConnection

public class ZkConnection
extends java.lang.Object


Constructor Summary
ZkConnection(java.lang.String zkServers)
           
ZkConnection(java.lang.String zkServers, int sessionTimeOut)
           
 
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 getZookeeper()
           
 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)
           
 void writeData(java.lang.String path, byte[] data, int version)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZkConnection

public ZkConnection(java.lang.String zkServers)

ZkConnection

public ZkConnection(java.lang.String zkServers,
                    int sessionTimeOut)
Method Detail

connect

public void connect(org.apache.zookeeper.Watcher watcher)

close

public void close()
           throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

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
Throws:
org.apache.zookeeper.KeeperException
java.lang.InterruptedException

delete

public void delete(java.lang.String path)
            throws java.lang.InterruptedException,
                   org.apache.zookeeper.KeeperException
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
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
Throws:
org.apache.zookeeper.KeeperException
java.lang.InterruptedException

readData

public byte[] readData(java.lang.String path,
                       org.apache.zookeeper.data.Stat stat,
                       boolean watch)
                throws org.apache.zookeeper.KeeperException,
                       java.lang.InterruptedException
Throws:
org.apache.zookeeper.KeeperException
java.lang.InterruptedException

writeData

public void writeData(java.lang.String path,
                      byte[] data)
               throws org.apache.zookeeper.KeeperException,
                      java.lang.InterruptedException
Throws:
org.apache.zookeeper.KeeperException
java.lang.InterruptedException

writeData

public void writeData(java.lang.String path,
                      byte[] data,
                      int version)
               throws org.apache.zookeeper.KeeperException,
                      java.lang.InterruptedException
Throws:
org.apache.zookeeper.KeeperException
java.lang.InterruptedException

getZookeeperState

public org.apache.zookeeper.ZooKeeper.States getZookeeperState()

getZookeeper

public org.apache.zookeeper.ZooKeeper getZookeeper()

getCreateTime

public long getCreateTime(java.lang.String path)
                   throws org.apache.zookeeper.KeeperException,
                          java.lang.InterruptedException
Throws:
org.apache.zookeeper.KeeperException
java.lang.InterruptedException

getServers

public java.lang.String getServers()