Class Session
- java.lang.Object
-
- com.jcraft.jsch.Session
-
public class Session extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected booleandaemon_thread
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidconnect()voidconnect(int connectTimeout)voiddelPortForwardingL(int lport)Cancels the local port forwarding assigned at local TCP portlporton loopback interface.voiddelPortForwardingL(java.lang.String bind_address, int lport)Cancels the local port forwarding assigned at local TCP portlportonbind_addressinterface.voiddelPortForwardingR(int rport)Cancels the remote port forwarding assigned at remote TCP portrport.voiddelPortForwardingR(java.lang.String bind_address, int rport)Cancels the remote port forwarding assigned at remote TCP portrportbound on the interface atbind_address.voiddisconnect()java.lang.StringgetCipherAlgorithmC2S()Returns the client to server cipher algorithm that was negotiated with the server.java.lang.StringgetCipherAlgorithmS2C()Returns the server to client cipher algorithm that was negotiated with the server.java.lang.StringgetClientVersion()java.lang.StringgetCompressionAlgorithmC2S()Returns the client to server compression algorithm that was negotiated with the server.java.lang.StringgetCompressionAlgorithmS2C()Returns the server to client compression algorithm that was negotiated with the server.java.lang.StringgetConfig(java.lang.String key)java.lang.StringgetHost()HostKeygetHostKey()java.lang.StringgetHostKeyAlias()HostKeyRepositorygetHostKeyRepository()Gets the hostkeyRepository.java.lang.StringgetKexAlgorithm()Returns the key exchange algorithm that was negotiated with the server.LoggergetLogger()Returns the logger being used by this instance of Session.java.lang.StringgetMacAlgorithmC2S()Returns the client to server MAC algorithm that was negotiated with the server.java.lang.StringgetMacAlgorithmS2C()Returns the server to client MAC algorithm that was negotiated with the server.intgetPort()java.lang.String[]getPortForwardingL()Lists the registered local port forwarding.java.lang.String[]getPortForwardingR()Lists the registered remote port forwarding.intgetServerAliveCountMax()Returns setting for the threshold to send keep-alive messages.intgetServerAliveInterval()Returns setting for the interval to send a keep-alive message.java.lang.StringgetServerHostKeyAlgorithm()Returns the server host key algorithm that was negotiated with the server.java.lang.StringgetServerVersion()ChannelgetStreamForwarder(java.lang.String host, int port)Instantiates an instance of stream-forwarder tohost:port.java.util.concurrent.ThreadFactorygetThreadFactory()Returns the thread factory used by this instance.intgetTimeout()java.lang.String[]getUnavailableSignatures()UserInfogetUserInfo()java.lang.StringgetUserName()booleanisConnected()booleanisStrictKex()Returns whether strict key exchange was negotiated with the server.voidnoMoreSessionChannels()ChannelopenChannel(java.lang.String type)voidrekey()voidsendIgnore()voidsendKeepAliveMsg()voidsetClientVersion(java.lang.String cv)voidsetConfig(java.lang.String key, java.lang.String value)voidsetConfig(java.util.Hashtable<java.lang.String,java.lang.String> newconf)voidsetConfig(java.util.Properties newconf)voidsetDaemonThread(boolean enable)voidsetHost(java.lang.String host)voidsetHostKeyAlias(java.lang.String hostKeyAlias)voidsetHostKeyRepository(HostKeyRepository hostkeyRepository)Sets the hostkeyRepository, which will be referred in checking host keys.voidsetIdentityRepository(IdentityRepository identityRepository)Sets the identityRepository, which will be referred in the public key authentication.voidsetInputStream(java.io.InputStream in)voidsetLogger(Logger logger)Sets the logger being used by this instance of SessionvoidsetOutputStream(java.io.OutputStream out)voidsetPassword(byte[] password)voidsetPassword(java.lang.String password)Deprecated.use #setPassword(byte[] password)voidsetPort(int port)intsetPortForwardingL(int lport, java.lang.String host, int rport)Registers the local port forwarding for loop-back interface.intsetPortForwardingL(java.lang.String conf)Registers the local port forwarding.intsetPortForwardingL(java.lang.String bind_address, int lport, java.lang.String host, int rport)Registers the local port forwarding.intsetPortForwardingL(java.lang.String bind_address, int lport, java.lang.String host, int rport, ServerSocketFactory ssf)Registers the local port forwarding.intsetPortForwardingL(java.lang.String bind_address, int lport, java.lang.String host, int rport, ServerSocketFactory ssf, int connectTimeout)Registers the local port forwarding.voidsetPortForwardingR(int rport, java.lang.String daemon)Registers the remote port forwarding for the loopback interface of the remote.voidsetPortForwardingR(int rport, java.lang.String host, int lport)Registers the remote port forwarding for the loopback interface of the remote.voidsetPortForwardingR(int rport, java.lang.String host, int lport, SocketFactory sf)Registers the remote port forwarding for the loopback interface of the remote.voidsetPortForwardingR(int rport, java.lang.String daemon, java.lang.Object[] arg)Registers the remote port forwarding for the loopback interface of the remote.intsetPortForwardingR(java.lang.String conf)Registers the remote port forwarding.voidsetPortForwardingR(java.lang.String bind_address, int rport, java.lang.String host, int lport)Registers the remote port forwarding.voidsetPortForwardingR(java.lang.String bind_address, int rport, java.lang.String host, int lport, SocketFactory sf)Registers the remote port forwarding.voidsetPortForwardingR(java.lang.String bind_address, int rport, java.lang.String daemon, java.lang.Object[] arg)Registers the remote port forwarding.voidsetProxy(Proxy proxy)voidsetServerAliveCountMax(int count)Sets the number of keep-alive messages which may be sent without receiving any messages back from the server.voidsetServerAliveInterval(int interval)Sets the interval to send a keep-alive message.voidsetSocketFactory(SocketFactory sfactory)intsetSocketForwardingL(java.lang.String bindAddress, int lport, java.lang.String socketPath, ServerSocketFactory ssf, int connectTimeout)voidsetThreadFactory(java.util.concurrent.ThreadFactory threadFactory)Sets a thread factory to be used for creating new threads in this instance.voidsetTimeout(int timeout)voidsetUserInfo(UserInfo userinfo)voidsetX11Cookie(java.lang.String cookie)voidsetX11Host(java.lang.String host)voidsetX11Port(int port)
-
-
-
Method Detail
-
connect
public void connect() throws JSchException- Throws:
JSchException
-
connect
public void connect(int connectTimeout) throws JSchException- Throws:
JSchException
-
getUnavailableSignatures
public java.lang.String[] getUnavailableSignatures()
-
rekey
public void rekey() throws java.lang.Exception- Throws:
java.lang.Exception
-
openChannel
public Channel openChannel(java.lang.String type) throws JSchException
- Throws:
JSchException
-
disconnect
public void disconnect()
-
setThreadFactory
public void setThreadFactory(java.util.concurrent.ThreadFactory threadFactory)
Sets a thread factory to be used for creating new threads in this instance.- Parameters:
threadFactory- The thread factory to be used; must not benull- Throws:
java.lang.NullPointerException- if the provided thread factory isnull
-
getThreadFactory
public java.util.concurrent.ThreadFactory getThreadFactory()
Returns the thread factory used by this instance.- Returns:
- The thread factory associated with this instance. If no specific thread factory has been set, a default thread factory is returned.
-
setPortForwardingL
public int setPortForwardingL(int lport, java.lang.String host, int rport) throws JSchExceptionRegisters the local port forwarding for loop-back interface. Iflportis0, the tcp port will be allocated.- Parameters:
lport- local port for local port forwardinghost- host address for local port forwardingrport- remote port number for local port forwarding- Returns:
- an allocated local TCP port number
- Throws:
JSchException- See Also:
setPortForwardingL(String bind_address, int lport, String host, int rport, ServerSocketFactory ssf, int connectTimeout)
-
setPortForwardingL
public int setPortForwardingL(java.lang.String bind_address, int lport, java.lang.String host, int rport) throws JSchExceptionRegisters the local port forwarding. Ifbind_addressis an empty string or '*', the port should be available from all interfaces. Ifbind_addressis"localhost"ornull, the listening port will be bound for local use only. Iflportis0, the tcp port will be allocated.- Parameters:
bind_address- bind address for local port forwardinglport- local port for local port forwardinghost- host address for local port forwardingrport- remote port number for local port forwarding- Returns:
- an allocated local TCP port number
- Throws:
JSchException- See Also:
setPortForwardingL(String bind_address, int lport, String host, int rport, ServerSocketFactory ssf, int connectTimeout)
-
setPortForwardingL
public int setPortForwardingL(java.lang.String bind_address, int lport, java.lang.String host, int rport, ServerSocketFactory ssf) throws JSchExceptionRegisters the local port forwarding. Ifbind_addressis an empty string or"*", the port should be available from all interfaces. Ifbind_addressis"localhost"ornull, the listening port will be bound for local use only. Iflportis0, the tcp port will be allocated.- Parameters:
bind_address- bind address for local port forwardinglport- local port for local port forwardinghost- host address for local port forwardingrport- remote port number for local port forwardingssf- socket factory- Returns:
- an allocated local TCP port number
- Throws:
JSchException- See Also:
setPortForwardingL(String bind_address, int lport, String host, int rport, ServerSocketFactory ssf, int connectTimeout)
-
setPortForwardingL
public int setPortForwardingL(java.lang.String bind_address, int lport, java.lang.String host, int rport, ServerSocketFactory ssf, int connectTimeout) throws JSchExceptionRegisters the local port forwarding. Ifbind_addressis an empty string or"*", the port should be available from all interfaces. Ifbind_addressis"localhost"ornull, the listening port will be bound for local use only. Iflportis0, the tcp port will be allocated.- Parameters:
bind_address- bind address for local port forwardinglport- local port for local port forwardinghost- host address for local port forwardingrport- remote port number for local port forwardingssf- socket factoryconnectTimeout- timeout for establishing port connection- Returns:
- an allocated local TCP port number
- Throws:
JSchException
-
setSocketForwardingL
public int setSocketForwardingL(java.lang.String bindAddress, int lport, java.lang.String socketPath, ServerSocketFactory ssf, int connectTimeout) throws JSchException- Throws:
JSchException
-
delPortForwardingL
public void delPortForwardingL(int lport) throws JSchExceptionCancels the local port forwarding assigned at local TCP portlporton loopback interface.- Parameters:
lport- local TCP port- Throws:
JSchException
-
delPortForwardingL
public void delPortForwardingL(java.lang.String bind_address, int lport) throws JSchExceptionCancels the local port forwarding assigned at local TCP portlportonbind_addressinterface.- Parameters:
bind_address- bind_address of network interfaceslport- local TCP port- Throws:
JSchException
-
getPortForwardingL
public java.lang.String[] getPortForwardingL() throws JSchExceptionLists the registered local port forwarding.- Returns:
- a list of "lport:host:hostport"
- Throws:
JSchException
-
setPortForwardingR
public void setPortForwardingR(int rport, java.lang.String host, int lport) throws JSchExceptionRegisters the remote port forwarding for the loopback interface of the remote.- Parameters:
rport- remote porthost- host addresslport- local port- Throws:
JSchException- See Also:
setPortForwardingR(String bind_address, int rport, String host, int lport, SocketFactory sf)
-
setPortForwardingR
public void setPortForwardingR(java.lang.String bind_address, int rport, java.lang.String host, int lport) throws JSchExceptionRegisters the remote port forwarding. Ifbind_addressis an empty string or"*", the port should be available from all interfaces. Ifbind_addressis"localhost"or is not given, the listening port will be bound for local use only. Note that ifGatewayPortsis"no"on the remote,"localhost"is always used as a bind_address.- Parameters:
bind_address- bind addressrport- remote porthost- host addresslport- local port- Throws:
JSchException- See Also:
setPortForwardingR(String bind_address, int rport, String host, int lport, SocketFactory sf)
-
setPortForwardingR
public void setPortForwardingR(int rport, java.lang.String host, int lport, SocketFactory sf) throws JSchExceptionRegisters the remote port forwarding for the loopback interface of the remote.- Parameters:
rport- remote porthost- host addresslport- local portsf- socket factory- Throws:
JSchException- See Also:
setPortForwardingR(String bind_address, int rport, String host, int lport, SocketFactory sf)
-
setPortForwardingR
public void setPortForwardingR(java.lang.String bind_address, int rport, java.lang.String host, int lport, SocketFactory sf) throws JSchExceptionRegisters the remote port forwarding. Ifbind_addressis an empty string or"*", the port should be available from all interfaces. Ifbind_addressis"localhost"or is not given, the listening port will be bound for local use only. Note that ifGatewayPortsis"no"on the remote,"localhost"is always used as a bind_address. Ifrportis0, the TCP port will be allocated on the remote.- Parameters:
bind_address- bind addressrport- remote porthost- host addresslport- local portsf- socket factory- Throws:
JSchException
-
setPortForwardingR
public void setPortForwardingR(int rport, java.lang.String daemon) throws JSchExceptionRegisters the remote port forwarding for the loopback interface of the remote. The TCP connection torporton the remote will be forwarded to an instance of the classdaemon. The class specified bydaemonmust implementForwardedTCPIPDaemon.- Parameters:
rport- remote portdaemon- class name, which implements "ForwardedTCPIPDaemon"- Throws:
JSchException- See Also:
setPortForwardingR(String bind_address, int rport, String daemon, Object[] arg)
-
setPortForwardingR
public void setPortForwardingR(int rport, java.lang.String daemon, java.lang.Object[] arg) throws JSchExceptionRegisters the remote port forwarding for the loopback interface of the remote. The TCP connection torporton the remote will be forwarded to an instance of the classdaemonwith the argumentarg. The class specified bydaemonmust implementForwardedTCPIPDaemon.- Parameters:
rport- remote portdaemon- class name, which implements "ForwardedTCPIPDaemon"arg- arguments for "daemon"- Throws:
JSchException- See Also:
setPortForwardingR(String bind_address, int rport, String daemon, Object[] arg)
-
setPortForwardingR
public void setPortForwardingR(java.lang.String bind_address, int rport, java.lang.String daemon, java.lang.Object[] arg) throws JSchExceptionRegisters the remote port forwarding. Ifbind_addressis an empty string or"*", the port should be available from all interfaces. Ifbind_addressis"localhost"or is not given, the listening port will be bound for local use only. Note that ifGatewayPortsis"no"on the remote,"localhost"is always used as a bind_address. The TCP connection torporton the remote will be forwarded to an instance of the classdaemonwith the argumentarg. The class specified bydaemonmust implementForwardedTCPIPDaemon.- Parameters:
bind_address- bind addressrport- remote portdaemon- class name, which implements "ForwardedTCPIPDaemon"arg- arguments for "daemon"- Throws:
JSchException- See Also:
setPortForwardingR(String bind_address, int rport, String daemon, Object[] arg)
-
getPortForwardingR
public java.lang.String[] getPortForwardingR() throws JSchExceptionLists the registered remote port forwarding.- Returns:
- a list of "rport:host:hostport"
- Throws:
JSchException
-
setPortForwardingL
public int setPortForwardingL(java.lang.String conf) throws JSchExceptionRegisters the local port forwarding. The argument should be in the format like "[bind_address:]port:host:hostport". Ifbind_addressis an empty string or"*", the port should be available from all interfaces. Ifbind_addressis"localhost"or is not given, the listening port will be bound for local use only.- Parameters:
conf- configuration of local port forwarding- Returns:
- an assigned port number
- Throws:
JSchException- See Also:
setPortForwardingL(String bind_address, int lport, String host, int rport)
-
setPortForwardingR
public int setPortForwardingR(java.lang.String conf) throws JSchExceptionRegisters the remote port forwarding. The argument should be in the format like "[bind_address:]port:host:hostport". If the bind_address is not given, the default is to only bind to loopback addresses. If the bind_address is"*"or an empty string, then the forwarding is requested to listen on all interfaces. Note that ifGatewayPortsis"no"on the remote,"localhost"is always used for bind_address. If the specified remote is"0", the TCP port will be allocated on the remote.- Parameters:
conf- configuration of remote port forwarding- Returns:
- an allocated TCP port on the remote.
- Throws:
JSchException- See Also:
setPortForwardingR(String bind_address, int rport, String host, int rport)
-
getStreamForwarder
public Channel getStreamForwarder(java.lang.String host, int port) throws JSchException
Instantiates an instance of stream-forwarder tohost:port. Set I/O stream to the given channel, and then invoke Channel#connect() method.- Parameters:
host- remote host, which the given stream will be plugged to.port- remote port, which the given stream will be plugged to.- Throws:
JSchException
-
delPortForwardingR
public void delPortForwardingR(int rport) throws JSchExceptionCancels the remote port forwarding assigned at remote TCP portrport.- Parameters:
rport- remote TCP port- Throws:
JSchException
-
delPortForwardingR
public void delPortForwardingR(java.lang.String bind_address, int rport) throws JSchExceptionCancels the remote port forwarding assigned at remote TCP portrportbound on the interface atbind_address.- Parameters:
bind_address- bind address of the interface on the remoterport- remote TCP port- Throws:
JSchException
-
setProxy
public void setProxy(Proxy proxy)
-
setHost
public void setHost(java.lang.String host)
-
setPort
public void setPort(int port)
-
setUserInfo
public void setUserInfo(UserInfo userinfo)
-
getUserInfo
public UserInfo getUserInfo()
-
setInputStream
public void setInputStream(java.io.InputStream in)
-
setOutputStream
public void setOutputStream(java.io.OutputStream out)
-
setX11Host
public void setX11Host(java.lang.String host)
-
setX11Port
public void setX11Port(int port)
-
setX11Cookie
public void setX11Cookie(java.lang.String cookie)
-
setPassword
@Deprecated public void setPassword(java.lang.String password)
Deprecated.use #setPassword(byte[] password)
-
setPassword
public void setPassword(byte[] password)
-
setConfig
public void setConfig(java.util.Properties newconf)
-
setConfig
public void setConfig(java.util.Hashtable<java.lang.String,java.lang.String> newconf)
-
setConfig
public void setConfig(java.lang.String key, java.lang.String value)
-
getConfig
public java.lang.String getConfig(java.lang.String key)
-
setSocketFactory
public void setSocketFactory(SocketFactory sfactory)
-
isConnected
public boolean isConnected()
-
getTimeout
public int getTimeout()
-
setTimeout
public void setTimeout(int timeout) throws JSchException- Throws:
JSchException
-
getServerVersion
public java.lang.String getServerVersion()
-
getClientVersion
public java.lang.String getClientVersion()
-
setClientVersion
public void setClientVersion(java.lang.String cv)
-
getKexAlgorithm
public java.lang.String getKexAlgorithm()
Returns the key exchange algorithm that was negotiated with the server.The value reflects the most recently completed key exchange: it is updated when the newly negotiated algorithms are put into use, so while a rekey is in progress it still reports the algorithms currently in effect.
- Returns:
- the negotiated key exchange algorithm, or
nullif no key exchange has completed yet
-
getServerHostKeyAlgorithm
public java.lang.String getServerHostKeyAlgorithm()
Returns the server host key algorithm that was negotiated with the server.The value reflects the most recently completed key exchange: it is updated when the newly negotiated algorithms are put into use, so while a rekey is in progress it still reports the algorithms currently in effect.
- Returns:
- the negotiated server host key algorithm, or
nullif no key exchange has completed yet
-
getCipherAlgorithmC2S
public java.lang.String getCipherAlgorithmC2S()
Returns the client to server cipher algorithm that was negotiated with the server.The value reflects the most recently completed key exchange: it is updated when the newly negotiated algorithms are put into use, so while a rekey is in progress it still reports the algorithms currently in effect.
- Returns:
- the negotiated client to server cipher algorithm, or
nullif no key exchange has completed yet
-
getCipherAlgorithmS2C
public java.lang.String getCipherAlgorithmS2C()
Returns the server to client cipher algorithm that was negotiated with the server.The value reflects the most recently completed key exchange: it is updated when the newly negotiated algorithms are put into use, so while a rekey is in progress it still reports the algorithms currently in effect.
- Returns:
- the negotiated server to client cipher algorithm, or
nullif no key exchange has completed yet
-
getMacAlgorithmC2S
public java.lang.String getMacAlgorithmC2S()
Returns the client to server MAC algorithm that was negotiated with the server.The value reflects the most recently completed key exchange: it is updated when the newly negotiated algorithms are put into use, so while a rekey is in progress it still reports the algorithms currently in effect.
- Returns:
- the negotiated client to server MAC algorithm, or
nullif no key exchange has completed yet or if the negotiated client to server cipher is an AEAD cipher, in which case no separate MAC algorithm is negotiated
-
getMacAlgorithmS2C
public java.lang.String getMacAlgorithmS2C()
Returns the server to client MAC algorithm that was negotiated with the server.The value reflects the most recently completed key exchange: it is updated when the newly negotiated algorithms are put into use, so while a rekey is in progress it still reports the algorithms currently in effect.
- Returns:
- the negotiated server to client MAC algorithm, or
nullif no key exchange has completed yet or if the negotiated server to client cipher is an AEAD cipher, in which case no separate MAC algorithm is negotiated
-
getCompressionAlgorithmC2S
public java.lang.String getCompressionAlgorithmC2S()
Returns the client to server compression algorithm that was negotiated with the server.The value reflects the most recently completed key exchange: it is updated when the newly negotiated algorithms are put into use, so while a rekey is in progress it still reports the algorithms currently in effect.
- Returns:
- the negotiated client to server compression algorithm, or
nullif no key exchange has completed yet
-
getCompressionAlgorithmS2C
public java.lang.String getCompressionAlgorithmS2C()
Returns the server to client compression algorithm that was negotiated with the server.The value reflects the most recently completed key exchange: it is updated when the newly negotiated algorithms are put into use, so while a rekey is in progress it still reports the algorithms currently in effect.
- Returns:
- the negotiated server to client compression algorithm, or
nullif no key exchange has completed yet
-
isStrictKex
public boolean isStrictKex()
Returns whether strict key exchange was negotiated with the server.Strict key exchange is only negotiated during the initial key exchange, so unlike the negotiated algorithms this value does not change when the session is rekeyed. It returns
falseagain once the session is disconnected.- Returns:
trueif strict key exchange, the countermeasure against CVE-2023-48795, was negotiated, orfalseif the initial key exchange has not started yet, if the server did not support it, or if it was turned off with theenable_strict_kexconfiguration
-
sendIgnore
public void sendIgnore() throws java.lang.Exception- Throws:
java.lang.Exception
-
sendKeepAliveMsg
public void sendKeepAliveMsg() throws java.lang.Exception- Throws:
java.lang.Exception
-
noMoreSessionChannels
public void noMoreSessionChannels() throws java.lang.Exception- Throws:
java.lang.Exception
-
getHostKey
public HostKey getHostKey()
-
getHost
public java.lang.String getHost()
-
getUserName
public java.lang.String getUserName()
-
getPort
public int getPort()
-
setHostKeyAlias
public void setHostKeyAlias(java.lang.String hostKeyAlias)
-
getHostKeyAlias
public java.lang.String getHostKeyAlias()
-
setServerAliveInterval
public void setServerAliveInterval(int interval) throws JSchExceptionSets the interval to send a keep-alive message. If zero is specified, any keep-alive message must not be sent. The default interval is zero.- Parameters:
interval- the specified interval, in milliseconds.- Throws:
JSchException- See Also:
getServerAliveInterval()
-
getServerAliveInterval
public int getServerAliveInterval()
Returns setting for the interval to send a keep-alive message.- See Also:
setServerAliveInterval(int)
-
setServerAliveCountMax
public void setServerAliveCountMax(int count)
Sets the number of keep-alive messages which may be sent without receiving any messages back from the server. If this threshold is reached while keep-alive messages are being sent, the connection will be disconnected. The default value is one.- Parameters:
count- the specified count- See Also:
getServerAliveCountMax()
-
getServerAliveCountMax
public int getServerAliveCountMax()
Returns setting for the threshold to send keep-alive messages.- See Also:
setServerAliveCountMax(int)
-
setDaemonThread
public void setDaemonThread(boolean enable)
-
setIdentityRepository
public void setIdentityRepository(IdentityRepository identityRepository)
Sets the identityRepository, which will be referred in the public key authentication. The default value isnull.- Parameters:
identityRepository-- See Also:
getIdentityRepository()
-
setHostKeyRepository
public void setHostKeyRepository(HostKeyRepository hostkeyRepository)
Sets the hostkeyRepository, which will be referred in checking host keys.- Parameters:
hostkeyRepository-- See Also:
getHostKeyRepository()
-
getHostKeyRepository
public HostKeyRepository getHostKeyRepository()
Gets the hostkeyRepository. If this.hostkeyRepository isnull, JSch#getHostKeyRepository() will be invoked.- See Also:
JSch.getHostKeyRepository()
-
getLogger
public Logger getLogger()
Returns the logger being used by this instance of Session. If no particular logger has been set, the instance logger of the jsch instance is returned this session belongs to.- Returns:
- The logger
-
setLogger
public void setLogger(Logger logger)
Sets the logger being used by this instance of Session- Parameters:
logger- The logger ornullif the instance logger of this instance's jsch instance should be used
-
-