Class: Actions::Candlepin::ImportPoolHandler
- Inherits:
-
Object
- Object
- Actions::Candlepin::ImportPoolHandler
- Defined in:
- app/lib/actions/candlepin/import_pool_handler.rb
Instance Method Summary collapse
- #handle(message) ⇒ Object
-
#initialize(logger) ⇒ ImportPoolHandler
constructor
A new instance of ImportPoolHandler.
Constructor Details
#initialize(logger) ⇒ ImportPoolHandler
Returns a new instance of ImportPoolHandler.
20 21 22 |
# File 'app/lib/actions/candlepin/import_pool_handler.rb', line 20 def initialize(logger) @logger = logger end |
Instance Method Details
#handle(message) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'app/lib/actions/candlepin/import_pool_handler.rb', line 24 def handle() @logger.debug("message received from subscriptions queue ") @logger.debug("message subject: #{.subject}") ::User.current = ::User.anonymous_admin = MessageWrapper.new() case .subject when /entitlement\.created/ import_pool(.content['referenceId']) when /entitlement\.deleted/ import_or_remove_pool(.content['referenceId']) when /pool\.created/ import_pool(.content['entityId']) when /pool\.deleted/ remove_pool(.content['entityId']) when /compliance\.created/ reindex_consumer() end end |