Interface StreamDelivery

    • Method Detail

      • rawInputStream

        java.io.InputStream rawInputStream()
                                    throws ClientException
        Create and return an InputStream that reads the raw payload bytes of the given StreamDelivery.

        Calling this method claims the payload of the delivery for the returned InputStream and excludes use of the message() and annotations() methods of the StreamDelivery object. Closing the returned input stream discards any unread bytes from the delivery payload. Calling the message() or annotations() methods after calling this method throws ClientIllegalStateException.

        Returns:
        an InputStream instance that can be used to read the raw delivery payload.
        Throws:
        ClientException - if an error occurs while decoding the payload.
      • aborted

        boolean aborted()
        Check if the StreamDelivery has been marked as aborted by the remote sender.
        Returns:
        true if this context has been marked as aborted previously.
      • completed

        boolean completed()
        Check if the StreamDelivery has been marked as complete by the remote sender.
        Returns:
        true if this context has been marked as being the complete.
      • 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.
        Parameters:
        condition - The error condition value to supply with the rejection.
        description - The error description value to supply with the rejection.
        Returns:
        this StreamDelivery instance.
        Throws:
        ClientException - if an error occurs while sending the disposition
      • modified

        StreamDelivery modified​(boolean deliveryFailed,
                                boolean undeliverableHere)
                         throws ClientException
        Modifies 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 StreamDelivery instance.
        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.
        Parameters:
        state - the delivery state to apply
        settle - whether to settle() the delivery at the same time
        Returns:
        this StreamDelivery instance.
        Throws:
        ClientException - if an error occurs while sending the disposition
      • settled

        boolean settled()
                 throws ClientException
        Returns:
        true if the delivery has been locally settled.
        Throws:
        ClientException - if an error occurs while reading the settled state
      • remoteState

        DeliveryState remoteState()
                           throws ClientException
        Gets the current remote state for the delivery.
        Returns:
        the remote delivery state
        Throws:
        ClientException - if an error occurs while reading the remote delivery state
      • remoteSettled

        boolean remoteSettled()
                       throws ClientException
        Gets 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
      • messageFormat

        int messageFormat()
                   throws ClientException
        Gets the message format for the current delivery.
        Returns:
        the message format
        Throws:
        ClientException - if an error occurs while reading the delivery message format