public class SshTunnel
extends Object
Modifier and Type | Field and Description |
---|---|
static String |
SSH_HOST_PROP |
static String |
SSH_LOCAL_HOST_PROP |
static String |
SSH_PASSPHRASE_PROP |
static String |
SSH_PASSWORD_PROP |
static String |
SSH_PORT_PROP |
static String |
SSH_PRIVATE_KEY_PROP |
static String |
SSH_USER_NAME_PROP |
Constructor and Description |
---|
SshTunnel(Alias alias,
Properties props)
Instantiates a new ssh tunnel.
|
SshTunnel(String url,
Properties props,
UrlParser parser)
Instantiates a new ssh tunnel.
|
Modifier and Type | Method and Description |
---|---|
void |
disconnect()
Disconnect.
|
String |
getHost()
Gets the host.
|
Integer |
getPort()
Gets the port.
|
com.jcraft.jsch.Session |
getSession()
Gets the session.
|
String |
getUrl()
Gets the new JDBC URL.
|
void |
init(String theUrl,
Properties props,
UrlParser parser)
Initialize the tunnel.
|
boolean |
isConnected()
Checks if session is connected.
|
boolean |
isSsh()
Checks if ssh tunnel should be used.
|
public static final String SSH_HOST_PROP
public static final String SSH_PORT_PROP
public static final String SSH_USER_NAME_PROP
public static final String SSH_PASSWORD_PROP
public static final String SSH_PRIVATE_KEY_PROP
public static final String SSH_PASSPHRASE_PROP
public static final String SSH_LOCAL_HOST_PROP
public SshTunnel(Alias alias, Properties props) throws Exception
alias
- the aliasprops
- the propertiesException
- in case of any errorpublic SshTunnel(String url, Properties props, UrlParser parser) throws Exception
url
- the urluser
- the userpassword
- the passwordprops
- the propsparser
- the url parserException
- the exceptionpublic void init(String theUrl, Properties props, UrlParser parser) throws Exception
url
- the urlprops
- the propertiesparser
- the url parserException
- in case of any errorpublic void disconnect()
public String getHost()
public Integer getPort()
public String getUrl()
public boolean isSsh()
public com.jcraft.jsch.Session getSession()
public boolean isConnected()
Copyright © 2010-2020 Toolsverse. All Rights Reserved.