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 class
SessionConnection.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SessionConnection.Builder
builder()
void
clear()
com.jcraft.jsch.Session
create()
boolean
equals(Object o)
int
getConnectTimeout()
com.google.common.net.HostAndPort
getHostAndPort()
LoginCredentials
getLoginCredentials()
com.google.common.base.Optional<com.jcraft.jsch.Proxy>
getProxy()
com.jcraft.jsch.Session
getSession()
int
getSessionTimeout()
int
hashCode()
String
toString()
-
-
-
Method Detail
-
builder
public static SessionConnection.Builder builder()
-
clear
public void clear()
- Specified by:
clear
in interfaceJschSshClient.Connection<com.jcraft.jsch.Session>
-
create
public com.jcraft.jsch.Session create() throws Exception
- Specified by:
create
in 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
0
for indefinitely
-
getSession
@Nullable public com.jcraft.jsch.Session getSession()
- Returns:
- the current session or
null
if not connected
-
-