Class: Robots::SdrRepo::SdrAudit::AuditVerify

Inherits:
Robots::SdrRepo::SdrRobot show all
Defined in:
lib/sdr_audit/audit_verify.rb

Overview

Robot for validating storage objects

Instance Method Summary collapse

Methods inherited from Robots::SdrRepo::SdrRobot

#create_workflow_rows, #get_workflow_status, #get_workflow_xml, #process_item, #transmit, #update_workflow_error_status, #update_workflow_status

Constructor Details

#initialize(opts = {}) ⇒ AuditVerify


16
17
18
# File 'lib/sdr_audit/audit_verify.rb', line 16

def initialize(opts = {})
  super(self.class.workflow_name, self.class.step_name, opts)
end

Instance Method Details

#audit_verify(druid) ⇒ Boolean


30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/sdr_audit/audit_verify.rb', line 30

def audit_verify(druid)
  LyberCore::Log.debug("( #{__FILE__} : #{__LINE__} ) Enter audit_verify")
  storage_object = Moab::StorageServices.storage_object(druid, create=false)
  result = storage_object.verify_object_storage
  if result.verified
    LyberCore::Log.info "Verification Result:\n" + result.to_json(verbose=Sdr::Config.audit_verbose)
  else
    LyberCore::Log.info "Verification Result:\n" + result.to_json(verbose=false)
    raise ItemError.new("Failed verification")
  end
  true
end

#perform(druid) ⇒ void


23
24
25
26
# File 'lib/sdr_audit/audit_verify.rb', line 23

def perform(druid)
  LyberCore::Log.debug("( #{__FILE__} : #{__LINE__} ) Enter perform")
  audit_verify(druid)
end

#verification_files(druid) ⇒ Object


48
49
50
51
52
53
# File 'lib/sdr_audit/audit_verify.rb', line 48

def verification_files(druid)
  deposit_bag_pathname = find_deposit_pathname(druid)
  files = []
  files << deposit_bag_pathname.join("bag-info.txt").to_s
  files
end

#verification_queries(druid) ⇒ Object


43
44
45
46
# File 'lib/sdr_audit/audit_verify.rb', line 43

def verification_queries(druid)
  queries = []
  queries
end