Class ProtonReceiver
java.lang.Object
org.apache.qpid.protonj2.engine.impl.ProtonEndpoint<L>
org.apache.qpid.protonj2.engine.impl.ProtonLink<Receiver>
org.apache.qpid.protonj2.engine.impl.ProtonReceiver
Proton Receiver link implementation.
- 
Field SummaryFields inherited from class org.apache.qpid.protonj2.engine.impl.ProtonLinkconnection, localAttach, remoteAttach, sessionFields inherited from class org.apache.qpid.protonj2.engine.impl.ProtonEndpointengine
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaddCredit(int credit) Adds the given amount of credit for theReceiver.creditStateUpdateHandler(EventHandler<Receiver> handler) Handler for link credit updates that occur after a remoteFlowarrives.protected ProtonReceiverdecorateOutgoingFlow(Flow flow) 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 disposition, 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 credits) Initiate a drain of the given credit from this thisReceiverlink.intGet the credit that is currently available or assigned to this link.getRole()protected final ProtonReceiverhandleRemoteAttach(Attach attach) protected final ProtonReceiverhandleRemoteDetach(Detach detach) protected final ProtonReceiverhandleRemoteDisposition(Disposition disposition, ProtonIncomingDelivery delivery) protected final ProtonReceiverhandleRemoteDisposition(Disposition disposition, ProtonOutgoingDelivery delivery) protected final ProtonReceiverhandleRemoteFlow(Flow flow) protected final ProtonIncomingDeliveryhandleRemoteTransfer(Transfer transfer, ProtonBuffer payload) booleanbooleanIndicates if the link is draining.protected ProtonReceiverself()Configures 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 class org.apache.qpid.protonj2.engine.impl.ProtonLinkareDeliveriesStillActive, checkLinkOperable, checkNotClosed, checkNotOpened, close, detach, detachHandler, getConnection, getDesiredCapabilities, getMaxMessageSize, getName, getOfferedCapabilities, getParent, getProperties, getReceiverSettleMode, getRemoteDesiredCapabilities, getRemoteMaxMessageSize, getRemoteOfferedCapabilities, getRemoteProperties, getRemoteReceiverSettleMode, getRemoteSenderSettleMode, getRemoteSource, getRemoteState, getRemoteTarget, getSenderSettleMode, getSession, getSource, getState, getTarget, isLocallyClosed, isLocallyClosedOrDetached, isLocallyDetached, isLocallyOpen, isReceiver, isRemotelyClosed, isRemotelyClosedOrDetached, isRemotelyDetached, isRemotelyOpen, isSender, localDetachHandler, open, parentEndpointClosedHandler, setDesiredCapabilities, setMaxMessageSize, setOfferedCapabilities, setProperties, setReceiverSettleMode, setSenderSettleMode, setSource, setTarget, setTarget, transitionedToLocallyClosed, transitionedToLocallyDetached, transitionedToLocallyOpened, transitionToParentLocallyClosed, transitionToParentRemotelyClosed, transitionToRemotelyClosed, transitionToRemotelyDetached, transitionToRemotelyOpenedStateMethods inherited from class org.apache.qpid.protonj2.engine.impl.ProtonEndpointcloseHandler, engineShutdownHandler, getAttachments, getCondition, getEngine, getLinkedResource, getLinkedResource, getRemoteCondition, localCloseHandler, localOpenHandler, openHandler, setCondition, setLinkedResourceMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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.Linkdetach, detachHandler, getConnection, getMaxMessageSize, getName, getParent, getReceiverSettleMode, getRemoteMaxMessageSize, getRemoteReceiverSettleMode, getRemoteSenderSettleMode, getRemoteSource, getRemoteState, getRemoteTarget, getSenderSettleMode, getSession, getSource, getState, getTarget, isLocallyClosedOrDetached, isLocallyDetached, isReceiver, isRemotelyClosed, isRemotelyClosedOrDetached, isRemotelyDetached, isRemotelyOpen, isSender, localDetachHandler, parentEndpointClosedHandler, setMaxMessageSize, setReceiverSettleMode, setSenderSettleMode, setSource, setTarget, setTarget
- 
Constructor Details- 
ProtonReceiver- Parameters:
- session- The Session that is linked to this receiver instance.
- name- The name assigned to this- Receiverlink.
 
 
- 
- 
Method Details- 
setDefaultDeliveryStateDescription copied from interface:ReceiverConfigures a default DeliveryState to be used if a received delivery is settled/freed without any disposition state having been previously applied.- Specified by:
- setDefaultDeliveryStatein interface- Receiver
- Parameters:
- state- the default delivery state
- Returns:
- this Receiverfor chaining.
 
