org.apache.zookeeper.server
Class NIOServerCnxn
java.lang.Object
org.apache.zookeeper.server.NIOServerCnxn
- All Implemented Interfaces:
- ServerCnxn, Watcher
public class NIOServerCnxn
- extends Object
- implements Watcher, ServerCnxn
This class handles communication with clients using NIO. There is one per
client, but only one thread doing the communication.
NIOServerCnxn
public NIOServerCnxn(ZooKeeperServer zk,
SocketChannel sock,
SelectionKey sk,
NIOServerCnxn.Factory factory)
throws IOException
- Throws:
IOException
disableRecv
public void disableRecv()
enableRecv
public void enableRecv()
getSessionTimeout
public int getSessionTimeout()
- Specified by:
getSessionTimeout in interface ServerCnxn
toString
public String toString()
- Overrides:
toString in class Object
close
public void close()
- Specified by:
close in interface ServerCnxn
sendResponse
public void sendResponse(org.apache.zookeeper.proto.ReplyHeader h,
Record r,
String tag)
- Specified by:
sendResponse in interface ServerCnxn
process
public void process(WatchedEvent event)
- Specified by:
process in interface ServerCnxn- Specified by:
process in interface Watcher
finishSessionInit
public void finishSessionInit(boolean valid)
- Specified by:
finishSessionInit in interface ServerCnxn
getSessionId
public long getSessionId()
- Specified by:
getSessionId in interface ServerCnxn
setSessionId
public void setSessionId(long sessionId)
- Specified by:
setSessionId in interface ServerCnxn
getAuthInfo
public ArrayList<org.apache.zookeeper.data.Id> getAuthInfo()
- Specified by:
getAuthInfo in interface ServerCnxn
getRemoteAddress
public InetSocketAddress getRemoteAddress()
- Specified by:
getRemoteAddress in interface ServerCnxn
getStats
public ServerCnxn.Stats getStats()
- Specified by:
getStats in interface ServerCnxn