Proton DotNet
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Properties | List of all members
Apache.Qpid.Proton.Engine.Implementation.ProtonReceiver Class Referencesealed

Proton Receiver link implementation which manages the receipt of new deliveries and credit associated with the link. Delivery outcomes and settlement states can also be managed from the receiver link. More...

Inheritance diagram for Apache.Qpid.Proton.Engine.Implementation.ProtonReceiver:
Apache.Qpid.Proton.Engine.Implementation.ProtonLink< IReceiver > Apache.Qpid.Proton.Engine.IReceiver Apache.Qpid.Proton.Engine.ILink< T > Apache.Qpid.Proton.Engine.IEndpoint< T >

Public Member Functions

 ProtonReceiver (ProtonSession session, string name, ProtonLinkCreditState creditState)
 
IReceiver AddCredit (uint amount)
 Adds the given amount of credit to the receiver's already existing credit if any.
 
bool Drain ()
 Initiate a drain of all remaining credit of this link, the remote sender will then either send enough deliveries to fulfill the drain request or report that it cannot and all remaining link credit will be consumed.
 
bool Drain (uint credits)
 Initiate a drain of the given credit from this this receiver} link. 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.
 
IReceiver Settle (Predicate< IIncomingDelivery > filter)
 For each unsettled outgoing delivery that is pending in the receiver apply the given predicate and if it matches then settle the delivery.
 
IReceiver Disposition (Predicate< IIncomingDelivery > filter, IDeliveryState state, bool settle)
 For each unsettled outgoing delivery that is pending in the receiver apply the given predicate and if it matches then apply the given delivery state and settled value to it.
 
IReceiver DeliveryAbortedHandler (Action< IIncomingDelivery > handler)
 Handler for aborted deliveries that is called for each aborted in-progress delivery. This handler is an optional convenience handler that supplements the standard delivery read event handler in cases where the users wishes to break out the processing of inbound delivery data from abort processing. If this handler is not set the receiver will call the registered delivery read handler if one is set.
 
IReceiver DeliveryReadHandler (Action< IIncomingDelivery > handler)
 Handler for incoming deliveries that is called for each incoming transfer frame that comprises either one complete delivery or a chunk of a split framed transfer. 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 that delivery arrive or the remote aborts the transfer.
 
IReceiver DeliveryStateUpdatedHandler (Action< IIncomingDelivery > handler)
 Handler for updates to the remote state of incoming deliveries that have previously been received. Remote state updates for an previously received delivery can happen when the remote settles a complete delivery or otherwise modifies the delivery outcome and the user needs to act on those changes such as a spontaneous update to the delivery state.
 
- Public Member Functions inherited from Apache.Qpid.Proton.Engine.IEndpoint< T >
Open ()
 Open the end point locally, sending the Open performative immediately if possible or holding it until SASL negotiations or the AMQP header exchange and other required performative exchanges has completed. The endpoint will signal any registered handler of the remote opening the endpoint once the remote performative that signals open completion arrives.
 
Close ()
 Close the end point locally and send the closing performative immediately if possible or holds it until the Connection / Engine state allows it. If the engine encounters an error writing the performative or the engine is in a failed state from a previous error then this method will throw an exception. If the engine has been shutdown then this method will close out the local end of the endpoint and clean up any local resources before returning normally.
 
LocalOpenHandler (Action< T > localOpenHandler)
 Sets a Action for when an this endpoint is opened locally via a call to Open. Typically used by clients for logging or other state update event processing. Clients should not perform any blocking calls within this context. It is an error for the handler to throw an exception and the outcome of doing so is undefined. Typically used by clients as servers will typically listen to some parent resource event handler to determine if the remote is initiating a resource open.
 
LocalCloseHandler (Action< T > localCloseHandler)
 Sets a Action for when an this endpoint is closed locally via a call to Close. Typically used by clients for logging or other state update event processing. Clients should not perform any blocking calls within this context. It is an error for the handler to throw an exception and the outcome of doing so is undefined.
 
