Interface StreamDelivery
- All Known Implementing Classes:
- ClientStreamDelivery
StreamDelivery type that is returned from the StreamReceiver
 which can be used to read incoming large messages that are streamed via multiple incoming
 AMQP Transfer frames.- 
Method SummaryModifier and TypeMethodDescriptionbooleanaborted()Check if theStreamDeliveryhas been marked as aborted by the remote sender.accept()Accepts and settles the delivery.Decodes theStreamDeliverypayload and returns aMapcontaining a copy of any associatedDeliveryAnnotationsthat were transmitted with theMessagepayload of thisStreamDelivery.booleanCheck if theStreamDeliveryhas been marked as complete by the remote sender.disposition(DeliveryState state, boolean settle) Updates the DeliveryState, and optionally settle the delivery as well.message()Decode theStreamDeliverypayload and return anMessageobject.intGets the message format for the current delivery.modified(boolean deliveryFailed, boolean undeliverableHere) Modifies and settles the delivery.Create and return anInputStreamthat reads the raw payload bytes of the givenStreamDelivery.receiver()Rejects and settles the delivery, sending supplied error information along with the rejection.release()Releases and settles the delivery.booleanGets whether the delivery was settled by the remote peer yet.Gets the current remote state for the delivery.settle()Settles the delivery locally.booleansettled()state()Gets the current local state for the delivery.
- 
Method Details- 
receiverStreamReceiver receiver()- Returns:
- the StreamReceiverthat originated thisStreamDelivery.
 
- 
messageDecode theStreamDeliverypayload and return anMessageobject.If the incoming message carried any delivery annotations they can be accessed via the 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 therawInputStream()method of theStreamDeliveryobject. Calling therawInputStream()method after calling this method throwsClientIllegalStateException.- Returns:
- a Messageinstance that wraps the decoded payload.
- Throws:
- ClientException- if an error occurs while decoding the payload.
 
- 
rawInputStreamCreate and return anInputStreamthat reads the raw payload bytes of the givenStreamDelivery.Calling this method claims the payload of the delivery for the returned InputStreamand excludes use of themessage()andannotations()methods of theStreamDeliveryobject. Closing the returned input stream discards any unread bytes from the delivery payload. Calling themessage()orannotations()methods after calling this method throwsClientIllegalStateException.- Returns:
- an InputStreaminstance that can be used to read the raw delivery payload.
- Throws:
- ClientException- if an error occurs while decoding the payload.
 
- 
abortedboolean aborted()Check if theStreamDeliveryhas been marked as aborted by the remote sender.- Returns:
- true if this context has been marked as aborted previously.
 
- 
completedboolean completed()Check if theStreamDeliveryhas been marked as complete by the remote sender.- Returns:
- true if this context has been marked as being the complete.
 
- 
annotationsDecodes theStreamDeliverypayload and returns aMapcontaining a copy of any associatedDeliveryAnnotationsthat were transmitted with theMessagepayload of thisStreamDelivery.Calling this message claims the payload of the delivery for the returned Mapand the decodedMessagethat can be accessed via themessage()method and excludes use of therawInputStream()method of theStreamDeliveryobject. Calling therawInputStream()method after calling this method throwsClientIllegalStateException.- Returns:
- copy of the delivery annotations that were transmitted with the Messagepayload.
- Throws:
- ClientException- if an error occurs while decoding the payload.
 
- 
acceptAccepts and settles the delivery.- Returns:
- this StreamDeliveryinstance.
- Throws:
- ClientException- if an error occurs while sending the disposition
 
- 
releaseReleases and settles the delivery.- Returns:
- this StreamDeliveryinstance.
- Throws:
- ClientException- if an error occurs while sending the disposition
 
- 
rejectRejects and settles the delivery, sending supplied error information along with the rejection.- Parameters:
- condition- The error condition value to supply with the rejection.
- description- The error description value to supply with the rejection.
- Returns:
- this StreamDeliveryinstance.
- Throws:
- ClientException- if an error occurs while sending the disposition
 
- 
modifiedModifies and settles the delivery.- Parameters:
- deliveryFailed- Indicates if the modified delivery failed.
- undeliverableHere- Indicates if the modified delivery should not be returned here again.
- Returns:
- this StreamDeliveryinstance.
- Throws:
- ClientException- if an error occurs while sending the disposition
 
- 
dispositionUpdates the DeliveryState, and optionally settle the delivery as well.- Parameters:
- state- the delivery state to apply
- settle- whether to- settle()the delivery at the same time
- Returns:
- this StreamDeliveryinstance.
- Throws:
- ClientException- if an error occurs while sending the disposition
 
- 
settleSettles the delivery locally.- Returns:
- the delivery
- Throws:
- ClientException- if an error occurs while sending the disposition
 
- 
settled- Returns:
- true if the delivery has been locally settled.
- Throws:
- ClientException- if an error occurs while reading the settled state
 
- 
stateGets the current local state for the delivery.- Returns:
- the delivery state
- Throws:
- ClientException- if an error occurs while reading the delivery state
 
- 
remoteStateGets the current remote state for the delivery.- Returns:
- the remote delivery state
- Throws:
- ClientException- if an error occurs while reading the remote delivery state
 
- 
remoteSettledGets whether the delivery was settled by the remote peer yet.- Returns:
- whether the delivery is remotely settled
- Throws:
- ClientException- if an error occurs while reading the remote settlement state
 
- 
messageFormatGets the message format for the current delivery.- Returns:
- the message format
- Throws:
- ClientException- if an error occurs while reading the delivery message format
 
 
-