Package adams.scripting.connection
Class AbstractSSHConnectionWithPortForwarding
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.scripting.connection.AbstractConnection
-
- adams.scripting.connection.AbstractSSHConnection
-
- adams.scripting.connection.AbstractSSHConnectionWithPortForwarding
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,SSHSessionProvider
,OptionHandler
,PasswordSupporter
,QuickInfoSupporter
,SizeOfHandler
,Connection
,Serializable
,Comparable<Connection>
- Direct Known Subclasses:
SSHConnection
public abstract class AbstractSSHConnectionWithPortForwarding extends AbstractSSHConnection
Ancestor of connection schemes that use an SSH tunnel to connect to the remote scripting engine.
Inspired by: www.beanizer.org- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class adams.scripting.connection.AbstractSSHConnection
AbstractSSHConnection.TrustAll
-
-
Field Summary
Fields Modifier and Type Field Description protected int
m_AssignedPort
the assigned port.protected int
m_LocalPort
the local port for the SSH tunnel.protected int
m_ScriptingPort
the remote port for the scripting engine.-
Fields inherited from class adams.scripting.connection.AbstractSSHConnection
m_AuthenticationType, m_Host, m_KnownHosts, m_Password, m_Port, m_PrivateKeyFile, m_PrivateKeyPassphrase, m_Session, m_StrictHostKeyChecking, m_User
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractSSHConnectionWithPortForwarding()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanUp()
Cleans up data structures, frees up memory.void
defineOptions()
Adds options to the internal list of options.int
getLocalPort()
Returns the local port to connect to (SSH tunnel).int
getScriptingPort()
Returns the port of the remote scripting engine to connect to.String
localPortTipText()
Returns the tip text for this property.com.jcraft.jsch.Session
newSession(String host, int port)
Returns a new session, connects and configures the tunnel.String
scriptingPortTipText()
Returns the tip text for this property.void
setLocalPort(int value)
Sets the local port to connect to (SSH tunnel).void
setScriptingPort(int value)
Sets the port of the remote scripting engine to connect to.-
Methods inherited from class adams.scripting.connection.AbstractSSHConnection
authenticationTypeTipText, createSession, doSend, doSendRequest, doSendResponse, getAuthenticationType, getHost, getKnownHosts, getPassword, getPort, getPrivateKeyFile, getPrivateKeyPassphrase, getQuickInfo, getSession, getStrictHostKeyChecking, getUser, hostTipText, knownHostsTipText, newSession, passwordTipText, portTipText, privateKeyFileTipText, privateKeyPassphraseTipText, reset, send, setAuthenticationType, setHost, setKnownHosts, setPassword, setPort, setPrivateKeyFile, setPrivateKeyPassphrase, setStrictHostKeyChecking, setUser, strictHostKeyCheckingTipText, userTipText
-
Methods inherited from class adams.scripting.connection.AbstractConnection
checkRequest, checkResponse, compareTo, equals, sendRequest, sendResponse, toString
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractSSHConnection
-
setLocalPort
public void setLocalPort(int value)
Sets the local port to connect to (SSH tunnel).- Parameters:
value
- the port, -1 for automatically getting next available one
-
getLocalPort
public int getLocalPort()
Returns the local port to connect to (SSH tunnel).- Returns:
- the port
-
localPortTipText
public String localPortTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setScriptingPort
public void setScriptingPort(int value)
Sets the port of the remote scripting engine to connect to.- Parameters:
value
- the port
-
getScriptingPort
public int getScriptingPort()
Returns the port of the remote scripting engine to connect to.- Returns:
- the port
-
scriptingPortTipText
public String scriptingPortTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
newSession
public com.jcraft.jsch.Session newSession(String host, int port)
Returns a new session, connects and configures the tunnel.- Specified by:
newSession
in interfaceSSHSessionProvider
- Overrides:
newSession
in classAbstractSSHConnection
- Parameters:
host
- the host to useport
- the port to use- Returns:
- the session
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUp
in interfaceCleanUpHandler
- Overrides:
cleanUp
in classAbstractSSHConnection
-
-