Package org.apache.sshd.client.simple
Class AbstractSimpleClientSessionCreator
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.client.simple.AbstractSimpleClient
org.apache.sshd.client.simple.AbstractSimpleClientSessionCreator
- All Implemented Interfaces:
Closeable,AutoCloseable,Channel,ClientSessionCreator,SimpleClient,SimpleClientConfigurator,SimpleSessionClient
public abstract class AbstractSimpleClientSessionCreator
extends AbstractSimpleClient
implements ClientSessionCreator
-
Field Summary
FieldsFields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
logFields inherited from interface org.apache.sshd.client.session.ClientSessionCreator
TARGET_SERVERFields inherited from interface org.apache.sshd.client.simple.SimpleClientConfigurator
DEFAULT_AUTHENTICATION_TIMEOUT, DEFAULT_CONNECT_TIMEOUT, DEFAULT_PORT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAbstractSimpleClientSessionCreator(long connTimeout, long authTimeout) -
Method Summary
Modifier and TypeMethodDescriptionprotected ClientSessionauthSession(ConnectFuture future, String password) protected ClientSessionauthSession(ConnectFuture future, KeyPair identity) protected ClientSessionauthSession(ClientSession clientSession) longlongprotected ClientSessionloginSession(ConnectFuture future, String password) protected ClientSessionloginSession(ConnectFuture future, KeyPair identity) sessionLogin(String uri, String password) Creates a session and logs in using the provided credentialssessionLogin(String uri, KeyPair identity) Creates a session and logs in using the provided credentialssessionLogin(SocketAddress target, String username, String password) Creates a session and logs in using the provided credentialssessionLogin(SocketAddress target, String username, KeyPair identity) Creates a session and logs in using the provided credentialsvoidsetAuthenticationTimeout(long timeout) voidsetConnectTimeout(long timeout) static SimpleClientwrap(ClientSessionCreator creator, Channel channel) Wraps an existingClientSessionCreatorinto aSimpleClientMethods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.sshd.client.session.ClientSessionCreator
connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connectMethods inherited from interface org.apache.sshd.client.simple.SimpleSessionClient
sessionLogin, sessionLogin, sessionLogin, sessionLogin, sessionLogin, sessionLogin, sessionLogin, sessionLogin
-
Field Details
-
connectTimeout
private long connectTimeout -
authenticateTimeout
private long authenticateTimeout
-
-
Constructor Details
-
AbstractSimpleClientSessionCreator
protected AbstractSimpleClientSessionCreator() -
AbstractSimpleClientSessionCreator
protected AbstractSimpleClientSessionCreator(long connTimeout, long authTimeout)
-
-
Method Details
-
getConnectTimeout
public long getConnectTimeout()- Specified by:
getConnectTimeoutin interfaceSimpleClientConfigurator- Returns:
- Current connect timeout (msec.) - always positive
-
setConnectTimeout
public void setConnectTimeout(long timeout) - Specified by:
setConnectTimeoutin interfaceSimpleClientConfigurator- Parameters:
timeout- Requested connect timeout (msec.) - always positive
-
getAuthenticationTimeout
public long getAuthenticationTimeout()- Specified by:
getAuthenticationTimeoutin interfaceSimpleClientConfigurator- Returns:
- Current authentication timeout (msec.) - always positive
-
setAuthenticationTimeout
public void setAuthenticationTimeout(long timeout) - Specified by:
setAuthenticationTimeoutin interfaceSimpleClientConfigurator- Parameters:
timeout- Requested authentication timeout (msec.) - always positive
-
sessionLogin
public ClientSession sessionLogin(SocketAddress target, String username, String password) throws IOException Description copied from interface:SimpleSessionClientCreates a session and logs in using the provided credentials- Specified by:
sessionLoginin interfaceSimpleSessionClient- Parameters:
target- The targetSocketAddressusername- Usernamepassword- Password- Returns:
- Created
ClientSession - Throws:
IOException- If failed to login or authenticate
-
sessionLogin
public ClientSession sessionLogin(SocketAddress target, String username, KeyPair identity) throws IOException Description copied from interface:SimpleSessionClientCreates a session and logs in using the provided credentials- Specified by:
sessionLoginin interfaceSimpleSessionClient- Parameters:
target- The targetSocketAddressusername- Usernameidentity- TheKeyPairidentity- Returns:
- Created
ClientSession - Throws:
IOException- If failed to login or authenticate
-
sessionLogin
Description copied from interface:SimpleSessionClientCreates a session and logs in using the provided credentials- Specified by:
sessionLoginin interfaceSimpleSessionClient- Parameters:
uri- The target uripassword- Password- Returns:
- Created
ClientSession - Throws:
IOException- If failed to login or authenticate
-
sessionLogin
Description copied from interface:SimpleSessionClientCreates a session and logs in using the provided credentials- Specified by:
sessionLoginin interfaceSimpleSessionClient- Parameters:
uri- The target uriidentity- TheKeyPairidentity- Returns:
- Created
ClientSession - Throws:
IOException- If failed to login or authenticate
-
loginSession
- Throws:
IOException
-
loginSession
- Throws:
IOException
-
authSession
- Throws:
IOException
-
authSession
- Throws:
IOException
-
authSession
- Throws:
IOException
-
wrap
Wraps an existingClientSessionCreatorinto aSimpleClient- Parameters:
creator- TheClientSessionCreator- nevernullchannel- TheChannelrepresenting the creator for relayingChannel.isOpen()andChannel.close()calls- Returns:
- The
SimpleClientwrapper. Note: closing the wrapper also closes the underlying sessions creator.
-