Interface DeliveryState

All Known Subinterfaces:
Accepted, Modified, Rejected, Released, Transactional
All Known Implementing Classes:
ClientDeliveryState, ClientDeliveryState.ClientAccepted, ClientDeliveryState.ClientModified, ClientDeliveryState.ClientRejected, ClientDeliveryState.ClientReleased, ClientDeliveryState.ClientTransactional

public interface DeliveryState
Conveys the outcome of a Delivery either incoming or outgoing.

DeliveryState instance have a type (e.g. Accepted, Rejected ...) and can in case of a transactional delivery state, carry an outcome and in those cases the is outcome APIs return the value of the nested outcome carried in the transactional state.

  • Method Details

    • getType

      Returns:
      the type that the given DeliveryState represents.
    • isAccepted

      default boolean isAccepted()
      Returns:
      true if the DeliveryState represents an Accepted outcome.
    • isRejected

      default boolean isRejected()
      Returns:
      true if the DeliveryState represents an Rejected outcome.
    • isModified

      default boolean isModified()
      Returns:
      true if the DeliveryState represents an Modified outcome.
    • isReleased

      default boolean isReleased()
      Returns:
      true if the DeliveryState represents an Released outcome.
    • isTransactional

      default boolean isTransactional()
      Returns:
      true if the DeliveryState represents an Transactional outcome.
    • accepted

      static DeliveryState accepted()
      Returns:
      an instance of an AMQP Accepted delivery outcome.
    • released

      static DeliveryState released()
      Returns:
      an instance of an AMQP Released delivery outcome.
    • rejected

      static DeliveryState rejected(String condition, String description)
      Create a new Rejected outcome with the given condition and description.
      Parameters:
      condition - the condition that lead to the rejected outcome.
      description - a meaningful description of the reason for the rejection.
      Returns:
      an instance of an AMQP Rejected delivery outcome.
    • rejected

      static DeliveryState rejected(String condition, String description, Map<String,Object> info)
      Create a new Rejected outcome with the given condition and description.
      Parameters:
      condition - the condition that lead to the rejected outcome.
      description - a meaningful description of the reason for the rejection.
      info - a Map containing additional information about the rejection.
      Returns:
      an instance of an AMQP Rejected delivery outcome.
    • modified

      static DeliveryState modified(boolean failed, boolean undeliverable)
      Create a new Modified outcome with the given failure state.
      Parameters:
      failed - boolean indicating if delivery failed or not.
      undeliverable - boolean indicating if the delivery cannot be sent to this receiver again.
      Returns:
      an instance of an AMQP Modified delivery outcome.
    • modified

      static DeliveryState modified(boolean failed, boolean undeliverable, Map<String,Object> annotations)
      Create a new Modified outcome with the given failure state.
      Parameters:
      failed - boolean indicating if delivery failed or not.
      undeliverable - boolean indicating if the delivery cannot be sent to this receiver again.
      annotations - updated annotation for the delivery that this outcome applies to.
      Returns:
      an instance of an AMQP Modified delivery outcome.