Class: Qpid::Proton::Disposition

Inherits:
Object
  • Object
show all
Extended by:
Util::SWIGClassHelper
Includes:
State, Util::Deprecation
Defined in:
lib/core/disposition.rb

Defined Under Namespace

Modules: State

Constant Summary collapse

PROTON_METHOD_PREFIX =
"pn_disposition"

Constants included from Util::SWIGClassHelper

Util::SWIGClassHelper::RBCTX

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 collapse

Instance Method Summary collapse

Methods included from Util::SWIGClassHelper

fetch_instance, get_key, proton_caller, proton_forward, proton_get, proton_is, proton_set, proton_set_get, proton_set_is, store_instance

Methods included from State

included

Methods included from State::ClassMethods

#name_of

Methods included from Util::Deprecation

deprecated, #deprecated, included

Constructor Details

#initialize(impl, local) ⇒ Disposition

Returns a new instance of Disposition.



58
59
60
61
62
63
64
65
# File 'lib/core/disposition.rb', line 58

def initialize(impl, local)
  deprecated self.class, Delivery
  @impl = impl
  @local = local
  @data = nil
  @condition = nil
  @annotations = nil
end

Instance Attribute Details

#failed?Boolean

Returns The failed flag.

Returns:

  • (Boolean)

    The failed flag.



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

proton_set_is :failed

#implObject (readonly)



55
56
57
# File 'lib/core/disposition.rb', line 55

def impl
  @impl
end

#section_numberInteger

Returns The section number of the disposition.

Returns:

  • (Integer)

    The section number of the disposition.



71
# File 'lib/core/disposition.rb', line 71

proton_set_get :section_number

#section_offsetInteger

Returns The section offset of the disposition.

Returns:

  • (Integer)

    The section offset of the disposition.



77
# File 'lib/core/disposition.rb', line 77

proton_set_get :section_offset

#undeliverable?Boolean

Returns The undeliverable flag.

Returns:

  • (Boolean)

    The undeliverable flag.



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

proton_set_is :undeliverable

Instance Method Details

#annotationsCodec::Data

Returns the annotations for the disposition.

Returns:



129
130
131
132
133
134
135
# File 'lib/core/disposition.rb', line 129

def annotations
  if @local
    @annotations
  else
    Codec::Data.to_object(Cproton.pn_disposition_annotations(@impl))
  end
end

#annotations=(annotations) ⇒ Object

Sets the annotations for the disposition.

Parameters:

Raises:



120
121
122
123
# File 'lib/core/disposition.rb', line 120

def annotations=(annotations)
  raise AttributeError.new("annotations attribute is read-only") unless @local
  @annotations = annotations
end

#conditionCodec::Data

Returns the condition of the disposition.

Returns:



152
153
154
155
156
157
158
# File 'lib/core/disposition.rb', line 152

def condition
  if @local
    @condition
  else
    Condition.convert(Cproton.pn_disposition_condition(@impl))
  end
end

#condition=(condition) ⇒ Object

Parameters:

Raises:



143
144
145
146
# File 'lib/core/disposition.rb', line 143

def condition=(condition)
  raise AttributeError.new("condition attribute is read-only") unless @local
  @condition = condition
end

#dataCodec::Data

Returns the data for the disposition.

Returns:



106
107
108
109
110
111
112
# File 'lib/core/disposition.rb', line 106

def data
  if @local
    @data
  else
    Codec::Data.to_object(Cproton.pn_disposition_data(@impl))
  end
end

#data=(data) ⇒ Object

Sets the data for the disposition.

Parameters:

Raises:



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

def data=(data)
  raise AttributeError.new("data attribute is read-only") unless @local
  @data = data
end