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 forStreamSenderinstances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StreamTrackerawaitAccepted()Waits if necessary for the remote to settle the sent delivery with anAccepteddisposition unless it has either already been settled and accepted or the original delivery was sent settled in which case the remote will not send aDispositionback.StreamTrackerawaitAccepted(long timeout, TimeUnit unit)Waits if necessary for the remote to settle the sent delivery with anAccepteddisposition unless it has either already been settled and accepted or the original delivery was sent settled in which case the remote will not send aDispositionback.StreamTrackerawaitSettlement()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 aDispositionback.StreamTrackerawaitSettlement(long timeout, TimeUnit unit)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 aDispositionback.StreamTrackerdisposition(DeliveryState state, boolean settle)Updates the DeliveryState, and optionally settle the delivery as well.booleanremoteSettled()Gets whether the delivery was settled by the remote peer yet.DeliveryStateremoteState()Gets the current remote state for the tracked delivery.StreamSendersender()StreamTrackersettle()Settles the delivery locally, if notauto-settling.booleansettled()Future<StreamTracker>settlementFuture()Returns a future that can be used to wait for the remote to acknowledge receipt of a sent message by settling it.DeliveryStatestate()Gets the current local state for the tracked delivery.
-
-
-
Method Detail
-
sender
public StreamSender sender()
- Specified by:
senderin interfaceStreamTracker- Returns:
- the
StreamSenderthat was used to send the delivery that is being tracked.
-
settle
public StreamTracker settle() throws ClientException
Description copied from interface:StreamTrackerSettles the delivery locally, if notauto-settling.- Specified by:
settlein interfaceStreamTracker- Returns:
- this
Trackerinstance. - Throws:
ClientException- if an error occurs while performing the settlement.
-
disposition
public StreamTracker disposition(DeliveryState state, boolean settle) throws ClientException
Description copied from interface:StreamTrackerUpdates the DeliveryState, and optionally settle the delivery as well.- Specified by:
dispositionin interfaceStreamTracker- Parameters:
state- the delivery state to applysettle- whether toStreamTracker.settle()the delivery at the same time- Returns:
- this
Trackerinstance. - Throws:
ClientException- if an error occurs while applying the given disposition
-
awaitSettlement
public StreamTracker awaitSettlement() throws ClientException
Description copied from interface:StreamTrackerWaits 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 aDispositionback.- Specified by:
awaitSettlementin interfaceStreamTracker- Returns:
- this
Trackerinstance. - 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:StreamTrackerWaits 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 aDispositionback.- Specified by:
awaitSettlementin interfaceStreamTracker- Parameters:
timeout- the maximum time to wait for the remote to settle.unit- the time unit of the timeout argument.- Returns:
- this
Trackerinstance. - Throws:
ClientException- if an error occurs while awaiting the remote settlement.
-
settled
public boolean settled()
- Specified by:
settledin interfaceStreamTracker- Returns:
- true if the sent message has been locally settled.
-
state
public DeliveryState state()
Description copied from interface:StreamTrackerGets the current local state for the tracked delivery.- Specified by:
statein interfaceStreamTracker- Returns:
- the delivery state
-
remoteState
public DeliveryState remoteState()
Description copied from interface:StreamTrackerGets the current remote state for the tracked delivery.- Specified by:
remoteStatein interfaceStreamTracker- Returns:
- the remote
DeliveryStateonce a value is received from the remote.
-
remoteSettled
public boolean remoteSettled()
Description copied from interface:StreamTrackerGets whether the delivery was settled by the remote peer yet.- Specified by:
remoteSettledin interfaceStreamTracker- Returns:
- whether the delivery is remotely settled
-
settlementFuture
public Future<StreamTracker> settlementFuture()
Description copied from interface:StreamTrackerReturns a future that can be used to wait for the remote to acknowledge receipt of a sent message by settling it.- Specified by:
settlementFuturein interfaceStreamTracker- Returns:
- a
Futurethat can be used to wait on remote settlement.
-
awaitAccepted
public StreamTracker awaitAccepted() throws ClientException
Description copied from interface:StreamTrackerWaits if necessary for the remote to settle the sent delivery with anAccepteddisposition unless it has either already been settled and accepted or the original delivery was sent settled in which case the remote will not send aDispositionback.- Specified by:
awaitAcceptedin interfaceStreamTracker- Returns:
- this
Trackerinstance. - Throws:
ClientDeliveryStateException- if the remote sends a disposition other than Accepted.ClientException- if an error occurs while awaiting the remote settlement.
-
awaitAccepted
public StreamTracker awaitAccepted(long timeout, TimeUnit unit) throws ClientException
Description copied from interface:StreamTrackerWaits if necessary for the remote to settle the sent delivery with anAccepteddisposition unless it has either already been settled and accepted or the original delivery was sent settled in which case the remote will not send aDispositionback.- Specified by:
awaitAcceptedin interfaceStreamTracker- Parameters:
timeout- the maximum time to wait for the remote to settle.unit- the time unit of the timeout argument.- Returns:
- this
Trackerinstance. - Throws:
ClientDeliveryStateException- if the remote sends a disposition other than Accepted.ClientException- if an error occurs while awaiting the remote settlement.
-
-