public abstract class AbstractSimpleClientSessionCreator extends AbstractSimpleClient implements ClientSessionCreator
| Modifier and Type | Field and Description |
|---|---|
private long |
authenticateTimeout |
private long |
connectTimeout |
logDEFAULT_AUTHENTICATION_TIMEOUT, DEFAULT_CONNECT_TIMEOUT, DEFAULT_PORT| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSimpleClientSessionCreator() |
protected |
AbstractSimpleClientSessionCreator(long connTimeout,
long authTimeout) |
| Modifier and Type | Method and Description |
|---|---|
protected ClientSession |
authSession(ClientSession clientSession) |
protected ClientSession |
authSession(ConnectFuture future,
java.security.KeyPair identity) |
protected ClientSession |
authSession(ConnectFuture future,
java.lang.String password) |
long |
getAuthenticationTimeout() |
long |
getConnectTimeout() |
protected ClientSession |
loginSession(ConnectFuture future,
java.security.KeyPair identity) |
protected ClientSession |
loginSession(ConnectFuture future,
java.lang.String password) |
ClientSession |
sessionLogin(java.net.SocketAddress target,
java.lang.String username,
java.security.KeyPair identity)
Creates a session and logs in using the provided credentials
|
ClientSession |
sessionLogin(java.net.SocketAddress target,
java.lang.String username,
java.lang.String password)
Creates a session and logs in using the provided credentials
|
void |
setAuthenticationTimeout(long timeout) |
void |
setConnectTimeout(long timeout) |
static SimpleClient |
wrap(ClientSessionCreator creator,
java.nio.channels.Channel channel)
Wraps an existing
ClientSessionCreator into a SimpleClient |
getSimplifiedLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconnect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connectsessionLogin, sessionLogin, sessionLogin, sessionLogin, sessionLogin, sessionLogin, sessionLogin, sessionLoginprivate long connectTimeout
private long authenticateTimeout
protected AbstractSimpleClientSessionCreator()
protected AbstractSimpleClientSessionCreator(long connTimeout,
long authTimeout)
public long getConnectTimeout()
getConnectTimeout in interface SimpleClientConfiguratorpublic void setConnectTimeout(long timeout)
setConnectTimeout in interface SimpleClientConfiguratortimeout - Requested connect timeout (msec.) - always positivepublic long getAuthenticationTimeout()
getAuthenticationTimeout in interface SimpleClientConfiguratorpublic void setAuthenticationTimeout(long timeout)
setAuthenticationTimeout in interface SimpleClientConfiguratortimeout - Requested authentication timeout (msec.) - always positivepublic ClientSession sessionLogin(java.net.SocketAddress target, java.lang.String username, java.lang.String password) throws java.io.IOException
SimpleSessionClientsessionLogin in interface SimpleSessionClienttarget - The target SocketAddressusername - Usernamepassword - PasswordClientSessionjava.io.IOException - If failed to login or authenticatepublic ClientSession sessionLogin(java.net.SocketAddress target, java.lang.String username, java.security.KeyPair identity) throws java.io.IOException
SimpleSessionClientsessionLogin in interface SimpleSessionClienttarget - The target SocketAddressusername - Usernameidentity - The KeyPair identityClientSessionjava.io.IOException - If failed to login or authenticateprotected ClientSession loginSession(ConnectFuture future, java.lang.String password) throws java.io.IOException
java.io.IOExceptionprotected ClientSession loginSession(ConnectFuture future, java.security.KeyPair identity) throws java.io.IOException
java.io.IOExceptionprotected ClientSession authSession(ConnectFuture future, java.lang.String password) throws java.io.IOException
java.io.IOExceptionprotected ClientSession authSession(ConnectFuture future, java.security.KeyPair identity) throws java.io.IOException
java.io.IOExceptionprotected ClientSession authSession(ClientSession clientSession) throws java.io.IOException
java.io.IOExceptionpublic static SimpleClient wrap(ClientSessionCreator creator, java.nio.channels.Channel channel)
ClientSessionCreator into a SimpleClientcreator - The ClientSessionCreator - never nullchannel - The Channel representing the creator for
relaying Channel.isOpen() and Channel.close() callsSimpleClient wrapper. Note: closing the wrapper
also closes the underlying sessions creator.