public abstract class AbstractSimpleClientSessionCreator extends AbstractSimpleClient implements ClientSessionCreator
log
TARGET_SERVER
DEFAULT_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,
KeyPair identity) |
protected ClientSession |
authSession(ConnectFuture future,
String password) |
long |
getAuthenticationTimeout() |
long |
getConnectTimeout() |
protected ClientSession |
loginSession(ConnectFuture future,
KeyPair identity) |
protected ClientSession |
loginSession(ConnectFuture future,
String password) |
ClientSession |
sessionLogin(SocketAddress target,
String username,
KeyPair identity)
Creates a session and logs in using the provided credentials
|
ClientSession |
sessionLogin(SocketAddress target,
String username,
String password)
Creates a session and logs in using the provided credentials
|
ClientSession |
sessionLogin(String uri,
KeyPair identity)
Creates a session and logs in using the provided credentials
|
ClientSession |
sessionLogin(String uri,
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,
Channel channel)
Wraps an existing
ClientSessionCreator into a SimpleClient |
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect
sessionLogin, sessionLogin, sessionLogin, sessionLogin, sessionLogin, sessionLogin, sessionLogin, sessionLogin
protected AbstractSimpleClientSessionCreator()
protected AbstractSimpleClientSessionCreator(long connTimeout, long authTimeout)
public long getConnectTimeout()
getConnectTimeout
in interface SimpleClientConfigurator
public void setConnectTimeout(long timeout)
setConnectTimeout
in interface SimpleClientConfigurator
timeout
- Requested connect timeout (msec.) - always positivepublic long getAuthenticationTimeout()
getAuthenticationTimeout
in interface SimpleClientConfigurator
public void setAuthenticationTimeout(long timeout)
setAuthenticationTimeout
in interface SimpleClientConfigurator
timeout
- Requested authentication timeout (msec.) - always positivepublic ClientSession sessionLogin(SocketAddress target, String username, String password) throws IOException
SimpleSessionClient
sessionLogin
in interface SimpleSessionClient
target
- The target SocketAddress
username
- Usernamepassword
- PasswordClientSession
IOException
- If failed to login or authenticatepublic ClientSession sessionLogin(SocketAddress target, String username, KeyPair identity) throws IOException
SimpleSessionClient
sessionLogin
in interface SimpleSessionClient
target
- The target SocketAddress
username
- Usernameidentity
- The KeyPair
identityClientSession
IOException
- If failed to login or authenticatepublic ClientSession sessionLogin(String uri, String password) throws IOException
SimpleSessionClient
sessionLogin
in interface SimpleSessionClient
uri
- The target uripassword
- PasswordClientSession
IOException
- If failed to login or authenticatepublic ClientSession sessionLogin(String uri, KeyPair identity) throws IOException
SimpleSessionClient
sessionLogin
in interface SimpleSessionClient
uri
- The target uriidentity
- The KeyPair
identityClientSession
IOException
- If failed to login or authenticateprotected ClientSession loginSession(ConnectFuture future, String password) throws IOException
IOException
protected ClientSession loginSession(ConnectFuture future, KeyPair identity) throws IOException
IOException
protected ClientSession authSession(ConnectFuture future, String password) throws IOException
IOException
protected ClientSession authSession(ConnectFuture future, KeyPair identity) throws IOException
IOException
protected ClientSession authSession(ClientSession clientSession) throws IOException
IOException
public static SimpleClient wrap(ClientSessionCreator creator, Channel channel)
ClientSessionCreator
into a SimpleClient
creator
- The ClientSessionCreator
- never null
channel
- The Channel
representing the creator for relaying Channel.isOpen()
and Channel.close()
callsSimpleClient
wrapper. Note: closing the wrapper also closes the underlying
sessions creator.Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.