org.apache.zookeeper.server
Class ServerCnxnFactory

java.lang.Object
  extended by org.apache.zookeeper.server.ServerCnxnFactory
Direct Known Subclasses:
NettyServerCnxnFactory, NIOServerCnxnFactory

public abstract class ServerCnxnFactory
extends Object


Nested Class Summary
static interface ServerCnxnFactory.PacketProcessor
           
 
Field Summary
 Login login
           
protected  SaslServerCallbackHandler saslServerCallbackHandler
           
protected  ZooKeeperServer zkServer
           
static String ZOOKEEPER_SERVER_CNXN_FACTORY
           
 
Constructor Summary
ServerCnxnFactory()
           
 
Method Summary
abstract  void closeAll()
           
abstract  void closeSession(long sessionId)
           
abstract  void configure(InetSocketAddress addr, int maxClientCnxns)
           
static ServerCnxnFactory createFactory()
           
static ServerCnxnFactory createFactory(InetSocketAddress addr, int maxClientCnxns)
           
static ServerCnxnFactory createFactory(int clientPort, int maxClientCnxns)
           
abstract  Iterable<ServerCnxn> getConnections()
           
abstract  InetSocketAddress getLocalAddress()
           
abstract  int getLocalPort()
           
abstract  int getMaxClientCnxnsPerHost()
          Maximum number of connections allowed from particular host (ip)
abstract  void join()
           
 void registerConnection(ServerCnxn serverCnxn)
           
abstract  void setMaxClientCnxnsPerHost(int max)
          Maximum number of connections allowed from particular host (ip)
 void setZooKeeperServer(ZooKeeperServer zk)
           
abstract  void shutdown()
           
abstract  void start()
           
abstract  void startup(ZooKeeperServer zkServer)
           
 void unregisterConnection(ServerCnxn serverCnxn)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ZOOKEEPER_SERVER_CNXN_FACTORY

public static final String ZOOKEEPER_SERVER_CNXN_FACTORY
See Also:
Constant Field Values

saslServerCallbackHandler

protected SaslServerCallbackHandler saslServerCallbackHandler

login

public Login login

zkServer

protected ZooKeeperServer zkServer
Constructor Detail

ServerCnxnFactory

public ServerCnxnFactory()
Method Detail

getLocalPort

public abstract int getLocalPort()

getConnections

public abstract Iterable<ServerCnxn> getConnections()

closeSession

public abstract void closeSession(long sessionId)

configure

public abstract void configure(InetSocketAddress addr,
                               int maxClientCnxns)
                        throws IOException
Throws:
IOException

getMaxClientCnxnsPerHost

public abstract int getMaxClientCnxnsPerHost()
Maximum number of connections allowed from particular host (ip)


setMaxClientCnxnsPerHost

public abstract void setMaxClientCnxnsPerHost(int max)
Maximum number of connections allowed from particular host (ip)


startup

public abstract void startup(ZooKeeperServer zkServer)
                      throws IOException,
                             InterruptedException
Throws:
IOException
InterruptedException

join

public abstract void join()
                   throws InterruptedException
Throws:
InterruptedException

shutdown

public abstract void shutdown()

start

public abstract void start()

setZooKeeperServer

public final void setZooKeeperServer(ZooKeeperServer zk)

closeAll

public abstract void closeAll()

createFactory

public static ServerCnxnFactory createFactory()
                                       throws IOException
Throws:
IOException

createFactory

public static ServerCnxnFactory createFactory(int clientPort,
                                              int maxClientCnxns)
                                       throws IOException
Throws:
IOException

createFactory

public static ServerCnxnFactory createFactory(InetSocketAddress addr,
                                              int maxClientCnxns)
                                       throws IOException
Throws:
IOException

getLocalAddress

public abstract InetSocketAddress getLocalAddress()

unregisterConnection

public void unregisterConnection(ServerCnxn serverCnxn)

registerConnection

public void registerConnection(ServerCnxn serverCnxn)


Copyright © 2011 The Apache Software Foundation