Package org.jclouds.ssh.jsch
Class SessionConnection
- java.lang.Object
-
- org.jclouds.ssh.jsch.SessionConnection
-
- All Implemented Interfaces:
JschSshClient.Connection<com.jcraft.jsch.Session>
public final class SessionConnection extends Object implements JschSshClient.Connection<com.jcraft.jsch.Session>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSessionConnection.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SessionConnection.Builderbuilder()voidclear()com.jcraft.jsch.Sessioncreate()booleanequals(Object o)intgetConnectTimeout()com.google.common.net.HostAndPortgetHostAndPort()LoginCredentialsgetLoginCredentials()com.google.common.base.Optional<com.jcraft.jsch.Proxy>getProxy()com.jcraft.jsch.SessiongetSession()intgetSessionTimeout()inthashCode()StringtoString()
-
-
-
Method Detail
-
builder
public static SessionConnection.Builder builder()
-
clear
public void clear()
- Specified by:
clearin interfaceJschSshClient.Connection<com.jcraft.jsch.Session>
-
create
public com.jcraft.jsch.Session create() throws Exception- Specified by:
createin interfaceJschSshClient.Connection<com.jcraft.jsch.Session>- Throws:
Exception
-
getHostAndPort
public com.google.common.net.HostAndPort getHostAndPort()
- Returns:
- host and port, where port if not present defaults to
22
-
getLoginCredentials
public LoginCredentials getLoginCredentials()
- Returns:
- login used in this session
-
getProxy
public com.google.common.base.Optional<com.jcraft.jsch.Proxy> getProxy()
- Returns:
- proxy used for this connection
-
getConnectTimeout
public int getConnectTimeout()
- Returns:
- how long to wait for the initial connection to be made
-
getSessionTimeout
public int getSessionTimeout()
- Returns:
- how long to keep the session open, or
0for indefinitely
-
getSession
@Nullable public com.jcraft.jsch.Session getSession()
- Returns:
- the current session or
nullif not connected
-
-