Class ProtonSender
java.lang.Object
org.apache.qpid.protonj2.engine.impl.ProtonEndpoint<L>
org.apache.qpid.protonj2.engine.impl.ProtonLink<Sender>
org.apache.qpid.protonj2.engine.impl.ProtonSender
Proton Sender 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 TypeMethodDescriptioncreditStateUpdateHandler(EventHandler<Sender> handler) Handler for link credit updates that occur after a remoteFlowarrives.current()Gets the currentOutgoingDeliveryfor thisSenderif one is available.protected final ProtonSenderdecorateOutgoingFlow(Flow flow) Handler for updates for deliveries that have previously been sent.disposition(Predicate<OutgoingDelivery> filter, DeliveryState state, boolean settle) For each unsettled outgoing delivery that is pending in theSenderapply the given predicate and if it matches then apply the given delivery state and settled value to it.drained()Called when theReceiverhas requested a drain of credit and the sender has sent all available messages.intGet the credit that is currently available or assigned to this link.getRole()protected final ProtonSenderhandleRemoteAttach(Attach attach) protected final ProtonSenderhandleRemoteDetach(Detach detach) protected final ProtonSenderhandleRemoteDisposition(Disposition disposition, ProtonIncomingDelivery delivery) protected final ProtonSenderhandleRemoteDisposition(Disposition disposition, ProtonOutgoingDelivery delivery) protected final ProtonSenderhandleRemoteFlow(Flow flow) protected final ProtonIncomingDeliveryhandleRemoteTransfer(Transfer transfer, ProtonBuffer payload) booleanbooleanIndicates if the link is draining.booleanChecks if the sender has credit and the session window allows for any bytes to be written currently.next()When there has been no deliveries so far or the current delivery has reached a complete state this method updates the current delivery to a new instance and returns that value.protected ProtonSenderself()setDeliveryTagGenerator(DeliveryTagGenerator generator) Configures aDeliveryTagGeneratorthat will be used to create and set aDeliveryTagvalue on each newOutgoingDeliverythat is created and returned from theSender.next()method.settle(Predicate<OutgoingDelivery> filter) For each unsettled outgoing delivery that is pending in theSenderapply the given predicate and if it matches then settle the delivery.protected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidRetrieves the list of unsettled deliveries sent from thisSender.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, 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- 
ProtonSender- Parameters:
- session- The Session that is linked to this sender instance.
- name- The name assigned to this- Senderlink.
 
 
- 
- 
Method Details- 
getRole
- 
self- Specified by:
- selfin class- ProtonLink<Sender>
 
- 
getCreditpublic int getCredit()Description copied from interface:LinkGet the credit that is currently available or assigned to this link.
- 
isSendablepublic boolean isSendable()Description copied from interface:SenderChecks if the sender has credit and the session window allows for any bytes to be written currently.- Specified by:
- isSendablein interface- Sender
- Returns:
- true if the link has credit and the session window allows for any bytes to be written.
 
- 
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<Sender>
- Returns:
- true if the Linkis currently marked as draining.
 
- 
drainedDescription copied from interface:SenderCalled when theReceiverhas requested a drain of credit and the sender has sent all available messages.
- 
dispositionDescription copied from interface:SenderFor each unsettled outgoing delivery that is pending in theSenderapply the given predicate and if it matches then apply the given delivery state and settled value to it.- Specified by:
- dispositionin interface- Sender
- 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 Senderinstance.
 
- 
settleDescription copied from interface:SenderFor each unsettled outgoing delivery that is pending in theSenderapply the given predicate and if it matches then settle the delivery.
- 
currentDescription copied from interface:SenderGets the currentOutgoingDeliveryfor thisSenderif one is available.The sender only tracks a current delivery in the case that the next method has bee called and if any bytes are written to the delivery using the streaming based API OutgoingDelivery.streamBytes(ProtonBuffer)which allows for later writing of additional bytes to the delivery. Once the methodOutgoingDelivery.writeBytes(ProtonBuffer)is called the finalTransferis written indicating that the delivery is complete and the current delivery value is reset. An outgoing delivery that is being streamed may also be completed by calling theOutgoingDelivery.abort()method.
- 
nextDescription copied from interface:SenderWhen there has been no deliveries so far or the current delivery has reached a complete state this method updates the current delivery to a new instance and returns that value. If the currentOutgoingDeliveryhas not been completed by either calling theOutgoingDelivery.writeBytes(ProtonBuffer)or theOutgoingDelivery.abort()method then this method will throw an exception to indicate the sender state cannot allow a new delivery to be started.
- 
unsettledDescription copied from interface:SenderRetrieves the list of unsettled deliveries sent from thisSender. The deliveries in theCollectioncannot be written to but can have their settled state and disposition updated. Only when thisSendersettles on its end are theOutgoingDeliveryinstances removed from the unsettledCollection. 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- Sender
- Returns:
- true if there are unsettled deliveries for this Senderlink.
 
