Class ClientOutgoingEnvelope
- java.lang.Object
-
- org.apache.qpid.protonj2.client.impl.ClientOutgoingEnvelope
-
public class ClientOutgoingEnvelope extends java.lang.Object
Tracking 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 ClientOutgoingEnvelope
abort()
boolean
aborted()
ClientException
createSendTimedOutException()
OutgoingDelivery
delivery()
ClientOutgoingEnvelope
discard()
ClientOutgoingEnvelope
failed(ClientException exception)
ProtonBuffer
payload()
org.apache.qpid.protonj2.client.impl.ClientSender
sender()
void
sendPayload(DeliveryState state, boolean settled)
java.util.concurrent.ScheduledFuture<?>
sendTimeout()
void
sendTimeout(java.util.concurrent.ScheduledFuture<?> sendTimeout)
Sets theScheduledFuture
which should be used when a send cannot be immediately performed.ClientOutgoingEnvelope
succeeded()
-
-
-
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
- TheClientSender
instance that is attempting to send this encoded message.messageFormat
- The message format code to assign the send if this is the first delivery.delivery
- TheOutgoingDelivery
context 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
ScheduledFuture
used to determine when the send should fail if no credit available to write.
-
sendTimeout
public void sendTimeout(java.util.concurrent.ScheduledFuture<?> sendTimeout)
Sets theScheduledFuture
which should be used when a send cannot be immediately performed.- Parameters:
sendTimeout
- TheScheduledFuture
that 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()
-
-