Class: Qpid::Proton::Delivery
- Inherits:
-
Object
- Object
- Qpid::Proton::Delivery
- Includes:
- Util::Engine, Util::SwigHelper, Util::Wrapper
- Defined in:
- lib/core/delivery.rb
Overview
A Delivery maintains detail on the delivery of data to an endpoint.
A Delivery has a single parent Qpid::Proton::Link
Constant Summary collapse
- PROTON_METHOD_PREFIX =
"pn_delivery"
Instance Attribute Summary collapse
-
#buffered? ⇒ Boolean
readonly
A delivery that is buffered has not yet been written to the wire.
-
#partial? ⇒ Boolean
readonly
Returns if the delivery has only partial message data.
-
#pending ⇒ Fixnum
readonly
delivery.
-
#readable? ⇒ Boolean
readonly
A delivery is considered readable if it is the current delivery on an incoming link.
-
#settled? ⇒ Boolean
readonly
Returns if the delivery is remotely settled.
-
#tag ⇒ String
readonly
The tag for the delivery.
-
#updated? ⇒ Boolean
readonly
A delivery is considered updated whenever the peer communicates a new disposition for the dlievery.
-
#writable? ⇒ Boolean
readonly
A delivery is considered writable if it is the current delivery on an outgoing link, and the link has positive credit.
Class Method Summary collapse
Instance Method Summary collapse
-
#clear ⇒ Object
Clear the updated flag for a delivery.
-
#connection ⇒ Connection
Returns the parent connection.
-
#dump ⇒ Object
Utility function for printing details of a delivery.
-
#initialize(impl) ⇒ Delivery
constructor
A new instance of Delivery.
-
#link ⇒ Link
Returns the parent link.
- #local_accepted? ⇒ Boolean
- #local_modified? ⇒ Boolean
- #local_received? ⇒ Boolean
- #local_rejected? ⇒ Boolean
- #local_released? ⇒ Boolean
-
#local_state ⇒ Disposition
Returns the local disposition state for the delivery.
- #remote_accepted? ⇒ Boolean
- #remote_modified? ⇒ Boolean
- #remote_received? ⇒ Boolean
- #remote_rejected? ⇒ Boolean
- #remote_released? ⇒ Boolean
-
#remote_state ⇒ Disposition
Returns the remote disposition state for the delivery.
-
#session ⇒ Session
Returns the parent session.
-
#settle ⇒ Object
Settles a delivery.
-
#transport ⇒ Transport
Returns the parent transport.
- #update(state) ⇒ Object
-
#work_next ⇒ Delivery?
Returns the next delivery on the connection that has pending operations.
Methods included from Util::Engine
#condition_to_object, #data_to_object, #object_to_condition, #object_to_data, receive_message
Methods included from Util::SwigHelper
Methods included from Util::Wrapper
#impl, #impl=, included, registry
Constructor Details
#initialize(impl) ⇒ Delivery
Returns a new instance of Delivery.
51 52 53 54 55 56 |
# File 'lib/core/delivery.rb', line 51 def initialize(impl) @impl = impl @local = Disposition.new(Cproton.pn_delivery_local(impl), true) @remote = Disposition.new(Cproton.pn_delivery_remote(impl), false) self.class.store_instance(self, :pn_delivery_attachments) end |
Instance Attribute Details
#buffered? ⇒ Boolean (readonly)
A delivery that is buffered has not yet been written to the wire.
Note that returning false does not imply that a delivery was definitely written to the wire. If false is returned, it is not known whether the delivery was actually written to the wire or not.
149 |
# File 'lib/core/delivery.rb', line 149 proton_caller :buffered? |
#partial? ⇒ Boolean (readonly)
Returns if the delivery has only partial message data.
116 |
# File 'lib/core/delivery.rb', line 116 proton_caller :partial? |
#pending ⇒ Fixnum (readonly)
delivery.
110 |
# File 'lib/core/delivery.rb', line 110 proton_caller :pending |
#readable? ⇒ Boolean (readonly)
A delivery is considered readable if it is the current delivery on an incoming link.
86 |
# File 'lib/core/delivery.rb', line 86 proton_caller :readable? |
#settled? ⇒ Boolean (readonly)
Returns if the delivery is remotely settled.
122 |
# File 'lib/core/delivery.rb', line 122 proton_caller :settled? |
#tag ⇒ String (readonly)
Returns The tag for the delivery.
68 |
# File 'lib/core/delivery.rb', line 68 proton_caller :tag |
#updated? ⇒ Boolean (readonly)
A delivery is considered updated whenever the peer communicates a new disposition for the dlievery. Once a delivery becomes updated, it will remain so until cleared.
97 |
# File 'lib/core/delivery.rb', line 97 proton_caller :updated? |
#writable? ⇒ Boolean (readonly)
A delivery is considered writable if it is the current delivery on an outgoing link, and the link has positive credit.
77 |
# File 'lib/core/delivery.rb', line 77 proton_caller :writable? |
Class Method Details
Instance Method Details
#clear ⇒ Object
Clear the updated flag for a delivery.
103 |
# File 'lib/core/delivery.rb', line 103 proton_caller :clear |
#connection ⇒ Connection
Returns the parent connection.
207 208 209 |
# File 'lib/core/delivery.rb', line 207 def connection self.session.connection end |
#dump ⇒ Object
Utility function for printing details of a delivery.
137 |
# File 'lib/core/delivery.rb', line 137 proton_caller :dump |
#link ⇒ Link
Returns the parent link.
191 192 193 |
# File 'lib/core/delivery.rb', line 191 def link Link.wrap(Cproton.pn_delivery_link(@impl)) end |
#local_accepted? ⇒ Boolean
230 231 232 |
# File 'lib/core/delivery.rb', line 230 def local_accepted? self.local_state == Disposition::ACCEPTED end |
#local_modified? ⇒ Boolean
260 261 262 |
# File 'lib/core/delivery.rb', line 260 def local_modified? self.local_state == Disposition::MODIFIED end |
#local_received? ⇒ Boolean
220 221 222 |
# File 'lib/core/delivery.rb', line 220 def local_received? self.local_state == Disposition::RECEIVED end |
#local_rejected? ⇒ Boolean
240 241 242 |
# File 'lib/core/delivery.rb', line 240 def local_rejected? self.local_state == Disposition::REJECTED end |
#local_released? ⇒ Boolean
250 251 252 |
# File 'lib/core/delivery.rb', line 250 def local_released? self.local_state == Disposition::RELEASED end |
#local_state ⇒ Disposition
Returns the local disposition state for the delivery.
165 166 167 |
# File 'lib/core/delivery.rb', line 165 def local_state Cproton.pn_delivery_local_state(@impl) end |
#remote_accepted? ⇒ Boolean
235 236 237 |
# File 'lib/core/delivery.rb', line 235 def remote_accepted? self.remote_state == Disposition::ACCEPTED end |
#remote_modified? ⇒ Boolean
265 266 267 |
# File 'lib/core/delivery.rb', line 265 def remote_modified? self.remote_state == Disposition::MODIFIED end |
#remote_received? ⇒ Boolean
225 226 227 |
# File 'lib/core/delivery.rb', line 225 def remote_received? self.remote_state == Disposition::RECEIVED end |
#remote_rejected? ⇒ Boolean
245 246 247 |
# File 'lib/core/delivery.rb', line 245 def remote_rejected? self.remote_state == Disposition::REJECTED end |
#remote_released? ⇒ Boolean
255 256 257 |
# File 'lib/core/delivery.rb', line 255 def remote_released? self.remote_state == Disposition::RELEASED end |
#remote_state ⇒ Disposition
Returns the remote disposition state for the delivery.
173 174 175 |
# File 'lib/core/delivery.rb', line 173 def remote_state Cproton.pn_delivery_remote_state(@impl) end |
#session ⇒ Session
Returns the parent session.
199 200 201 |
# File 'lib/core/delivery.rb', line 199 def session self.link.session end |
#settle ⇒ Object
Settles a delivery.
A settled delivery can never be used again.
131 |
# File 'lib/core/delivery.rb', line 131 proton_caller :settle |
#transport ⇒ Transport
Returns the parent transport.
215 216 217 |
# File 'lib/core/delivery.rb', line 215 def transport self.connection.transport end |
#update(state) ⇒ Object
153 154 155 156 157 158 159 |
# File 'lib/core/delivery.rb', line 153 def update(state) impl = @local.impl object_to_data(@local.data, Cproton.pn_disposition_data(impl)) object_to_data(@local.annotations, Cproton.pn_disposition_annotations(impl)) object_to_data(@local.condition, Cproton.pn_disposition_condition(impl)) Cproton.pn_delivery_update(@impl, state) end |