Package org.apache.qpid.protonj2.engine
Interface Receiver
- All Known Implementing Classes:
- ProtonReceiver
AMQP Receiver API
- 
Method SummaryModifier and TypeMethodDescriptionaddCredit(int additionalCredit) Adds the given amount of credit for theReceiver.Handler for aborted deliveries that is called for each aborted in-progress delivery.deliveryReadHandler(EventHandler<IncomingDelivery> handler) Handler for updates to the remote state of incoming deliveries that have previously been received.disposition(Predicate<IncomingDelivery> filter, DeliveryState state, boolean settle) For each unsettled outgoing delivery that is pending in theReceiverapply the given predicate and if it matches then apply the given delivery state and settled value to it.booleandrain()Initiate a drain of all remaining credit of thisReceiverlink.booleandrain(int credit) Initiate a drain of the given credit from this thisReceiverlink.booleanConfigures a default DeliveryState to be used if a received delivery is settled/freed without any disposition state having been previously applied.settle(Predicate<IncomingDelivery> filter) For each unsettled outgoing delivery that is pending in theReceiverapply the given predicate and if it matches then settle the delivery.Retrieves the list of unsettled deliveries for thisReceiverlink which have yet to be settled on this end of the link.Methods inherited from interface org.apache.qpid.protonj2.engine.Endpointclose, closeHandler, engineShutdownHandler, getAttachments, getCondition, getDesiredCapabilities, getEngine, getLinkedResource, getLinkedResource, getOfferedCapabilities, getProperties, getRemoteCondition, getRemoteDesiredCapabilities, getRemoteOfferedCapabilities, getRemoteProperties, isLocallyClosed, isLocallyOpen, localCloseHandler, localOpenHandler, open, openHandler, setCondition, setDesiredCapabilities, setLinkedResource, setOfferedCapabilities, setPropertiesMethods inherited from interface org.apache.qpid.protonj2.engine.LinkcreditStateUpdateHandler, detach, detachHandler, getConnection, getCredit, getMaxMessageSize, getName, getParent, getReceiverSettleMode, getRemoteMaxMessageSize, getRemoteReceiverSettleMode, getRemoteSenderSettleMode, getRemoteSource, getRemoteState, getRemoteTarget, getRole, getSenderSettleMode, getSession, getSource, getState, getTarget, isDraining, isLocallyClosedOrDetached, isLocallyDetached, isReceiver, isRemotelyClosed, isRemotelyClosedOrDetached, isRemotelyDetached, isRemotelyOpen, isSender, localDetachHandler, parentEndpointClosedHandler, setMaxMessageSize, setReceiverSettleMode, setSenderSettleMode, setSource, setTarget, setTarget
- 
Method Details- 
addCreditAdds the given amount of credit for theReceiver.- Parameters:
- additionalCredit- the new amount of credits to add.
- Returns:
- this Receiver
- Throws:
- IllegalArgumentException- if the credit amount is negative.
 
- 
drainboolean drain()Initiate a drain of all remaining credit of thisReceiverlink.- Returns:
- true if a drain was started or false if the link already had no credit to drain.
- Throws:
- IllegalStateException- if an existing drain attempt is incomplete.
 
- 
drainboolean drain(int credit) Initiate a drain of the given credit from this thisReceiverlink. If the credit given is greater than the current link credit the current credit is increased, however if the amount of credit given is less that the current amount of link credit an exception is thrown.- Parameters:
- credit- The amount of credit that should be requested to be drained from this link.
- Returns:
- true if a drain was started or false if the value is zero and the link had no credit.
- Throws:
- IllegalStateException- if an existing drain attempt is incomplete.
- IllegalArgumentException- if the credit value given is less than the current value.
 
- 
setDefaultDeliveryStateConfigures a default DeliveryState to be used if a received delivery is settled/freed without any disposition state having been previously applied.- Parameters:
- state- the default delivery state
- Returns:
- this Receiverfor chaining.
 
- 
getDefaultDeliveryStateDeliveryState getDefaultDeliveryState()- Returns:
- the default delivery state for this delivery
 
- 
dispositionFor each unsettled outgoing delivery that is pending in theReceiverapply the given predicate and if it matches then apply the given delivery state and settled value to it.- Parameters:
- filter- The predicate to apply to each unsettled delivery to test for a match.
- state- The new- DeliveryStateto apply to any matching outgoing deliveries.
- settle- Boolean indicating if the matching unsettled deliveries should be settled.
- Returns:
- this Receiverfor chaining
 
- 
settleFor each unsettled outgoing delivery that is pending in theReceiverapply the given predicate and if it matches then settle the delivery.- Parameters:
- filter- The predicate to apply to each unsettled delivery to test for a match.
- Returns:
- this Receiverfor chaining
 
- 
unsettledCollection<IncomingDelivery> unsettled()Retrieves the list of unsettled deliveries for thisReceiverlink which have yet to be settled on this end of the link. When theIncomingDeliveryis settled by the receiver the value will be removed from the collection. TheCollectionreturned from this method is a copy of the internally maintained data and is not modifiable. The caller should use this method judiciously to avoid excess GC overhead.- Returns:
- a collection of unsettled deliveries or an empty list if no pending deliveries are outstanding.
 
- 
hasUnsettledboolean hasUnsettled()- Returns:
- true if there are unsettled deliveries for this Receiverlink.
 
- 
deliveryReadHandlerHandler for incoming deliveries that is called for each incomingTransferframe that comprises either one complete delivery or a chunk of a split framedTransfer. The handler should check that the delivery being read is partial or not and act accordingly, as partial deliveries expect additional updates as more frames comprising thatIncomingDeliveryarrive or the remote aborts the transfer.- Parameters:
- handler- The handler that will be invoked when- Transferframes arrive on this receiver link.
- Returns:
- this receiver
 
- 
deliveryAbortedHandlerHandler for aborted deliveries that is called for each aborted in-progress delivery.This handler is an optional convenience handler that supplements the standard deliveryReadHandler(EventHandler)in cases where the users wishes to break out the processing of inbound delivery data from abort processing. If this handler is not set theReceiverwill call the registereddeliveryAbortedHandler(EventHandler)if one is set.- Parameters:
- handler- The handler that will be invoked when- Transferframes arrive on this receiver link.
- Returns:
- this receiver
 
- 
deliveryStateUpdatedHandlerHandler for updates to the remote state of incoming deliveries that have previously been received.Remote state updates for an IncomingDeliverycan happen when the remote settles a completeIncomingDeliveryor otherwise modifies the delivery outcome and the user needs to act on those changes such as a spontaneous update to theDeliveryState.- Parameters:
- handler- The handler that will be invoked when a new remote state update for an- IncomingDeliveryarrives on this link.
- Returns:
- this receiver
 
 
-