Class ClientStreamTracker
- java.lang.Object
-
- org.apache.qpid.protonj2.client.impl.ClientStreamTracker
-
- All Implemented Interfaces:
StreamTracker
,Tracker
public final class ClientStreamTracker extends java.lang.Object implements StreamTracker
StreamTracker
implementation that relies on the ClientTracker to handle the basicOutgoingDelivery
management.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tracker
awaitAccepted()
Waits if necessary for the remote to settle the sent delivery with anAccepted
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 aDisposition
back.Tracker
awaitAccepted(long timeout, java.util.concurrent.TimeUnit unit)
Waits if necessary for the remote to settle the sent delivery with anAccepted
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 aDisposition
back.StreamTracker
awaitSettlement()
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 aDisposition
back.StreamTracker
awaitSettlement(long timeout, java.util.concurrent.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 aDisposition
back.StreamTracker
disposition(DeliveryState state, boolean settle)
Updates the DeliveryState, and optionally settle the delivery as well.boolean
remoteSettled()
Gets whether the delivery was settled by the remote peer yet.DeliveryState
remoteState()
Gets the current remote state for the tracked delivery.StreamSender
sender()
StreamTracker
settle()
Settles the delivery locally, if notauto-settling
.boolean
settled()
ClientFuture<Tracker>
settlementFuture()
Returns a future that can be used to wait for the remote to acknowledge receipt of a sent message by settling it.DeliveryState
state()
Gets the current local state for the tracked delivery.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.qpid.protonj2.client.StreamTracker
settlementFuture
-
Methods inherited from interface org.apache.qpid.protonj2.client.Tracker
awaitAccepted, awaitAccepted, remoteSettled, remoteState, settled, state
-
-
-
-
Method Detail
-
sender
public StreamSender sender()
Description copied from interface:StreamTracker
- Specified by:
sender
in interfaceStreamTracker
- Specified by:
sender
in interfaceTracker
- Returns:
- the
Sender
that was used to send the delivery that is being tracked.
-
disposition
public StreamTracker 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 interfaceStreamTracker
- Specified by:
disposition
in interfaceTracker
- Parameters:
state
- the delivery state to applysettle
- whether toTracker.settle()
the delivery at the same time- Returns:
- this
Tracker
instance. - Throws:
ClientException
- if an error occurs while applying the given disposition
-
settle
public StreamTracker settle() throws ClientException
Description copied from interface:Tracker
Settles the delivery locally, if notauto-settling
.- Specified by:
settle
in interfaceStreamTracker
- Specified by:
settle
in interfaceTracker
- Returns:
- this
Tracker
instance. - Throws:
ClientException
- if an error occurs while performing the settlement.
-
awaitSettlement
public StreamTracker 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 aDisposition
back.- Specified by:
awaitSettlement
in interfaceStreamTracker
- Specified by:
awaitSettlement
in interfaceTracker
- Returns:
- this
Tracker
instance. - Throws:
ClientException
- if an error occurs while awaiting the remote settlement.
-
awaitSettlement
public StreamTracker awaitSettlement(long timeout, java.util.concurrent.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 aDisposition
back.- Specified by:
awaitSettlement
in interfaceStreamTracker
- Specified by:
awaitSettlement
in interfaceTracker
- 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.
-
state
public DeliveryState state()
Description copied from interface:Tracker
Gets the current local state for the tracked delivery.
-
remoteState
public DeliveryState remoteState()
Description copied from interface:Tracker
Gets the current remote state for the tracked delivery.- Specified by:
remoteState
in interfaceTracker
- 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 interfaceTracker
- Returns:
- whether the delivery is remotely settled
-
settled
public boolean settled()
-
settlementFuture
public ClientFuture<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 interfaceTracker
- Returns:
- a
Future
that can be used to wait on 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 anAccepted
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 aDisposition
back.- Specified by:
awaitAccepted
in interfaceTracker
- 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, java.util.concurrent.TimeUnit unit) throws ClientException
Description copied from interface:Tracker
Waits if necessary for the remote to settle the sent delivery with anAccepted
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 aDisposition
back.- Specified by:
awaitAccepted
in interfaceTracker
- 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.
-
-