Class ClientNoOpStreamTracker

java.lang.Object
org.apache.qpid.protonj2.client.impl.ClientNoOpStreamTracker
All Implemented Interfaces:
StreamTracker

public final class ClientNoOpStreamTracker extends Object implements StreamTracker
A dummy Tracker instance that always indicates remote settlement and acceptance for StreamSender instances.
  • Method Details

    • sender

      public StreamSender sender()
      Specified by:
      sender in interface StreamTracker
      Returns:
      the StreamSender that was used to send the delivery that is being tracked.
    • settle

      public StreamTracker settle() throws ClientException
      Description copied from interface: StreamTracker
      Settles the delivery locally, if not auto-settling.
      Specified by:
      settle in interface StreamTracker
      Returns:
      this Tracker instance.
      Throws:
      ClientException - if an error occurs while performing the settlement.
    • disposition

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

      public StreamTracker awaitSettlement() throws ClientException
      Description copied from interface: StreamTracker
      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 StreamTracker
      Returns:
      this Tracker instance.
      Throws:
      ClientException - if an error occurs while awaiting the remote settlement.
    • awaitSettlement

      public StreamTracker awaitSettlement(long timeout, TimeUnit unit) throws ClientException
      Description copied from interface: StreamTracker
      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 StreamTracker
      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.
    • settled

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

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

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

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

      public Future<StreamTracker> settlementFuture()
      Description copied from interface: StreamTracker
      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 StreamTracker
      Returns:
      a Future that can be used to wait on remote settlement.
    • awaitAccepted

      public StreamTracker awaitAccepted() throws ClientException
      Description copied from interface: StreamTracker
      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 StreamTracker
      Returns:
      this Tracker instance.
      Throws:
      ClientException - if an error occurs while awaiting the remote settlement.
    • awaitAccepted

      public StreamTracker awaitAccepted(long timeout, TimeUnit unit) throws ClientException
      Description copied from interface: StreamTracker
      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 StreamTracker
      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.