Class: Hyrax::Listeners::FileSetLifecycleNotificationListener
- Inherits:
-
Object
- Object
- Hyrax::Listeners::FileSetLifecycleNotificationListener
- Defined in:
- app/services/hyrax/listeners/file_set_lifecycle_notification_listener.rb
Overview
Listens for events related to Hydra Works FileSets and sends notifications where needed.
Instance Method Summary collapse
-
#on_file_set_audited(event) ⇒ void
Send a notification to the depositor for failed checksum audits.
-
#on_file_set_url_imported(event) ⇒ void
Send a notification to the depositing user for FileSet url import failures.
Instance Method Details
#on_file_set_audited(event) ⇒ void
This method returns an undefined value.
Send a notification to the depositor for failed checksum audits.
Called when ‘file.set.audited’ event is published
15 16 17 18 19 20 21 22 23 |
# File 'app/services/hyrax/listeners/file_set_lifecycle_notification_listener.rb', line 15 def on_file_set_audited(event) return unless event[:result] == :failure # do nothing on success Hyrax.logger.error "FIXITY CHECK FAILURE: Fixity failed for #{event[:audit_log]}" Hyrax::FixityCheckFailureService .new(event[:file_set], checksum_audit_log: event[:audit_log]) .call end |
#on_file_set_url_imported(event) ⇒ void
This method returns an undefined value.
Send a notification to the depositing user for FileSet url import failures.
Called when ‘file.set.url.imported’ event is published
32 33 34 35 |
# File 'app/services/hyrax/listeners/file_set_lifecycle_notification_listener.rb', line 32 def on_file_set_url_imported(event) Hyrax::ImportUrlFailureService.new(event[:file_set], event[:user]).call if event[:result] == :failure end |