Class ApacheSshdSftpSessionFactory

    • Constructor Detail

      • ApacheSshdSftpSessionFactory

        public ApacheSshdSftpSessionFactory()
      • ApacheSshdSftpSessionFactory

        public ApacheSshdSftpSessionFactory​(boolean sharedSession)
    • Method Detail

      • getHost

        public String getHost()
      • setHost

        public void setHost​(String host)
        Parameters:
        host - The host to connect to - this is a mandatory property.
      • getPort

        public int getPort()
      • setPort

        public void setPort​(int port)
        The port over which the SFTP connection shall be established. If not specified, this value defaults to 22. If specified, this property must be a positive number.
        Parameters:
        port - The port value
      • setUsername

        public void setUsername​(String user)
        The remote user to use. This is a mandatory property.
        Specified by:
        setUsername in interface MutableUserHolder
        Parameters:
        user - The (never null/empty) username
      • getPrivateKeyLocation

        public org.springframework.core.io.Resource getPrivateKeyLocation()
      • setPrivateKeyLocation

        public void setPrivateKeyLocation​(org.springframework.core.io.Resource privateKey)
        Allows you to set a Resource, which represents the location of the private key used for authenticating against the remote host. If the privateKey is not provided, then the setPassword(String) call is mandatory
        Parameters:
        privateKey - The private key Resource
      • getPrivateKeyPassphrase

        public String getPrivateKeyPassphrase()
      • setPrivateKeyPassphrase

        public void setPrivateKeyPassphrase​(String privateKeyPassphrase)
        Parameters:
        privateKeyPassphrase - The password for the private key - required if the private key resource is encrypted
      • getFilePasswordProvider

        public org.apache.sshd.common.config.keys.FilePasswordProvider getFilePasswordProvider()
        Specified by:
        getFilePasswordProvider in interface org.apache.sshd.common.config.keys.FilePasswordProviderHolder
      • setFilePasswordProvider

        public void setFilePasswordProvider​(org.apache.sshd.common.config.keys.FilePasswordProvider provider)
        Specified by:
        setFilePasswordProvider in interface org.apache.sshd.common.config.keys.FilePasswordProviderManager
      • getPrivateKeyPair

        public KeyPair getPrivateKeyPair()
      • setPrivateKeyPair

        public void setPrivateKeyPair​(KeyPair privateKeyPair)
      • getSessionConfig

        public Properties getSessionConfig()
      • setSessionConfig

        public void setSessionConfig​(Properties sessionConfig)
        Parameters:
        sessionConfig - Extra Properties that can be used to set specific SSHD session properties
      • getSshClient

        public SshClient getSshClient()
      • setSshClient

        public void setSshClient​(SshClient sshClient)
      • isSharedSession

        public boolean isSharedSession()
        Specified by:
        isSharedSession in interface org.springframework.integration.file.remote.session.SharedSessionCapable
      • setSftpVersion

        public void setSftpVersion​(String version)
      • setSftpVersionSelector

        public void setSftpVersionSelector​(SftpVersionSelector selector)
      • getSharedClientSession

        protected ClientSession getSharedClientSession()
      • resetSharedSession

        public void resetSharedSession()
        Specified by:
        resetSharedSession in interface org.springframework.integration.file.remote.session.SharedSessionCapable
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        Exception
      • destroy

        public void destroy()
                     throws Exception
        Specified by:
        destroy in interface org.springframework.beans.factory.DisposableBean
        Throws:
        Exception
      • resolveFilePasswordProvider

        protected org.apache.sshd.common.config.keys.FilePasswordProvider resolveFilePasswordProvider​(ClientSession session,
                                                                                                      org.springframework.core.io.Resource keyResource,
                                                                                                      String keyPassword)
      • getSession

        public org.springframework.integration.file.remote.session.Session<SftpClient.DirEntry> getSession()
        Specified by:
        getSession in interface org.springframework.integration.file.remote.session.SessionFactory<SftpClient.DirEntry>
      • getEffectiveTimeoutValue

        protected long getEffectiveTimeoutValue​(long timeoutSeconds)