Sha256: e381fe70c8a933a12ba2925b9cd99d6c62ca2949176256137ea9f901804d24b3

Contents?: true

Size: 895 Bytes

Versions: 73

Compression:

Stored size: 895 Bytes

Contents

module Katello
  module Agent
    class Connection
      def initialize
        @connection = ::Katello::Qpid::Connection.new(
          url: settings[:broker_url],
          ssl_cert_file: settings[:broker_ssl_cert_file],
          ssl_key_file: settings[:broker_ssl_key_file],
          ssl_ca_file: settings[:broker_ssl_ca_file]
        )
      end

      def send_messages(messages)
        @connection.send_messages(messages)
      end

      def fetch_agent_messages(handler = ClientMessageHandler)
        @connection.receive_messages(address: settings[:event_queue_name], handler: handler)
      end

      def delete_client_queue(queue_name)
        @connection.delete_queue(queue_name)
      end

      def settings
        SETTINGS[:katello][:agent]
      end

      def open?
        @connection.open?
      end

      def close
        @connection.close
      end
    end
  end
end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
katello-4.1.2 app/lib/katello/agent/connection.rb
katello-4.1.1 app/lib/katello/agent/connection.rb
katello-4.1.0 app/lib/katello/agent/connection.rb
katello-4.0.1.2 app/lib/katello/agent/connection.rb
katello-4.1.0.rc2.2 app/lib/katello/agent/connection.rb
katello-4.1.0.rc2.1 app/lib/katello/agent/connection.rb
katello-4.0.1.1 app/lib/katello/agent/connection.rb
katello-4.1.0.rc2 app/lib/katello/agent/connection.rb
katello-4.0.1 app/lib/katello/agent/connection.rb
katello-4.1.0.rc1.1 app/lib/katello/agent/connection.rb
katello-4.1.0.rc1 app/lib/katello/agent/connection.rb
katello-4.0.0 app/lib/katello/agent/connection.rb
katello-4.0.0.rc3.1 app/lib/katello/agent/connection.rb