Sha256: 9351c539273514a37342b456361f1f1688d0b9c6d5e6e8e5e9a514a56b9145da

Contents?: true

Size: 747 Bytes

Versions: 24

Compression:

Stored size: 747 Bytes

Contents

module Ddr
  module Events
    class FixityCheckEvent < Event

      include PreservationEventBehavior
      include ReindexObjectAfterSave

      self.preservation_event_type = :fix
      self.description = "Fixity check of attached files".freeze

      # Message sent by ActiveSupport::Notifications
      def self.call(*args)
        super do |payload|
          results = payload.delete(:results)
          payload[:outcome] = results.success? ? SUCCESS : FAILURE
          payload[:detail] = "Fixity check results:\n\n#{results}"
        end
      end

      def to_solr
        { Ddr::Index::Fields::LAST_FIXITY_CHECK_ON => event_date_time_s,
          Ddr::Index::Fields::LAST_FIXITY_CHECK_OUTCOME => outcome }
      end

    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
ddr-models-3.0.8 lib/ddr/events/fixity_check_event.rb
ddr-models-3.0.7 lib/ddr/events/fixity_check_event.rb
ddr-models-3.0.6 lib/ddr/events/fixity_check_event.rb
ddr-models-3.0.5 lib/ddr/events/fixity_check_event.rb
ddr-models-3.0.4 lib/ddr/events/fixity_check_event.rb
ddr-models-3.0.3 lib/ddr/events/fixity_check_event.rb
ddr-models-3.0.2 lib/ddr/events/fixity_check_event.rb
ddr-models-3.0.1 lib/ddr/events/fixity_check_event.rb
ddr-models-3.0.0 lib/ddr/events/fixity_check_event.rb
ddr-models-3.0.0.rc6 lib/ddr/events/fixity_check_event.rb
ddr-models-3.0.0.rc5 lib/ddr/events/fixity_check_event.rb
ddr-models-3.0.0.rc4 lib/ddr/events/fixity_check_event.rb
ddr-models-3.0.0.rc3 lib/ddr/events/fixity_check_event.rb
ddr-models-3.0.0.rc2 lib/ddr/events/fixity_check_event.rb
ddr-models-3.0.0.rc1 lib/ddr/events/fixity_check_event.rb
ddr-models-3.0.0.beta.22 lib/ddr/events/fixity_check_event.rb
ddr-models-3.0.0.beta.21 lib/ddr/events/fixity_check_event.rb
ddr-models-3.0.0.beta.20 lib/ddr/events/fixity_check_event.rb
ddr-models-3.0.0.beta.18 lib/ddr/events/fixity_check_event.rb
ddr-models-3.0.0.beta.17 lib/ddr/events/fixity_check_event.rb