Class: Katello::Agent::Connection
- Inherits:
-
Object
- Object
- Katello::Agent::Connection
- Defined in:
- app/lib/katello/agent/connection.rb
Instance Method Summary collapse
- #close ⇒ Object
- #delete_client_queue(queue_name) ⇒ Object
- #fetch_agent_messages(handler = ClientMessageHandler) ⇒ Object
-
#initialize ⇒ Connection
constructor
A new instance of Connection.
- #open? ⇒ Boolean
- #send_messages(messages) ⇒ Object
- #settings ⇒ Object
Constructor Details
#initialize ⇒ Connection
Returns a new instance of Connection.
4 5 6 7 8 9 10 11 |
# File 'app/lib/katello/agent/connection.rb', line 4 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 |
Instance Method Details
#close ⇒ Object
33 34 35 |
# File 'app/lib/katello/agent/connection.rb', line 33 def close @connection.close end |
#delete_client_queue(queue_name) ⇒ Object
21 22 23 |
# File 'app/lib/katello/agent/connection.rb', line 21 def delete_client_queue(queue_name) @connection.delete_queue(queue_name) end |
#fetch_agent_messages(handler = ClientMessageHandler) ⇒ Object
17 18 19 |
# File 'app/lib/katello/agent/connection.rb', line 17 def (handler = ClientMessageHandler) @connection.(address: settings[:event_queue_name], handler: handler) end |
#open? ⇒ Boolean
29 30 31 |
# File 'app/lib/katello/agent/connection.rb', line 29 def open? @connection.open? end |
#send_messages(messages) ⇒ Object
13 14 15 |
# File 'app/lib/katello/agent/connection.rb', line 13 def () @connection.() end |
#settings ⇒ Object
25 26 27 |
# File 'app/lib/katello/agent/connection.rb', line 25 def settings SETTINGS[:katello][:agent] end |