Class: AuditJob
- Inherits:
-
ActiveFedoraIdBasedJob
- Object
- ActiveJob::Base
- ActiveFedoraIdBasedJob
- AuditJob
- Defined in:
- app/jobs/audit_job.rb
Instance Attribute Summary collapse
-
#file_id ⇒ Object
Returns the value of attribute file_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
-
#perform(id, file_id, uri) ⇒ Object
URI of the resource to audit.
Methods inherited from ActiveFedoraIdBasedJob
Instance Attribute Details
#file_id ⇒ Object
Returns the value of attribute file_id.
4 5 6 |
# File 'app/jobs/audit_job.rb', line 4 def file_id @file_id end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'app/jobs/audit_job.rb', line 4 def id @id end |
#uri ⇒ Object
Returns the value of attribute uri.
4 5 6 |
# File 'app/jobs/audit_job.rb', line 4 def uri @uri end |
Instance Method Details
#perform(id, file_id, uri) ⇒ Object
URI of the resource to audit. This URI could include the actual resource (e.g. content) and the version to audit:
http://localhost:8983/fedora/rest/test/a/b/c/abcxyz/content/fcr:versions/version1
but it could also just be:
http://localhost:8983/fedora/rest/test/a/b/c/abcxyz/content
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/jobs/audit_job.rb', line 14 def perform(id, file_id, uri) @id = id @file_id = file_id @uri = uri log = run_audit fixity_ok = log.pass == 1 unless fixity_ok if CurationConcerns.config.callback.set?(:after_audit_failure) login = file_set.depositor user = User.find_by_user_key(login) CurationConcerns.config.callback.run(:after_audit_failure, file_set, user, log.created_at) end end fixity_ok end |