public class ClientCnxn
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
packetLen |
Constructor and Description |
---|
ClientCnxn(java.lang.String hosts,
int sessionTimeout,
ZooKeeper zooKeeper,
ClientWatchManager watcher)
Creates a connection object.
|
ClientCnxn(java.lang.String hosts,
int sessionTimeout,
ZooKeeper zooKeeper,
ClientWatchManager watcher,
long sessionId,
byte[] sessionPasswd)
Creates a connection object.
|
Modifier and Type | Method and Description |
---|---|
void |
addAuthInfo(java.lang.String scheme,
byte[] auth) |
void |
close()
Close the connection, which includes; send session disconnect to the
server, shutdown the send/event threads.
|
void |
disconnect()
Shutdown the send/event threads.
|
static boolean |
getDisableAutoResetWatch()
tests use this to check on reset of watches
|
long |
getSessionId() |
byte[] |
getSessionPasswd() |
int |
getSessionTimeout() |
static void |
setDisableAutoResetWatch(boolean b)
tests use this to set the auto reset
|
void |
start() |
ReplyHeader |
submitRequest(RequestHeader h,
org.apache.jute.Record request,
org.apache.jute.Record response,
org.apache.zookeeper.ZooKeeper.WatchRegistration watchRegistration) |
java.lang.String |
toString() |
public ClientCnxn(java.lang.String hosts, int sessionTimeout, ZooKeeper zooKeeper, ClientWatchManager watcher) throws java.io.IOException
hosts
- a comma separated list of hosts that can be connected to.sessionTimeout
- the timeout for connections.zooKeeper
- the zookeeper object that this connection is related to.watcher
- watcher for this connectionjava.io.IOException
public ClientCnxn(java.lang.String hosts, int sessionTimeout, ZooKeeper zooKeeper, ClientWatchManager watcher, long sessionId, byte[] sessionPasswd) throws java.io.IOException
hosts
- a comma separated list of hosts that can be connected to.sessionTimeout
- the timeout for connections.zooKeeper
- the zookeeper object that this connection is related to.watcher
- watcher for this connectionsessionId
- session id if re-establishing sessionsessionPasswd
- session passwd if re-establishing sessionjava.io.IOException
public long getSessionId()
public byte[] getSessionPasswd()
public int getSessionTimeout()
public java.lang.String toString()
toString
in class java.lang.Object
public static boolean getDisableAutoResetWatch()
public static void setDisableAutoResetWatch(boolean b)
b
- the vaued to set disable watches topublic void start()
public void disconnect()
public void close() throws java.io.IOException
java.io.IOException
public ReplyHeader submitRequest(RequestHeader h, org.apache.jute.Record request, org.apache.jute.Record response, org.apache.zookeeper.ZooKeeper.WatchRegistration watchRegistration) throws java.lang.InterruptedException
java.lang.InterruptedException
public void addAuthInfo(java.lang.String scheme, byte[] auth)
Copyright © 2016 The Apache Software Foundation