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
 
 
 
- 
- 
Field Summary- 
Fields inherited from class org.apache.qpid.protonj2.engine.impl.ProtonLinkconnection, localAttach, remoteAttach, session
 - 
Fields inherited from class org.apache.qpid.protonj2.engine.impl.ProtonEndpointengine
 
- 
 - 
Constructor SummaryConstructors Constructor Description ProtonReceiver(ProtonSession session, java.lang.String name)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ProtonReceiveraddCredit(int credit)Adds the given amount of credit for theReceiver.ReceivercreditStateUpdateHandler(EventHandler<Receiver> handler)Handler for link credit updates that occur after a remoteFlowarrives.protected ProtonReceiverdecorateOutgoingFlow(Flow flow)ReceiverdeliveryAbortedHandler(EventHandler<IncomingDelivery> handler)Handler for aborted deliveries that is called for each aborted in-progress delivery.ReceiverdeliveryReadHandler(EventHandler<IncomingDelivery> handler)ReceiverdeliveryStateUpdatedHandler(EventHandler<IncomingDelivery> handler)Handler for updates to the remote state of incoming deliveries that have previously been received.Receiverdisposition(java.util.function.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.intgetCredit()Get the credit that is currently available or assigned to this link.DeliveryStategetDefaultDeliveryState()RolegetRole()protected ProtonReceiverhandleRemoteAttach(Attach attach)protected ProtonReceiverhandleRemoteDetach(Detach detach)protected ProtonReceiverhandleRemoteDisposition(Disposition disposition, ProtonIncomingDelivery delivery)protected ProtonReceiverhandleRemoteDisposition(Disposition disposition, ProtonOutgoingDelivery delivery)protected ProtonReceiverhandleRemoteFlow(Flow flow)protected ProtonIncomingDeliveryhandleRemoteTransfer(Transfer transfer, ProtonBuffer payload)booleanhasUnsettled()booleanisDraining()Indicates if the link is draining.protected ProtonReceiverself()ProtonReceiversetDefaultDeliveryState(DeliveryState state)Configures a default DeliveryState to be used if a received delivery is settled/freed without any disposition state having been previously applied.Receiversettle(java.util.function.Predicate<IncomingDelivery> filter)For each unsettled outgoing delivery that is pending in theReceiverapply the given predicate and if it matches then settle the delivery.java.util.Collection<IncomingDelivery>unsettled()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, transitionToRemotelyOpenedState
 - 
Methods inherited from class org.apache.qpid.protonj2.engine.impl.ProtonEndpointcloseHandler, engineShutdownHandler, getAttachments, getCondition, getEngine, getLinkedResource, getLinkedResource, getRemoteCondition, localCloseHandler, localOpenHandler, openHandler, setCondition, setLinkedResource
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
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, setProperties
 - 
Methods 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 Detail- 
ProtonReceiverpublic ProtonReceiver(ProtonSession session, java.lang.String name) - Parameters:
- session- The Session that is linked to this receiver instance.
- name- The name assigned to this- Receiverlink.
 
 
- 
 - 
Method Detail- 
setDefaultDeliveryStatepublic ProtonReceiver setDefaultDeliveryState(DeliveryState state) Description 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.
 
 - 
getDefaultDeliveryStatepublic DeliveryState getDefaultDeliveryState() - Specified by:
- getDefaultDeliveryStatein interface- Receiver
- Returns:
- the default delivery state for this delivery
 
 - 
getRolepublic Role getRole() 
 - 
selfprotected ProtonReceiver 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.
 - 
addCreditpublic ProtonReceiver addCredit(int credit) Description 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(java.util.function.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
 
 - 
settlepublic Receiver settle(java.util.function.Predicate<IncomingDelivery> filter) Description copied from interface:ReceiverFor each unsettled outgoing delivery that is pending in theReceiverapply the given predicate and if it matches then settle the delivery.
 - 
unsettledpublic java.util.Collection<IncomingDelivery> unsettled() Description 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.
 
 - 
deliveryReadHandlerpublic Receiver deliveryReadHandler(EventHandler<IncomingDelivery> handler) Description 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
 
 - 
deliveryAbortedHandlerpublic Receiver deliveryAbortedHandler(EventHandler<IncomingDelivery> handler) Description 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
 
 - 
deliveryStateUpdatedHandlerpublic Receiver deliveryStateUpdatedHandler(EventHandler<IncomingDelivery> handler) Description 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
 
 - 
creditStateUpdateHandlerpublic Receiver creditStateUpdateHandler(EventHandler<Receiver> handler) Description 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.
 
 - 
handleRemoteAttachprotected final ProtonReceiver handleRemoteAttach(Attach attach) - Specified by:
- handleRemoteAttachin class- ProtonLink<Receiver>
 
 - 
handleRemoteDetachprotected final ProtonReceiver handleRemoteDetach(Detach detach) - Specified by:
- handleRemoteDetachin class- ProtonLink<Receiver>
 
 - 
handleRemoteFlowprotected final ProtonReceiver handleRemoteFlow(Flow flow) - 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>
 
 - 
decorateOutgoingFlowprotected ProtonReceiver decorateOutgoingFlow(Flow flow) - Specified by:
- decorateOutgoingFlowin class- ProtonLink<Receiver>
 
 
- 
 
-