Class: Qpid::Proton::Transfer
- Inherits:
-
Object
- Object
- Qpid::Proton::Transfer
- Includes:
- State, Util::Deprecation, Util::Wrapper
- Defined in:
- lib/core/transfer.rb
Overview
Defined Under Namespace
Modules: State
Constant Summary collapse
- PROTON_METHOD_PREFIX =
"pn_delivery"
Constants included from State
State::ACCEPTED, State::MODIFIED, State::RECEIVED, State::REJECTED, State::RELEASED
Constants included from Util::Deprecation
Util::Deprecation::DEPRECATE_FULL_TRACE, Util::Deprecation::MATCH_DIR
Instance Attribute Summary
Attributes included from Util::Wrapper
Class Method Summary collapse
Instance Method Summary collapse
-
#connection ⇒ Connection
The parent connection.
-
#id ⇒ String
Unique ID for the transfer in the context of the #link.
-
#initialize(impl) ⇒ Transfer
constructor
A new instance of Transfer.
- #inspect ⇒ Object
-
#link ⇒ Link
The parent link.
-
#local_state ⇒ Object
deprecated
Deprecated.
internal use only
-
#session ⇒ Session
The parent session.
-
#settle(state = nil) ⇒ Object
deprecated
Deprecated.
internal use only
-
#settled? ⇒ Boolean
True if the transfer has is remotely settled.
-
#state ⇒ Integer
Remote state of the transfer, one of the values in State.
- #to_s ⇒ Object
-
#transport ⇒ Transport
The parent connection’s transport.
-
#update(state) ⇒ Object
deprecated
Deprecated.
internal use only
Methods included from Util::Wrapper
Methods included from Util::Deprecation
deprecated, #deprecated, included
Constructor Details
#initialize(impl) ⇒ Transfer
Returns a new instance of Transfer.
37 38 39 40 41 |
# File 'lib/core/transfer.rb', line 37 def initialize(impl) @impl = impl @inspect = nil self.class.store_instance(self, :pn_delivery_attachments) end |
Class Method Details
.wrap(impl) ⇒ Object
31 32 33 34 35 |
# File 'lib/core/transfer.rb', line 31 def self.wrap(impl) return unless impl self.fetch_instance(impl, :pn_delivery_attachments) || (Cproton.pn_link_is_sender(Cproton.pn_delivery_link(impl)) ? Tracker : Delivery).new(impl) end |
Instance Method Details
#connection ⇒ Connection
Returns The parent connection.
86 |
# File 'lib/core/transfer.rb', line 86 def connection() self.session.connection; end |
#id ⇒ String
Returns Unique ID for the transfer in the context of the #link.
68 |
# File 'lib/core/transfer.rb', line 68 def id() Cproton.pn_delivery_tag(@impl); end |
#inspect ⇒ Object
118 |
# File 'lib/core/transfer.rb', line 118 def inspect() @inspect || super; end |
#link ⇒ Link
Returns The parent link.
80 |
# File 'lib/core/transfer.rb', line 80 def link() Link.wrap(Cproton.pn_delivery_link(@impl)); end |
#local_state ⇒ Object
internal use only
108 |
# File 'lib/core/transfer.rb', line 108 def local_state() Cproton.pn_delivery_local_state(@impl); end |
#session ⇒ Session
Returns The parent session.
83 |
# File 'lib/core/transfer.rb', line 83 def session() link.session; end |
#settle(state = nil) ⇒ Object
internal use only
112 113 114 115 116 |
# File 'lib/core/transfer.rb', line 112 def settle(state = nil) update(state) unless state.nil? Cproton.pn_delivery_settle(@impl) @inspect = inspect # Save the inspect string, the delivery pointer will go bad. end |
#settled? ⇒ Boolean
Returns True if the transfer has is remotely settled.
74 |
# File 'lib/core/transfer.rb', line 74 proton_caller :settled? |
#state ⇒ Integer
Returns Remote state of the transfer, one of the values in State.
77 |
# File 'lib/core/transfer.rb', line 77 def state() Cproton.pn_delivery_remote_state(@impl); end |
#to_s ⇒ Object
119 |
# File 'lib/core/transfer.rb', line 119 def to_s() inspect; end |
#transport ⇒ Transport
Returns The parent connection’s transport.
89 |
# File 'lib/core/transfer.rb', line 89 def transport() self.connection.transport; end |
#update(state) ⇒ Object
internal use only
104 |
# File 'lib/core/transfer.rb', line 104 def update(state) Cproton.pn_delivery_update(@impl, state); end |