Class: Qpid::Proton::Transfer

Inherits:
Object
  • Object
show all
Includes:
Disposition::State
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

Constant Summary collapse

PROTON_METHOD_PREFIX =
"pn_delivery"
State =
Disposition::State

Constants included from Disposition::State

Disposition::State::ACCEPTED, Disposition::State::MODIFIED, Disposition::State::RECEIVED, Disposition::State::REJECTED, Disposition::State::RELEASED

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Disposition::State::ClassMethods

#name_of

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)



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:



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

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



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

def id() Cproton.pn_delivery_tag(@impl); end

#inspect



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

def inspect() @inspect || super; end

Returns The parent link.

Returns:

  • (Link)

    The parent link.



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

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

#local_state

Deprecated.

internal use only



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

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

#sessionSession

Returns The parent session.

Returns:

  • (Session)

    The parent session.



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

def session() link.session; end

#settle(state = nil)

Deprecated.

internal use only



96
97
98
99
100
# File 'lib/core/transfer.rb', line 96

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 is remotely settled.

Returns:

  • (Boolean)

    True if the transfer is remotely settled.



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

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



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

def state() Cproton.pn_delivery_remote_state(@impl); end

#to_s



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

def to_s() inspect; end

#transportTransport

Returns The parent connection’s transport.

Returns:

  • (Transport)

    The parent connection’s transport.



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

def transport() self.connection.transport; end

#update(state)

Deprecated.

internal use only



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

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

#work_queueWorkQueue

Returns The parent connection’s work-queue.

Returns:

  • (WorkQueue)

    The parent connection’s work-queue.



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

def work_queue() self.connection.work_queue; end