- 
getDefaultDeliveryState- Specified by:
- getDefaultDeliveryStatein interface- Receiver
- Returns:
- the default delivery state for this delivery
 
- 
getRole
- 
self- Specified by:
- selfin class- ProtonLink<Receiver>
 
- 
getCreditpublic int getCredit()Description copied from interface:LinkGet the credit that is currently available or assigned to this link.
- 
addCreditDescription copied from interface:ReceiverAdds the given amount of credit for theReceiver.
- 
drainpublic boolean drain()Description copied from interface:ReceiverInitiate a drain of all remaining credit of thisReceiverlink.
- 
drainpublic boolean drain(int credits) Description copied from interface:ReceiverInitiate 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.
- 
isDrainingpublic boolean isDraining()Description copied from interface:LinkIndicates if the link is draining. For aSenderlink this indicates that the remote has requested that the Sender transmit deliveries up to the currently available credit or indicate that it has no more to send. For aReceiverthis indicates that the Receiver has requested that the Sender consume its outstanding credit.- Specified by:
- isDrainingin interface- Link<Receiver>
- Returns:
- true if the Linkis currently marked as draining.
 
- 
dispositionpublic Receiver disposition(Predicate<IncomingDelivery> filter, DeliveryState disposition, boolean settle) Description copied from interface:ReceiverFor 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.- Specified by:
- dispositionin interface- Receiver
- Parameters:
- filter- The predicate to apply to each unsettled delivery to test for a match.
- disposition- The new- DeliveryStateto apply to any matching outgoing deliveries.
- settle- Boolean indicating if the matching unsettled deliveries should be settled.
- Returns:
- this Receiverfor chaining
 
- 
settleDescription copied from interface:ReceiverFor each unsettled outgoing delivery that is pending in theReceiverapply the given predicate and if it matches then settle the delivery.
- 
unsettledDescription copied from interface:ReceiverRetrieves 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.
- 
hasUnsettledpublic boolean hasUnsettled()- Specified by:
- hasUnsettledin interface- Receiver
- Returns:
- true if there are unsettled deliveries for this Receiverlink.
 
- 
deliveryReadHandlerDescription copied from interface:ReceiverHandler 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.- Specified by:
- deliveryReadHandlerin interface- Receiver
- Parameters:
- handler- The handler that will be invoked when- Transferframes arrive on this receiver link.
- Returns:
- this receiver
 
- 
deliveryAbortedHandlerDescription copied from interface:ReceiverHandler for aborted deliveries that is called for each aborted in-progress delivery.This handler is an optional convenience handler that supplements the standard Receiver.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 registeredReceiver.deliveryAbortedHandler(EventHandler)if one is set.- Specified by:
- deliveryAbortedHandlerin interface- Receiver
- Parameters:
- handler- The handler that will be invoked when- Transferframes arrive on this receiver link.
- Returns:
- this receiver
 
- 
deliveryStateUpdatedHandlerDescription copied from interface:ReceiverHandler 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.- Specified by:
- deliveryStateUpdatedHandlerin interface- Receiver
- Parameters:
- handler- The handler that will be invoked when a new remote state update for an- IncomingDeliveryarrives on this link.
- Returns:
- this receiver
 
- 
creditStateUpdateHandlerDescription copied from interface:LinkHandler for link credit updates that occur after a remoteFlowarrives.- Specified by:
- creditStateUpdateHandlerin interface- Link<Receiver>
- Parameters:
- handler- An event handler that will be signaled when the link credit is updated by a remote flow.
- Returns:
- the Linkfor chaining.
 
- 
handleRemoteAttach- Specified by:
- handleRemoteAttachin class- ProtonLink<Receiver>
 
- 
handleRemoteDetach- Specified by:
- handleRemoteDetachin class- ProtonLink<Receiver>
 
- 
handleRemoteFlow- Specified by:
- handleRemoteFlowin class- ProtonLink<Receiver>
 
- 
handleRemoteDispositionprotected final ProtonReceiver handleRemoteDisposition(Disposition disposition, ProtonIncomingDelivery delivery) - Specified by:
- handleRemoteDispositionin class- ProtonLink<Receiver>
 
- 
handleRemoteDispositionprotected final ProtonReceiver handleRemoteDisposition(Disposition disposition, ProtonOutgoingDelivery delivery) - Specified by:
- handleRemoteDispositionin class- ProtonLink<Receiver>
 
- 
handleRemoteTransferprotected final ProtonIncomingDelivery handleRemoteTransfer(Transfer transfer, ProtonBuffer payload) - Specified by:
- handleRemoteTransferin class- ProtonLink<Receiver>
 
- 
decorateOutgoingFlow- Specified by:
- decorateOutgoingFlowin class- ProtonLink<Receiver>
 
 
-