Package org.apache.sshd.sftp.client
Class SftpMessage
- java.lang.Object
-
- org.apache.sshd.sftp.client.SftpMessage
-
public class SftpMessage extends java.lang.ObjectA representation of a written SFTP message.
-
-
Field Summary
Fields Modifier and Type Field Description private IoWriteFuturefutureprivate intidprivate java.time.Durationtimeout
-
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 IoWriteFuturegetFuture()Retrieves theIoWriteFutureof the message; can be used to wait until the message has been actually sent.intgetId()Retrieves the SFTP message id.java.time.DurationgetTimeout()Retrieves the write timeout configured when the message was sent.voidwaitUntilSent()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-IoWriteFutureof 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 theIoWriteFutureof 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.IOExceptionWaits 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.
-
-