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
 
 
 
- 
- 
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 ProtonSender(ProtonSession session, java.lang.String name)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description SendercreditStateUpdateHandler(EventHandler<Sender> handler)Handler for link credit updates that occur after a remoteFlowarrives.OutgoingDeliverycurrent()Gets the currentOutgoingDeliveryfor thisSenderif one is available.protected ProtonSenderdecorateOutgoingFlow(Flow flow)SenderdeliveryStateUpdatedHandler(EventHandler<OutgoingDelivery> handler)Handler for updates for deliveries that have previously been sent.Senderdisposition(java.util.function.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.Senderdrained()Called when theReceiverhas requested a drain of credit and the sender has sent all available messages.intgetCredit()Get the credit that is currently available or assigned to this link.DeliveryTagGeneratorgetDeliveryTagGenerator()RolegetRole()protected ProtonSenderhandleRemoteAttach(Attach attach)protected ProtonSenderhandleRemoteDetach(Detach detach)protected ProtonSenderhandleRemoteDisposition(Disposition disposition, ProtonIncomingDelivery delivery)protected ProtonSenderhandleRemoteDisposition(Disposition disposition, ProtonOutgoingDelivery delivery)protected ProtonSenderhandleRemoteFlow(Flow flow)protected ProtonIncomingDeliveryhandleRemoteTransfer(Transfer transfer, ProtonBuffer payload)booleanhasUnsettled()booleanisDraining()Indicates if the link is draining.booleanisSendable()Checks if the sender has credit and the session window allows for any bytes to be written currently.OutgoingDeliverynext()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()SendersetDeliveryTagGenerator(DeliveryTagGenerator generator)Configures aDeliveryTagGeneratorthat will be used to create and set aDeliveryTagvalue on each newOutgoingDeliverythat is created and returned from theSender.next()method.Sendersettle(java.util.function.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 voidtransitionedToLocallyClosed()protected voidtransitionedToLocallyDetached()protected voidtransitionedToLocallyOpened()protected voidtransitionToParentLocallyClosed()protected voidtransitionToParentRemotelyClosed()protected voidtransitionToRemotelyClosed()protected voidtransitionToRemotelyDetached()java.util.Collection<OutgoingDelivery>unsettled()Retrieves 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, 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- 
ProtonSenderpublic ProtonSender(ProtonSession session, java.lang.String name) - Parameters:
- session- The Session that is linked to this sender instance.
- name- The name assigned to this- Senderlink.
 
 
- 
 - 
Method Detail- 
getRolepublic Role getRole() 
 - 
selfprotected ProtonSender 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.
 
 - 
drainedpublic Sender drained() Description copied from interface:SenderCalled when theReceiverhas requested a drain of credit and the sender has sent all available messages.
 - 
dispositionpublic Sender disposition(java.util.function.Predicate<OutgoingDelivery> filter, DeliveryState state, boolean settle) Description 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.
 
 - 
settlepublic Sender settle(java.util.function.Predicate<OutgoingDelivery> filter) Description copied from interface:SenderFor each unsettled outgoing delivery that is pending in theSenderapply the given predicate and if it matches then settle the delivery.
 - 
currentpublic OutgoingDelivery current() Description 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.
 - 
nextpublic OutgoingDelivery next() Description 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.
 - 
unsettledpublic java.util.Collection<OutgoingDelivery> unsettled() Description 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.
 
 - 
setDeliveryTagGeneratorpublic Sender setDeliveryTagGenerator(DeliveryTagGenerator generator) Description 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.
 
 - 
getDeliveryTagGeneratorpublic DeliveryTagGenerator getDeliveryTagGenerator() - Specified by:
- getDeliveryTagGeneratorin interface- Sender
- Returns:
- the currently configured DeliveryTagGeneratorfor thisSender.
 
 - 
handleRemoteAttachprotected final ProtonSender handleRemoteAttach(Attach attach) - Specified by:
- handleRemoteAttachin class- ProtonLink<Sender>
 
 - 
handleRemoteDetachprotected final ProtonSender handleRemoteDetach(Detach detach) - 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>
 
 - 
handleRemoteFlowprotected final ProtonSender handleRemoteFlow(Flow flow) - Specified by:
- handleRemoteFlowin class- ProtonLink<Sender>
 
 - 
decorateOutgoingFlowprotected final ProtonSender decorateOutgoingFlow(Flow flow) - Specified by:
- decorateOutgoingFlowin class- ProtonLink<Sender>
 
 - 
creditStateUpdateHandlerpublic Sender creditStateUpdateHandler(EventHandler<Sender> handler) Description 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.
 
 - 
deliveryStateUpdatedHandlerpublic Sender deliveryStateUpdatedHandler(EventHandler<OutgoingDelivery> handler) Description 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>
 
 
- 
 
-