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 25 26 27 28 29 30 31 32 33 34 35 36 |
# 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 /entitlement\.created/ .import_pool .create_pool_on_host when /entitlement\.deleted/ .import_pool .remove_pool_from_host when /pool\.created/ .import_pool when /pool\.deleted/ .delete_pool when /^compliance\.created/ reindex_subscription_status when /system_purpose_compliance\.created/ reindex_purpose_status when /owner_content_access_mode\.modified/ .handle_content_access_mode_modified end end end |