Class SftpMessage


  • public class SftpMessage
    extends java.lang.Object
    A representation of a written SFTP message.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private IoWriteFuture future  
      private int id  
      private java.time.Duration timeout  
    • Constructor Summary

      Constructors 
      Constructor Description
      SftpMessage​(int id, IoWriteFuture future, java.time.Duration timeout)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      IoWriteFuture getFuture()
      Retrieves the IoWriteFuture of the message; can be used to wait until the message has been actually sent.
      int getId()
      Retrieves the SFTP message id.
      java.time.Duration getTimeout()
      Retrieves the write timeout configured when the message was sent.
      void waitUntilSent()
      Waits with the configured timeout until the message has been sent.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • id

        private final int id
      • timeout

        private final java.time.Duration timeout
    • Constructor Detail

      • SftpMessage

        public SftpMessage​(int id,
                           IoWriteFuture future,
                           java.time.Duration timeout)
        Creates a new instance.
        Parameters:
        id - SFTP message id
        future - IoWriteFuture of the SFTP message; can be used to wait until the message has been actually sent
        timeout - the configured SFTP write timeout
    • Method Detail

      • getId

        public int getId()
        Retrieves the SFTP message id.
        Returns:
        the SFTP message id
      • getTimeout

        public java.time.Duration getTimeout()
        Retrieves the write timeout configured when the message was sent.
        Returns:
        the timeout, never null
      • waitUntilSent

        public void waitUntilSent()
                           throws java.io.IOException
        Waits with the configured timeout until the message has been sent.
        Throws:
        java.io.IOException - if the message could not be sent, or waiting is interrupted.