OpenHandler (Action< T > localOpenHandler)
 Sets a Action for when an AMQP Open frame is received from the remote peer. Used to process remotely initiated Connections. Locally initiated sessions have their own Action invoked instead. This method is typically used by servers to listen for the remote peer to open its endpoint, while a client would listen for the server to open its end of the endpoint once a local open has been performed. Typically used by clients as servers will typically listen to some parent resource event handler to determine if the remote is initiating a resource open.
 
CloseHandler (Action< T > localCloseHandler)
 Sets a EventHandler for when an AMQP closing frame is received from the remote peer.
 
EngineShutdownHandler (Action< IEngine > shutdownHandler)
 Sets an Action that is invoked when the engine that supports this endpoint is shutdown which indicates a desire to terminate all engine operations. Any endpoint that has been both locally and remotely closed will not receive this event as it will no longer be tracked by the parent its parent endpoint. A typical use of this event would be from a locally closed endpoint that is awaiting response from the remote. If this event fires then there will never be a remote response to any pending operations and the client or server instance should react accordingly to clean up any related resources etc.
 

Protected Member Functions

override void HandleRemoteAttach (Attach attach)
 
override void HandleRemoteDetach (Detach detach)
 
override void HandleRemoteFlow (Flow flow)
 
override void HandleRemoteDisposition (Disposition disposition, ProtonOutgoingDelivery delivery)
 
override void HandleRemoteDisposition (Disposition disposition, ProtonIncomingDelivery delivery)
 
override void HandleRemoteTransfer (Transfer transfer, IProtonBuffer payload, out ProtonIncomingDelivery delivery)
 
override void HandleDecorateOfOutgoingFlow (Flow flow)
 
override void HandleSessionCreditStateUpdates (in ProtonSessionOutgoingWindow window)
 
override void HandleSessionCreditStateUpdates (in ProtonSessionIncomingWindow window)
 

Properties

override uint Credit [get]
 Reads the credit that is currently available on or assigned to this link object.
 
override bool IsDraining [get]
 Indicates if the link is draining. For a sender link 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 a receiver this indicates that the Receiver has requested that the remote sender consume its outstanding credit.
 
override Role Role [get]
 Reads the role assigned to the local end of the link.
 
IDeliveryState DefaultDeliveryState [get, set]
 Configures a default DeliveryState to be used if a received delivery is settled/freed without any disposition state having been previously applied.
 
bool HasUnsettled [get]
 Returns true if the receiver link is tracking any unsettled sent deliveries.
 
IReadOnlyCollection< IIncomingDeliveryUnsettled [get]
 Retrieves the list of unsettled deliveries sent from this receiver. The deliveries in the enumerator cannot be written to but can have their settled state and disposition updated. Only when this receiver settles on its end are the outgoing delivery instances removed from the unsettled tracking.
 
- Properties inherited from Apache.Qpid.Proton.Engine.IReceiver
- Properties inherited from Apache.Qpid.Proton.Engine.IEndpoint< T >
IEngine Engine [get]
 Provides access to the engine instance that owns the resources of this endpoint and its parent.
 
IAttachments Attachments [get]
 Access the attachments instance that is associated with this resource where the application can store data relevant to the endpoint for later use.
 
object LinkedResource [get, set]
 Allows the endpoint to have some user defined resource linked to it which can be used to store application state data or other associated object instances with this endpoint.
 
ErrorCondition ErrorCondition [get, set]
 Provides access to the error condition that should be applied to the AMQP frame that closes or ends this endpoint when the close method is called be the user. Setting this value after closing the endpoint has no effect.
 
ErrorCondition RemoteErrorCondition [get]
 If the remote has closed this endpoint and provided an ErrorCondition as part of the closing AMQP performative then this method will return it.
 
bool IsLocallyOpen [get]
 Returns true if the endpoint open was previously called and the close method has not yet been invoked. This only reflects the state on the local end and the user should also check the remote state.
 