- 
setDeliveryTagGeneratorDescription copied from interface:SenderConfigures aDeliveryTagGeneratorthat will be used to create and set aDeliveryTagvalue on each newOutgoingDeliverythat is created and returned from theSender.next()method.- Specified by:
- setDeliveryTagGeneratorin interface- Sender
- Parameters:
- generator- The- DeliveryTagGeneratorto use to create automatic- DeliveryTagvalues.
- Returns:
- this Senderinstance.
 
- 
getDeliveryTagGenerator- Specified by:
- getDeliveryTagGeneratorin interface- Sender
- Returns:
- the currently configured DeliveryTagGeneratorfor thisSender.
 
- 
handleRemoteAttach- Specified by:
- handleRemoteAttachin class- ProtonLink<Sender>
 
- 
handleRemoteDetach- Specified by:
- handleRemoteDetachin class- ProtonLink<Sender>
 
- 
handleRemoteDispositionprotected final ProtonSender handleRemoteDisposition(Disposition disposition, ProtonIncomingDelivery delivery) - Specified by:
- handleRemoteDispositionin class- ProtonLink<Sender>
 
- 
handleRemoteDispositionprotected final ProtonSender handleRemoteDisposition(Disposition disposition, ProtonOutgoingDelivery delivery) - Specified by:
- handleRemoteDispositionin class- ProtonLink<Sender>
 
- 
handleRemoteTransferprotected final ProtonIncomingDelivery handleRemoteTransfer(Transfer transfer, ProtonBuffer payload) - Specified by:
- handleRemoteTransferin class- ProtonLink<Sender>
 
- 
handleRemoteFlow- Specified by:
- handleRemoteFlowin class- ProtonLink<Sender>
 
- 
decorateOutgoingFlow- Specified by:
- decorateOutgoingFlowin class- ProtonLink<Sender>
 
- 
creditStateUpdateHandlerDescription copied from interface:LinkHandler for link credit updates that occur after a remoteFlowarrives.- Specified by:
- creditStateUpdateHandlerin interface- Link<Sender>
- Parameters:
- handler- An event handler that will be signaled when the link credit is updated by a remote flow.
- Returns:
- the Linkfor chaining.
 
- 
deliveryStateUpdatedHandlerDescription copied from interface:SenderHandler for updates for deliveries that have previously been sent. Updates can happen when the remote settles or otherwise modifies the delivery and the user needs to act on those changes.- Specified by:
- deliveryStateUpdatedHandlerin interface- Sender
- Parameters:
- handler- The handler that will be invoked when a new update delivery arrives on this link.
- Returns:
- this Senderinstance.
 
- 
transitionedToLocallyOpenedprotected void transitionedToLocallyOpened()- Overrides:
- transitionedToLocallyOpenedin class- ProtonLink<Sender>
 
- 
transitionedToLocallyDetachedprotected void transitionedToLocallyDetached()- Overrides:
- transitionedToLocallyDetachedin class- ProtonLink<Sender>
 
- 
transitionedToLocallyClosedprotected void transitionedToLocallyClosed()- Overrides:
- transitionedToLocallyClosedin class- ProtonLink<Sender>
 
- 
transitionToRemotelyDetachedprotected void transitionToRemotelyDetached()- Overrides:
- transitionToRemotelyDetachedin class- ProtonLink<Sender>
 
- 
transitionToRemotelyClosedprotected void transitionToRemotelyClosed()- Overrides:
- transitionToRemotelyClosedin class- ProtonLink<Sender>
 
- 
transitionToParentLocallyClosedprotected void transitionToParentLocallyClosed()- Overrides:
- transitionToParentLocallyClosedin class- ProtonLink<Sender>
 
- 
transitionToParentRemotelyClosedprotected void transitionToParentRemotelyClosed()- Overrides:
- transitionToParentRemotelyClosedin class- ProtonLink<Sender>
 
 
-