Class SftpServer

  • All Implemented Interfaces:
    com.consol.citrus.common.InitializingPhase, com.consol.citrus.common.Named, com.consol.citrus.common.ShutdownPhase, com.consol.citrus.endpoint.Endpoint, com.consol.citrus.server.Server, com.consol.citrus.spi.ReferenceResolverAware, Runnable, EventListener, org.apache.sshd.common.util.SshdEventListener, org.apache.sshd.scp.common.ScpTransferEventListener, org.apache.sshd.sftp.server.SftpEventListener

    public class SftpServer
    extends com.consol.citrus.ssh.server.SshServer
    implements org.apache.sshd.scp.common.ScpTransferEventListener, org.apache.sshd.sftp.server.SftpEventListener
    Since:
    2.7.6
    Author:
    Christoph Deppisch
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.apache.sshd.scp.common.ScpTransferEventListener

        org.apache.sshd.scp.common.ScpTransferEventListener.FileOperation
    • Field Summary

      • Fields inherited from class com.consol.citrus.server.AbstractServer

        DEFAULT_CHANNEL_ID_SUFFIX
      • Fields inherited from interface org.apache.sshd.scp.common.ScpTransferEventListener

        EMPTY
    • Constructor Summary

      Constructors 
      Constructor Description
      SftpServer()
      Default constructor using default endpoint configuration.
      SftpServer​(SftpEndpointConfiguration endpointConfiguration)
      Constructor using endpoint configuration.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void destroying​(org.apache.sshd.server.session.ServerSession session)  
      com.consol.citrus.endpoint.AbstractPollableEndpointConfiguration getEndpointConfiguration()
      Gets the endpointConfiguration.
      protected org.apache.sshd.scp.common.ScpTransferEventListener getScpTransferEventListener()  
      protected org.apache.sshd.sftp.server.SftpEventListener getSftpEventListener()  
      FtpMessage handleMessage​(FtpMessage request)  
      void initialized​(org.apache.sshd.server.session.ServerSession session, int version)  
      void reading​(org.apache.sshd.server.session.ServerSession session, String remoteHandle, org.apache.sshd.sftp.server.FileHandle localHandle, long offset, byte[] data, int dataOffset, int dataLen)  
      void setPassword​(String password)  
      void setPort​(int port)  
      void setUser​(String user)  
      void startFileEvent​(org.apache.sshd.common.session.Session session, org.apache.sshd.scp.common.ScpTransferEventListener.FileOperation op, Path file, long length, Set<PosixFilePermission> perms)  
      void startFolderEvent​(org.apache.sshd.common.session.Session session, org.apache.sshd.scp.common.ScpTransferEventListener.FileOperation op, Path file, Set<PosixFilePermission> perms)  
      void writing​(org.apache.sshd.server.session.ServerSession session, String remoteHandle, org.apache.sshd.sftp.server.FileHandle localHandle, long offset, byte[] data, int dataOffset, int dataLen)  
      • Methods inherited from class com.consol.citrus.ssh.server.SshServer

        getAllowedKeyPath, getHostKeyPath, getMessageConverter, getPassword, getPort, getUser, getUserHomePath, setAllowedKeyPath, setHostKeyPath, setMarshaller, setMessageConverter, setUserHomePath, shutdown, startup
      • Methods inherited from class com.consol.citrus.server.AbstractServer

        createConsumer, createProducer, destroy, getDefaultTimeout, getEndpointAdapter, getInterceptors, getReferenceResolver, initialize, isAutoStart, isDebugLogging, isRunning, join, run, setAutoStart, setDebugLogging, setDefaultTimeout, setEndpointAdapter, setInterceptors, setReferenceResolver, setRunning, start, stop
      • Methods inherited from class com.consol.citrus.endpoint.AbstractEndpoint

        getActor, getConsumerName, getName, getProducerName, setActor, setName
      • Methods inherited from interface com.consol.citrus.endpoint.Endpoint

        getActor, getName, setActor
      • Methods inherited from interface com.consol.citrus.common.Named

        setName
      • Methods inherited from interface org.apache.sshd.scp.common.ScpTransferEventListener

        endFileEvent, endFolderEvent, handleFileEventAckInfo
      • Methods inherited from interface org.apache.sshd.sftp.server.SftpEventListener

        blocked, blocking, closed, closing, created, creating, exiting, linked, linking, modifiedAttributes, modifyingAttributes, moved, moving, open, openFailed, opening, read, readEntries, readingEntries, received, receivedExtension, removed, removing, unblocked, unblocking, written
    • Constructor Detail

      • SftpServer

        public SftpServer()
        Default constructor using default endpoint configuration.
      • SftpServer

        public SftpServer​(SftpEndpointConfiguration endpointConfiguration)
        Constructor using endpoint configuration.
        Parameters:
        endpointConfiguration -
    • Method Detail

      • startFileEvent

        public void startFileEvent​(org.apache.sshd.common.session.Session session,
                                   org.apache.sshd.scp.common.ScpTransferEventListener.FileOperation op,
                                   Path file,
                                   long length,
                                   Set<PosixFilePermission> perms)
        Specified by:
        startFileEvent in interface org.apache.sshd.scp.common.ScpTransferEventListener
      • startFolderEvent

        public void startFolderEvent​(org.apache.sshd.common.session.Session session,
                                     org.apache.sshd.scp.common.ScpTransferEventListener.FileOperation op,
                                     Path file,
                                     Set<PosixFilePermission> perms)
        Specified by:
        startFolderEvent in interface org.apache.sshd.scp.common.ScpTransferEventListener
      • initialized

        public void initialized​(org.apache.sshd.server.session.ServerSession session,
                                int version)
        Specified by:
        initialized in interface org.apache.sshd.sftp.server.SftpEventListener
      • reading

        public void reading​(org.apache.sshd.server.session.ServerSession session,
                            String remoteHandle,
                            org.apache.sshd.sftp.server.FileHandle localHandle,
                            long offset,
                            byte[] data,
                            int dataOffset,
                            int dataLen)
        Specified by:
        reading in interface org.apache.sshd.sftp.server.SftpEventListener
      • writing

        public void writing​(org.apache.sshd.server.session.ServerSession session,
                            String remoteHandle,
                            org.apache.sshd.sftp.server.FileHandle localHandle,
                            long offset,
                            byte[] data,
                            int dataOffset,
                            int dataLen)
        Specified by:
        writing in interface org.apache.sshd.sftp.server.SftpEventListener
      • destroying

        public void destroying​(org.apache.sshd.server.session.ServerSession session)
        Specified by:
        destroying in interface org.apache.sshd.sftp.server.SftpEventListener
      • getEndpointConfiguration

        public com.consol.citrus.endpoint.AbstractPollableEndpointConfiguration getEndpointConfiguration()
        Gets the endpointConfiguration.
        Specified by:
        getEndpointConfiguration in interface com.consol.citrus.endpoint.Endpoint
        Overrides:
        getEndpointConfiguration in class com.consol.citrus.ssh.server.SshServer
        Returns:
      • getScpTransferEventListener

        protected org.apache.sshd.scp.common.ScpTransferEventListener getScpTransferEventListener()
        Overrides:
        getScpTransferEventListener in class com.consol.citrus.ssh.server.SshServer
      • getSftpEventListener

        protected org.apache.sshd.sftp.server.SftpEventListener getSftpEventListener()
        Overrides:
        getSftpEventListener in class com.consol.citrus.ssh.server.SshServer
      • setPort

        public void setPort​(int port)
        Overrides:
        setPort in class com.consol.citrus.ssh.server.SshServer
      • setUser

        public void setUser​(String user)
        Overrides:
        setUser in class com.consol.citrus.ssh.server.SshServer
      • setPassword

        public void setPassword​(String password)
        Overrides:
        setPassword in class com.consol.citrus.ssh.server.SshServer