Class ClientDelivery
- java.lang.Object
- 
- org.apache.qpid.protonj2.client.impl.ClientDeliverable<ClientDelivery,ClientReceiver>
- 
- org.apache.qpid.protonj2.client.impl.ClientDelivery
 
 
- 
- All Implemented Interfaces:
- Delivery
 
 public final class ClientDelivery extends ClientDeliverable<ClientDelivery,ClientReceiver> implements Delivery Client inbound delivery object.
- 
- 
Field Summary- 
Fields inherited from class org.apache.qpid.protonj2.client.impl.ClientDeliverabledelivery, receiver
 
- 
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>annotations()Decodes theDeliverypayload and returns aMapcontaining a copy of any associatedDeliveryAnnotationsthat were transmitted with theMessagepayload of thisDelivery.<E> Message<E>message()InputStreamrawInputStream()Create and return anInputStreamthat reads the raw payload bytes of the givenDelivery.Receiverreceiver()protected ClientDeliveryself()- 
Methods inherited from class org.apache.qpid.protonj2.client.impl.ClientDeliverableaccept, disposition, messageFormat, modified, reject, release, remoteSettled, remoteState, settle, settled, state
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.qpid.protonj2.client.Deliveryaccept, disposition, messageFormat, modified, reject, release, remoteSettled, remoteState, settle, settled, state
 
- 
 
- 
- 
- 
Method Detail- 
selfprotected ClientDelivery self() - Specified by:
- selfin class- ClientDeliverable<ClientDelivery,ClientReceiver>
 
 - 
receiverpublic Receiver receiver() 
 - 
messagepublic <E> Message<E> message() throws ClientException Description copied from interface:DeliveryDecode 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.Care should be taken if attempting to specify anything other than the wild card type for the body of the returned message as the wrong type specification can lead to an exception. - Specified by:
- messagein interface- Delivery
- Type Parameters:
- E- The type of message body that should be contained in the returned- Message.
- Returns:
- a Messageinstance that wraps the decoded payload.
- Throws:
- ClientException- if an error occurs while decoding the payload.
 
 - 
rawInputStreampublic InputStream rawInputStream() throws ClientException Description copied from interface:DeliveryCreate and return anInputStreamthat reads the raw payload bytes of the givenDelivery.Calling this method claims the payload of the delivery for the returned InputStreamand excludes use of theDelivery.message()andDelivery.annotations()methods of theDeliveryobject. Closing the returned input stream discards any unread bytes from the delivery payload. Calling theDelivery.message()orDelivery.annotations()methods after calling this method throwsClientIllegalStateException.- Specified by:
- rawInputStreamin interface- Delivery
- Returns:
- an InputStreaminstance that can be used to read the raw delivery payload.
- Throws:
- ClientException- if an error occurs while decoding the payload.
 
 - 
annotationspublic Map<String,Object> annotations() throws ClientException Description copied from interface:DeliveryDecodes theDeliverypayload and returns aMapcontaining a copy of any associatedDeliveryAnnotationsthat were transmitted with theMessagepayload of thisDelivery.Calling this message claims the payload of the delivery for the returned Mapand the decodedMessagethat can be accessed via theDelivery.message()method and excludes use of theDelivery.rawInputStream()method of theDeliveryobject. Calling theDelivery.rawInputStream()method after calling this method throwsClientIllegalStateException.- Specified by:
- annotationsin interface- Delivery
- Returns:
- copy of the delivery annotations that were transmitted with the Messagepayload.
- Throws:
- ClientException- if an error occurs while decoding the payload.
 
 
- 
 
-