Class ClientOutgoingEnvelope
- java.lang.Object
-
- org.apache.qpid.protonj2.client.impl.ClientOutgoingEnvelope
-
public class ClientOutgoingEnvelope extends java.lang.ObjectTracking object used to manage the life-cycle of a send of message payload to the remote which can be stalled either for link or session credit limits. The envelope carries sufficient information to write payload bytes as credit is available.
-
-
Constructor Summary
Constructors Constructor Description ClientOutgoingEnvelope(org.apache.qpid.protonj2.client.impl.ClientSender sender, OutgoingDelivery delivery, int messageFormat, ProtonBuffer payload, boolean complete, ClientFuture<Tracker> request)Create a new In-flight Send instance that is a continuation on an existing delivery.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClientOutgoingEnvelopeabort()booleanaborted()ClientExceptioncreateSendTimedOutException()OutgoingDeliverydelivery()ClientOutgoingEnvelopediscard()ClientOutgoingEnvelopefailed(ClientException exception)ProtonBufferpayload()org.apache.qpid.protonj2.client.impl.ClientSendersender()voidsendPayload(DeliveryState state, boolean settled)java.util.concurrent.ScheduledFuture<?>sendTimeout()voidsendTimeout(java.util.concurrent.ScheduledFuture<?> sendTimeout)Sets theScheduledFuturewhich should be used when a send cannot be immediately performed.ClientOutgoingEnvelopesucceeded()
-
-
-
Constructor Detail
-
ClientOutgoingEnvelope
public ClientOutgoingEnvelope(org.apache.qpid.protonj2.client.impl.ClientSender sender, OutgoingDelivery delivery, int messageFormat, ProtonBuffer payload, boolean complete, ClientFuture<Tracker> request)Create a new In-flight Send instance that is a continuation on an existing delivery.- Parameters:
sender- TheClientSenderinstance that is attempting to send this encoded message.messageFormat- The message format code to assign the send if this is the first delivery.delivery- TheOutgoingDeliverycontext this envelope will be added to.payload- The payload that comprises this portion of the send.complete- Indicates if the encoded payload represents the complete transfer or if more is coming.request- The requesting operation that initiated this send.
-
-
Method Detail
-
sendTimeout
public java.util.concurrent.ScheduledFuture<?> sendTimeout()
- Returns:
- the
ScheduledFutureused to determine when the send should fail if no credit available to write.
-
sendTimeout
public void sendTimeout(java.util.concurrent.ScheduledFuture<?> sendTimeout)
Sets theScheduledFuturewhich should be used when a send cannot be immediately performed.- Parameters:
sendTimeout- TheScheduledFuturethat will fail the send if not cancelled once it has been performed.
-
payload
public ProtonBuffer payload()
-
delivery
public OutgoingDelivery delivery()
-
abort
public ClientOutgoingEnvelope abort()
-
sender
public org.apache.qpid.protonj2.client.impl.ClientSender sender()
-
aborted
public boolean aborted()
-
discard
public ClientOutgoingEnvelope discard()
-
succeeded
public ClientOutgoingEnvelope succeeded()
-
failed
public ClientOutgoingEnvelope failed(ClientException exception)
-
sendPayload
public void sendPayload(DeliveryState state, boolean settled)
-
createSendTimedOutException
public ClientException createSendTimedOutException()
-
-