class Qpid::Proton::Terminus

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.

Constants

CONFIGURATION

Indicates a Terminus with durably held configuration, but not the delivery state.

COORDINATOR

A special target identifying a transaction coordinator.

DELIVERIES

Indicates a Terminus with both durably held configuration and durably held delivery states.

DIST_MODE_COPY

The receiver gets all messages.

DIST_MODE_MOVE

The receives compete for messages.

DIST_MODE_UNSPECIFIED

The behavior is defined by the nod.e

EXPIRE_NEVER

The terminus is never considered orphaned.

EXPIRE_WITH_CONNECTION

The terminus is orphaned when the parent connection is closed.

The terminus is orphaned when the parent link is closed.

EXPIRE_WITH_SESSION

The terminus is orphaned whent he parent sessio is closed.

NONDURABLE

Indicates a non-durable Terminus.

PROTON_METHOD_PREFIX

@private

SOURCE

Indicates a source for messages.

TARGET

Indicates a target for messages.

UNSPECIFIED

Indicates a non-existent source or target terminus.

Attributes

impl[R]

@private

Public Class Methods

new(impl) click to toggle source

@private

# File lib/core/terminus.rb, line 143
def initialize(impl)
  @impl = impl
end

Public Instance Methods

apply(opts=nil) click to toggle source

Apply options to this terminus. @option opts [String] :address the node address @option opts [Boolean] :dynamic (false)

if true, request a new node with a unique address to be created. +:address+ is ignored.

@option opts [Integer] :distribution_mode see {#distribution_mode}, only for source nodes @option opts [Integer] :durability_mode see {#durability_mode} @option opts [Integer] :timeout see {#timeout} @option opts [Integer] :expiry_policy see {#expiry_policy} @option opts [Hash] :filter see {#filter}, only for source nodes @option opts [Hash] :capabilities see {#capabilities}

# 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() click to toggle source

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.

@return [Data] The terminus capabilities.

# File lib/core/terminus.rb, line 173
def capabilities
  Codec::Data.new(Cproton.pn_terminus_capabilities(@impl))
end
filter() click to toggle source

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.

@return [Data] The terminus filter.

# File lib/core/terminus.rb, line 204
def filter
  Codec::Data.new(Cproton.pn_terminus_filter(@impl))
end
inspect() click to toggle source
# File lib/core/terminus.rb, line 246
def inspect()
  "\#<#{self.class}: address=#{address.inspect} dynamic?=#{dynamic?.inspect}>"
end
outcomes() click to toggle source

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.

@return [Data] The terminus outcomes.

# File lib/core/terminus.rb, line 188
def outcomes
  Codec::Data.new(Cproton.pn_terminus_outcomes(@impl))
end
properties() click to toggle source

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.

@return [Data] The terminus properties.

# File lib/core/terminus.rb, line 158
def properties
  Codec::Data.new(Cproton.pn_terminus_properties(@impl))
end
replace(other) click to toggle source

Replace the data in this Terminus with the contents of other @param other [Terminus] The other instance.

# File lib/core/terminus.rb, line 210
def replace(other)
  Cproton.pn_terminus_copy(@impl, other.impl)
  self
end
to_s() click to toggle source
# File lib/core/terminus.rb, line 250
def to_s() inspect; end