bool IsLocallyClosed [get]
 Returns true if the endpoint having been previously locally opened is now closed due to a call the the close method. This does not reflect the state of the remote endpoint and that should be checked separately.
 
bool IsRemotelyOpen [get]
 Returns true if this endpoint is currently remotely open meaning that the AMQP performative that completes the open phase of this endpoint's lifetime has arrived but the performative that closes it has not.
 
bool IsRemotelyClosed [get]
 Returns true if this endpoint is currently remotely closed meaning that the AMQP performative that completes the close phase of this endpoint's lifetime has arrived.
 
Symbol[] OfferedCapabilities [get, set]
 Access the capabilities to be offered on to the remote when this endpoint is opened. The offered capabilities value can only be modified prior to a call to open, once the endpoint has been opened locally an error will be thrown if this method is called.
 
Symbol[] DesiredCapabilities [get, set]
 Access the capabilities that are desired on to the remote when this endpoint is opened. The desired capabilities value can only be modified prior to a call to open, once the endpoint has been opened locally an error will be thrown if this method is called.
 
IReadOnlyDictionary< Symbol, object > Properties [get, set]
 Access the properties that are conveyed to the remote when this endpoint is opened. The properties value can only be modified prior to a call to open, once the endpoint has been opened locally an error will be thrown if this method is called.
 
Symbol[] RemoteOfferedCapabilities [get]
 The capabilities offered by the remote when it opened its end of the endpoint.
 
Symbol[] RemoteDesiredCapabilities [get]
 The capabilities desired by the remote when it opened its end of the endpoint.
 
IReadOnlyDictionary< Symbol, object > RemoteProperties [get]
 The properties sent by the remote when it opened its end of this endpoint.
 

Additional Inherited Members

Detailed Description

Proton Receiver link implementation which manages the receipt of new deliveries and credit associated with the link. Delivery outcomes and settlement states can also be managed from the receiver link.

Member Function Documentation

◆ AddCredit()

IReceiver Apache.Qpid.Proton.Engine.Implementation.ProtonReceiver.AddCredit ( uint  amount)
inline

Adds the given amount of credit to the receiver's already existing credit if any.

Parameters
amountThe amount of credit to add to the existing credit
Returns
This receiver instance

Implements Apache.Qpid.Proton.Engine.IReceiver.

◆ DeliveryAbortedHandler()

IReceiver Apache.Qpid.Proton.Engine.Implementation.ProtonReceiver.DeliveryAbortedHandler ( Action< IIncomingDelivery handler)
inline

Handler for aborted deliveries that is called for each aborted in-progress delivery. This handler is an optional convenience handler that supplements the standard delivery read event handler in cases where the users wishes to break out the processing of inbound delivery data from abort processing. If this handler is not set the receiver will call the registered delivery read handler if one is set.

Parameters
handlerA delegate that will handle this event
Returns
This receiver instance

Implements Apache.Qpid.Proton.Engine.IReceiver.

◆ DeliveryReadHandler()

IReceiver Apache.Qpid.Proton.Engine.Implementation.ProtonReceiver.DeliveryReadHandler ( Action< IIncomingDelivery handler)
inline

Handler for incoming deliveries that is called for each incoming transfer frame that comprises either one complete delivery or a chunk of a split framed transfer. 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 that delivery arrive or the remote aborts the transfer.

Parameters
handlerA delegate that will handle this event
Returns
This receiver instance

Implements Apache.Qpid.Proton.Engine.IReceiver.

◆ DeliveryStateUpdatedHandler()

IReceiver Apache.Qpid.Proton.Engine.Implementation.ProtonReceiver.DeliveryStateUpdatedHandler ( Action< IIncomingDelivery handler)
inline

Handler for updates to the remote state of incoming deliveries that have previously been received. Remote state updates for an previously received delivery can happen when the remote settles a complete delivery or otherwise modifies the delivery outcome and the user needs to act on those changes such as a spontaneous update to the delivery state.

Parameters
handlerA delegate that will handle this event
Returns
This receiver instance

