org.apache.zookeeper.server
Class ServerCnxnFactory
java.lang.Object
org.apache.zookeeper.server.ServerCnxnFactory
- Direct Known Subclasses:
- NettyServerCnxnFactory, NIOServerCnxnFactory
public abstract class ServerCnxnFactory
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
cnxns
protected final HashSet<ServerCnxn> cnxns
ServerCnxnFactory
public ServerCnxnFactory()
getLocalPort
public abstract int getLocalPort()
getConnections
public abstract Iterable<ServerCnxn> getConnections()
getNumAliveConnections
public int getNumAliveConnections()
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)
configureSaslLogin
protected void configureSaslLogin()
throws IOException
- Initialize the server SASL if specified.
If the user has specified a "ZooKeeperServer.LOGIN_CONTEXT_NAME_KEY"
or a jaas.conf using "java.security.auth.login.config"
the authentication is required and an exception is raised.
Otherwise no authentication is configured and no exception is raised.
- Throws:
IOException - if jaas.conf is missing or there's an error in it.
Copyright © 2013 The Apache Software Foundation