Class: Katello::Candlepin::EventHandler
- Inherits:
-
Object
- Object
- Katello::Candlepin::EventHandler
- Defined in:
- app/services/katello/candlepin/event_handler.rb
Instance Attribute Summary collapse
-
#message_handler ⇒ Object
readonly
Returns the value of attribute message_handler.
Instance Method Summary collapse
- #handle(message) ⇒ Object
-
#initialize(logger) ⇒ EventHandler
constructor
A new instance of EventHandler.
Constructor Details
#initialize(logger) ⇒ EventHandler
Returns a new instance of EventHandler.
6 7 8 |
# File 'app/services/katello/candlepin/event_handler.rb', line 6 def initialize(logger) @logger = logger end |
Instance Attribute Details
#message_handler ⇒ Object (readonly)
Returns the value of attribute message_handler.
4 5 6 |
# File 'app/services/katello/candlepin/event_handler.rb', line 4 def @message_handler end |
Instance Method Details
#handle(message) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/services/katello/candlepin/event_handler.rb', line 10 def handle() ::User.current = ::User.anonymous_admin Katello::Logging.time("candlepin event handled", logger: @logger) do |data| data[:subject] = .subject @message_handler = ::Katello::Candlepin::MessageHandler.new() data[:entity_id] = @message_handler.entity_id case .subject when /pool\.created/ .import_pool when /pool\.deleted/ .delete_pool end end end |