Class: Qpid::Proton::Terminus
- Inherits:
-
Object
- Object
- Qpid::Proton::Terminus
- Extended by:
- Util::SWIGClassHelper
- Includes:
- Util::Deprecation, Util::ErrorHandler
- Defined in:
- lib/core/terminus.rb
Overview
Represents an endpoint for an AMQP connection..
An AMQP terminus acts as either a source or a target for messages, but never as both. Every Link is associated iwth both a source and a target Terminus that is negotiated during link establishment.
A terminus is composed of an AMQP address along with a number of other properties defining the quality of service and behavior of the Link.
Constant Summary collapse
- UNSPECIFIED =
Indicates a non-existent source or target terminus.
Cproton::PN_UNSPECIFIED
- SOURCE =
Indicates a source for messages.
Cproton::PN_SOURCE
- TARGET =
Indicates a target for messages.
Cproton::PN_TARGET
- COORDINATOR =
A special target identifying a transaction coordinator.
Cproton::PN_COORDINATOR
- EXPIRE_WITH_LINK =
The terminus is orphaned when the parent link is closed.
Cproton::PN_EXPIRE_WITH_LINK
- EXPIRE_WITH_SESSION =
The terminus is orphaned whent he parent sessio is closed.
Cproton::PN_EXPIRE_WITH_SESSION
- EXPIRE_WITH_CONNECTION =
The terminus is orphaned when the parent connection is closed.
Cproton::PN_EXPIRE_WITH_CONNECTION
- EXPIRE_NEVER =
The terminus is never considered orphaned.
Cproton::PN_EXPIRE_NEVER
- NONDURABLE =
Indicates a non-durable Terminus.
Cproton::PN_NONDURABLE
- CONFIGURATION =
Indicates a Terminus with durably held configuration, but not the delivery state.
Cproton::PN_CONFIGURATION
- DELIVERIES =
Indicates a Terminus with both durably held configuration and durably held delivery states.
Cproton::PN_DELIVERIES
- DIST_MODE_UNSPECIFIED =
The behavior is defined by the nod.e
Cproton::PN_DIST_MODE_UNSPECIFIED
- DIST_MODE_COPY =
The receiver gets all messages.
Cproton::PN_DIST_MODE_COPY
- DIST_MODE_MOVE =
The receives compete for messages.
Cproton::PN_DIST_MODE_MOVE
- PROTON_METHOD_PREFIX =
"pn_terminus"
Constants included from Util::SWIGClassHelper
Constants included from Util::Deprecation
Util::Deprecation::DEPRECATE_FULL_TRACE, Util::Deprecation::MATCH_DIR
Instance Attribute Summary collapse
-
#address ⇒ String
The terminus address.
-
#distribution_mode ⇒ Integer
The distribution mode.
-
#durability_mode ⇒ Integer
The durability mode of the terminus.
-
#dynamic? ⇒ Boolean
True if the terminus is dynamic.
-
#expiry_policy ⇒ Integer
The expiry policy.
- #impl ⇒ Object readonly
-
#timeout ⇒ Integer
The timeout period.
-
#type ⇒ Integer
The terminus type.
Instance Method Summary collapse
-
#apply(opts = nil) ⇒ Object
Apply options to this terminus.
-
#capabilities ⇒ Data
Access and modify the AMQP capabilities data for the Terminus.
-
#filter ⇒ Data
Access and modify the AMQP filter set for a source terminus.
-
#initialize(impl) ⇒ Terminus
constructor
A new instance of Terminus.
- #inspect ⇒ Object
-
#outcomes ⇒ Data
Access and modify the AMQP outcomes for the Terminus.
-
#properties ⇒ Data
Access and modify the AMQP properties data for the Terminus.
-
#replace(other) ⇒ Object
Replace the data in this Terminus with the contents of
other
. - #to_s ⇒ Object
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 Util::ErrorHandler
#can_raise_error, #check_for_error, #create_exception_handler_wrapper, included
Methods included from Util::Deprecation
deprecated, #deprecated, included
Constructor Details
#initialize(impl) ⇒ Terminus
Returns a new instance of Terminus.
143 144 145 |
# File 'lib/core/terminus.rb', line 143 def initialize(impl) @impl = impl end |
Instance Attribute Details
#address ⇒ String
Returns The terminus address.
87 |
# File 'lib/core/terminus.rb', line 87 proton_set_get :address |
#distribution_mode ⇒ Integer
Returns The distribution mode. Only relevant for a message source.
134 |
# File 'lib/core/terminus.rb', line 134 proton_set_get :distribution_mode |
#durability_mode ⇒ Integer
Returns The durability mode of the terminus.
97 |
# File 'lib/core/terminus.rb', line 97 proton_forward :durability_mode, :get_durability |
#dynamic? ⇒ Boolean
Returns True if the terminus is dynamic.
124 |
# File 'lib/core/terminus.rb', line 124 proton_set_is :dynamic |
#expiry_policy ⇒ Integer
Returns The expiry policy.
112 |
# File 'lib/core/terminus.rb', line 112 proton_set_get :expiry_policy |
#impl ⇒ Object (readonly)
140 141 142 |
# File 'lib/core/terminus.rb', line 140 def impl @impl end |
#timeout ⇒ Integer
Returns The timeout period.
118 |
# File 'lib/core/terminus.rb', line 118 proton_set_get :timeout |
#type ⇒ Integer
Returns The terminus type.
81 |
# File 'lib/core/terminus.rb', line 81 proton_set_get :type |
Instance Method Details
#apply(opts = nil) ⇒ Object
Apply options to this terminus.
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
# File 'lib/core/terminus.rb', line 226 def apply(opts=nil) return unless opts if opts.is_a? String # Shorthand for address self.address = opts else opts.each_pair do |k,v| case k when :address then self.address = v when :dynamic then self.dynamic = !!v when :distribution_mode then self.distribution_mode = v when :durability_mode then self.durability_mode = v when :timeout then self.timeout = v.round # Should be integer seconds when :expiry_policy then self.expiry_policy = v when :filter then self.filter << v when :capabilities then self.capabilities << v end end end end |
#capabilities ⇒ Data
Access and modify the AMQP capabilities data for the Terminus.
This operation will return an instance of Data that is valid until the Terminus is freed due to its parent being freed. Any data contained in the object will be sent as the AMQP properties for the parent Terminus instance.
NOTE: this MUST take the form of a symbol keyed map to be valid.
173 174 175 |
# File 'lib/core/terminus.rb', line 173 def capabilities Codec::Data.new(Cproton.pn_terminus_capabilities(@impl)) end |
#filter ⇒ Data
Access and modify the AMQP filter set for a source terminus. Only relevant for a message source.
This operation will return an instance of Data that is valid until the Terminus is freed due to its parent being freed. Any data contained in the object will be sent as the AMQP properties for the parent Terminus instance.
NOTE: this MUST take the form of a symbol keyed map to be valid.
204 205 206 |
# File 'lib/core/terminus.rb', line 204 def filter Codec::Data.new(Cproton.pn_terminus_filter(@impl)) end |
#inspect ⇒ Object
246 247 248 |
# File 'lib/core/terminus.rb', line 246 def inspect() "\#<#{self.class}: address=#{address.inspect} dynamic?=#{dynamic?.inspect}>" end |
#outcomes ⇒ Data
Access and modify the AMQP outcomes for the Terminus.
This operaiton will return an instance of Data that is valid until the Terminus is freed due to its parent being freed. Any data contained in the object will be sent as the AMQP properties for the parent Terminus instance.
NOTE: this MUST take the form of a symbol keyed map to be valid.
188 189 190 |
# File 'lib/core/terminus.rb', line 188 def outcomes Codec::Data.new(Cproton.pn_terminus_outcomes(@impl)) end |
#properties ⇒ Data
Access and modify the AMQP properties data for the Terminus.
This operation will return an instance of Data that is valid until the Terminus is freed due to its parent being freed. Any data contained in the object will be sent as the AMQP properties for the parent Terminus instance.
NOTE: this MUST take the form of a symbol keyed map to be valid.
158 159 160 |
# File 'lib/core/terminus.rb', line 158 def properties Codec::Data.new(Cproton.pn_terminus_properties(@impl)) end |
#replace(other) ⇒ Object
Replace the data in this Terminus with the contents of other
210 211 212 213 |
# File 'lib/core/terminus.rb', line 210 def replace(other) Cproton.pn_terminus_copy(@impl, other.impl) self end |
#to_s ⇒ Object
250 |
# File 'lib/core/terminus.rb', line 250 def to_s() inspect; end |