Package org.apache.sshd.sftp.client
Class SftpMessage
- java.lang.Object
-
- org.apache.sshd.sftp.client.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 theIoWriteFuture
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.
-
-
-
Field Detail
-
id
private final int id
-
future
private final IoWriteFuture future
-
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 idfuture
-IoWriteFuture
of the SFTP message; can be used to wait until the message has been actually senttimeout
- the configured SFTP write timeout
-
-
Method Detail
-
getId
public int getId()
Retrieves the SFTP message id.- Returns:
- the SFTP message id
-
getFuture
public IoWriteFuture getFuture()
Retrieves theIoWriteFuture
of the message; can be used to wait until the message has been actually sent.- Returns:
- the
IoWriteFuture
, nevernull
-
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.
-
-