Package org.apache.qpid.protonj2.client
Interface StreamDelivery
-
- All Superinterfaces:
Delivery
- All Known Implementing Classes:
ClientStreamDelivery
public interface StreamDelivery extends Delivery
A specializedDeliverytype that is returned from theStreamReceiverwhich can be used to read incoming large messages that are streamed via multiple incoming AMQPTransferframes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaborted()Check if theStreamDeliveryhas been marked as aborted by the remote sender.StreamDeliveryaccept()Accepts and settles the delivery.booleancompleted()Check if theStreamDeliveryhas been marked as complete by the remote sender.StreamDeliverydisposition(DeliveryState state, boolean settle)Updates the DeliveryState, and optionally settle the delivery as well.StreamReceiverMessagemessage()StreamDeliverymodified(boolean deliveryFailed, boolean undeliverableHere)Modifies and settles the delivery.StreamReceiverreceiver()StreamDeliveryreject(java.lang.String condition, java.lang.String description)Rejects and settles the delivery, sending supplied error information along with the rejection.StreamDeliveryrelease()Releases and settles the delivery.StreamDeliverysettle()Settles the delivery locally.-
Methods inherited from interface org.apache.qpid.protonj2.client.Delivery
annotations, messageFormat, rawInputStream, remoteSettled, remoteState, settled, state
-
-
-
-
Method Detail
-
receiver
StreamReceiver receiver()
- Specified by:
receiverin interfaceDelivery- Returns:
- the
StreamReceiverthat originated thisStreamDelivery.
-
message
StreamReceiverMessage message() throws ClientException
Decode theDeliverypayload and return anMessageobject.If the incoming message carried any delivery annotations they can be accessed via the
Delivery.annotations()method. Re-sending the returned message will not also send the incoming delivery annotations, the sender must include them in theSender.send(Message, Map)call if they are to be forwarded onto the next recipient.Calling this message claims the payload of the delivery for the returned
Messageand excludes use of theDelivery.rawInputStream()method of theDeliveryobject. Calling theDelivery.rawInputStream()method after calling this method throwsClientIllegalStateException.- Specified by:
messagein interfaceDelivery- Returns:
- a
StreamReceiverMessageinstance that can be used to read the incoming message stream. - Throws:
ClientException- if an error occurs while decoding the payload.
-
aborted
boolean aborted()
Check if theStreamDeliveryhas been marked as aborted by the remote sender.- Returns:
- true if this context has been marked as aborted previously.
-
completed
boolean completed()
Check if theStreamDeliveryhas been marked as complete by the remote sender.- Returns:
- true if this context has been marked as being the complete.
-
accept
StreamDelivery accept() throws ClientException
Accepts and settles the delivery.- Specified by:
acceptin interfaceDelivery- Returns:
- the
StreamReceiverthat originated thisStreamDelivery. - Throws:
ClientException- if an error occurs while sending the disposition
-
release
StreamDelivery release() throws ClientException
Releases and settles the delivery.- Specified by:
releasein interfaceDelivery- Returns:
- the
StreamReceiverthat originated thisStreamDelivery. - Throws:
ClientException- if an error occurs while sending the disposition
-
reject
StreamDelivery reject(java.lang.String condition, java.lang.String description) throws ClientException
Rejects and settles the delivery, sending supplied error information along with the rejection.- Specified by:
rejectin interfaceDelivery- Parameters:
condition- The error condition value to supply with the rejection.description- The error description value to supply with the rejection.- Returns:
- the
StreamReceiverthat originated thisStreamDelivery. - Throws:
ClientException- if an error occurs while sending the disposition
-
modified
StreamDelivery modified(boolean deliveryFailed, boolean undeliverableHere) throws ClientException
Modifies and settles the delivery.- Specified by:
modifiedin interfaceDelivery- Parameters:
deliveryFailed- Indicates if the modified delivery failed.undeliverableHere- Indicates if the modified delivery should not be returned here again.- Returns:
- the
StreamReceiverthat originated thisStreamDelivery. - Throws:
ClientException- if an error occurs while sending the disposition
-
disposition
StreamDelivery disposition(DeliveryState state, boolean settle) throws ClientException
Updates the DeliveryState, and optionally settle the delivery as well.- Specified by:
dispositionin interfaceDelivery- Parameters:
state- the delivery state to applysettle- whether toDelivery.settle()the delivery at the same time- Returns:
- the
StreamReceiverthat originated thisStreamDelivery. - Throws:
ClientException- if an error occurs while sending the disposition
-
settle
StreamDelivery settle() throws ClientException
Settles the delivery locally.- Specified by:
settlein interfaceDelivery- Returns:
- the
StreamReceiverthat originated thisStreamDelivery. - Throws:
ClientException- if an error occurs while sending the disposition
-
-