Class: Qpid::Proton::Transfer

Inherits:
Object
  • Object
show all
Includes:
State, Util::Deprecation, Util::Wrapper
Defined in:
lib/core/transfer.rb

Overview

Status of a message transfer on a Link Common base class for Tracker and Delivery.

Direct Known Subclasses

Delivery, Tracker

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

#impl

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Util::Wrapper

included, registry

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

#connectionConnection

Returns The parent connection.

Returns:



86
# File 'lib/core/transfer.rb', line 86

def connection() self.session.connection; end

#idString

Returns Unique ID for the transfer in the context of the #link.

Returns:

  • (String)

    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

#inspectObject



118
# File 'lib/core/transfer.rb', line 118

def inspect() @inspect || super; end

Returns The parent link.

Returns:

  • (Link)

    The parent link.



80
# File 'lib/core/transfer.rb', line 80

def link() Link.wrap(Cproton.pn_delivery_link(@impl)); end

#local_stateObject

Deprecated.

internal use only



108
# File 'lib/core/transfer.rb', line 108

def local_state() Cproton.pn_delivery_local_state(@impl); end

#sessionSession

Returns The parent session.

Returns:

  • (Session)

    The parent session.



83
# File 'lib/core/transfer.rb', line 83

def session() link.session; end

#settle(state = nil) ⇒ Object

Deprecated.

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.

Returns:

  • (Boolean)

    True if the transfer has is remotely settled.



74
# File 'lib/core/transfer.rb', line 74

proton_caller :settled?

#stateInteger

Returns Remote state of the transfer, one of the values in State.

Returns:

  • (Integer)

    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_sObject



119
# File 'lib/core/transfer.rb', line 119

def to_s() inspect; end

#transportTransport

Returns The parent connection’s transport.

Returns:

  • (Transport)

    The parent connection’s transport.



89
# File 'lib/core/transfer.rb', line 89

def transport() self.connection.transport; end

#update(state) ⇒ Object

Deprecated.

internal use only



104
# File 'lib/core/transfer.rb', line 104

def update(state) Cproton.pn_delivery_update(@impl, state); end