Class ClientNoOpTracker

  • All Implemented Interfaces:
    Tracker

    public final class ClientNoOpTracker
    extends Object
    implements Tracker
    A dummy Tracker instance that always indicates remote settlement and acceptance.
    • Method Detail

      • sender

        public Sender sender()
        Specified by:
        sender in interface Tracker
        Returns:
        the Sender that was used to send the delivery that is being tracked.
      • settled

        public boolean settled()
        Specified by:
        settled in interface Tracker
        Returns:
        true if the sent message has been locally settled.
      • state

        public DeliveryState state()
        Description copied from interface: Tracker
        Gets the current local state for the tracked delivery.
        Specified by:
        state in interface Tracker
        Returns:
        the delivery state
      • disposition

        public Tracker disposition​(DeliveryState state,
                                   boolean settle)
                            throws ClientException
        Description copied from interface: Tracker
        Updates the DeliveryState, and optionally settle the delivery as well.
        Specified by:
        disposition in interface Tracker
        Parameters:
        state - the delivery state to apply
        settle - whether to Tracker.settle() the delivery at the same time
        Returns:
        this Tracker instance.
        Throws:
        ClientException - if an error occurs while applying the given disposition
      • remoteState

        public DeliveryState remoteState()
        Description copied from interface: Tracker
        Gets the current remote state for the tracked delivery.
        Specified by:
        remoteState in interface Tracker
        Returns:
        the remote DeliveryState once a value is received from the remote.
      • remoteSettled

        public boolean remoteSettled()
        Description copied from interface: Tracker
        Gets whether the delivery was settled by the remote peer yet.
        Specified by:
        remoteSettled in interface Tracker
        Returns:
        whether the delivery is remotely settled
      • settlementFuture

        public Future<Tracker> settlementFuture()
        Description copied from interface: Tracker
        Returns a future that can be used to wait for the remote to acknowledge receipt of a sent message by settling it.
        Specified by:
        settlementFuture in interface Tracker
        Returns:
        a Future that can be used to wait on remote settlement.
      • awaitSettlement

        public Tracker awaitSettlement()
                                throws ClientException
        Description copied from interface: Tracker
        Waits if necessary for the remote to settle the sent delivery unless it has either already been settled or the original delivery was sent settled in which case the remote will not send a Disposition back.
        Specified by:
        awaitSettlement in interface Tracker
        Returns:
        this Tracker instance.
        Throws:
        ClientException - if an error occurs while awaiting the remote settlement.
      • awaitSettlement

        public Tracker awaitSettlement​(long timeout,
                                       TimeUnit unit)
                                throws ClientException
        Description copied from interface: Tracker
        Waits if necessary for the remote to settle the sent delivery unless it has either already been settled or the original delivery was sent settled in which case the remote will not send a Disposition back.
        Specified by:
        awaitSettlement in interface Tracker
        Parameters:
        timeout - the maximum time to wait for the remote to settle.
        unit - the time unit of the timeout argument.
        Returns:
        this Tracker instance.
        Throws:
        ClientException - if an error occurs while awaiting the remote settlement.
      • awaitAccepted

        public Tracker awaitAccepted()
                              throws ClientException
        Description copied from interface: Tracker
        Waits if necessary for the remote to settle the sent delivery with an Accepted disposition unless it has either already been settled and accepted or the original delivery was sent settled in which case the remote will not send a Disposition back.
        Specified by:
        awaitAccepted in interface Tracker
        Returns:
        this Tracker instance.
        Throws:
        ClientDeliveryStateException - if the remote sends a disposition other than Accepted.
        ClientException - if an error occurs while awaiting the remote settlement.
      • awaitAccepted

        public Tracker awaitAccepted​(long timeout,
                                     TimeUnit unit)
                              throws ClientException
        Description copied from interface: Tracker
        Waits if necessary for the remote to settle the sent delivery with an Accepted disposition unless it has either already been settled and accepted or the original delivery was sent settled in which case the remote will not send a Disposition back.
        Specified by:
        awaitAccepted in interface Tracker
        Parameters:
        timeout - the maximum time to wait for the remote to settle.
        unit - the time unit of the timeout argument.
        Returns:
        this Tracker instance.
        Throws:
        ClientDeliveryStateException - if the remote sends a disposition other than Accepted.
        ClientException - if an error occurs while awaiting the remote settlement.