Implements Apache.Qpid.Proton.Engine.IReceiver.

◆ Disposition()

IReceiver Apache.Qpid.Proton.Engine.Implementation.ProtonReceiver.Disposition ( Predicate< IIncomingDelivery filter,
IDeliveryState  state,
bool  settle 
)
inline

For each unsettled outgoing delivery that is pending in the receiver apply the given predicate and if it matches then apply the given delivery state and settled value to it.

Parameters
filterThe filter predicate that controls when disposition is applied
stateThe delivery state to apply when the predicate matches
settleShould the delivery be settled when the predicate matches.
Returns
This receiver instance

Implements Apache.Qpid.Proton.Engine.IReceiver.

◆ Drain() [1/2]

bool Apache.Qpid.Proton.Engine.Implementation.ProtonReceiver.Drain ( )
inline

Initiate a drain of all remaining credit of this link, the remote sender will then either send enough deliveries to fulfill the drain request or report that it cannot and all remaining link credit will be consumed.

Returns
True if a drain request was started or false if no credit exists
Exceptions
InvalidOperationExceptionIf a drain is already in progress

Implements Apache.Qpid.Proton.Engine.IReceiver.

◆ Drain() [2/2]

bool Apache.Qpid.Proton.Engine.Implementation.ProtonReceiver.Drain ( uint  credit)
inline

Initiate a drain of the given credit from this this receiver} link. 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
creditThe amount of credit to drain
Returns
True if a drain request was started or false if no credit exists
Exceptions
InvalidOperationExceptionIf a drain is already in progress

Implements Apache.Qpid.Proton.Engine.IReceiver.

◆ Settle()

IReceiver Apache.Qpid.Proton.Engine.Implementation.ProtonReceiver.Settle ( Predicate< IIncomingDelivery filter)
inline

For each unsettled outgoing delivery that is pending in the receiver apply the given predicate and if it matches then settle the delivery.

Parameters
filter
Returns
This receiver instance

Implements Apache.Qpid.Proton.Engine.IReceiver.

Property Documentation

◆ Credit

override uint Apache.Qpid.Proton.Engine.Implementation.ProtonReceiver.Credit
get

Reads the credit that is currently available on or assigned to this link object.

Implements Apache.Qpid.Proton.Engine.ILink< T >.

◆ DefaultDeliveryState

IDeliveryState Apache.Qpid.Proton.Engine.Implementation.ProtonReceiver.DefaultDeliveryState
getset

Configures a default DeliveryState to be used if a received delivery is settled/freed without any disposition state having been previously applied.

Implements Apache.Qpid.Proton.Engine.IReceiver.

◆ HasUnsettled

bool Apache.Qpid.Proton.Engine.Implementation.ProtonReceiver.HasUnsettled
get

Returns true if the receiver link is tracking any unsettled sent deliveries.

Implements Apache.Qpid.Proton.Engine.IReceiver.

◆ IsDraining

override bool Apache.Qpid.Proton.Engine.Implementation.ProtonReceiver.IsDraining
get

Indicates if the link is draining. For a sender link 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 a receiver this indicates that the Receiver has requested that the remote sender consume its outstanding credit.

Implements Apache.Qpid.Proton.Engine.ILink< T >.

◆ Role

override Role Apache.Qpid.Proton.Engine.Implementation.ProtonReceiver.Role
get

Reads the role assigned to the local end of the link.

Implements Apache.Qpid.Proton.Engine.ILink< T >.

◆ Unsettled

IReadOnlyCollection<IIncomingDelivery> Apache.Qpid.Proton.Engine.Implementation.ProtonReceiver.Unsettled
get

Retrieves the list of unsettled deliveries sent from this receiver. The deliveries in the enumerator cannot be written to but can have their settled state and disposition updated. Only when this receiver settles on its end are the outgoing delivery instances removed from the unsettled tracking.

Implements Apache.Qpid.Proton.Engine.IReceiver.


The documentation for this class was generated from the following file: