Class: Robots::SdrRepo::SdrRecovery::RecoveryVerify

Inherits:
Robots::SdrRepo::SdrRobot show all
Defined in:
lib/sdr_recovery/recovery_verify.rb

Overview

Robot for validating recovered object versions

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 = {}) ⇒ RecoveryVerify

Returns set workflow name, step name, log location, log severity level


16
17
18
# File 'lib/sdr_recovery/recovery_verify.rb', line 16

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

Instance Method Details

#perform(druid) ⇒ void

This method returns an undefined value.

Returns process an object from the queue through this robot See LyberCore::Robot#work

Parameters:

  • druid (String)

    The item to be processed


23
24
25
26
# File 'lib/sdr_recovery/recovery_verify.rb', line 23

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

#recovery_verify(druid) ⇒ Boolean

Returns Verify the bag containing the digital object

Parameters:

  • druid (String)

    The object identifier

Returns:

  • (Boolean)

    Verify the bag containing the digital object


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

def recovery_verify(druid)
  LyberCore::Log.debug("( #{__FILE__} : #{__LINE__} ) Enter recovery_verify")
  recovery_path = Pathname(Sdr::Config.sdr_recovery_home).join(druid.sub('druid:', ''))
  recovery_object = Moab::StorageObject.new(druid, recovery_path)
  result = recovery_object.verify_object_storage
  if result.verified == false
    LyberCore::Log.info result.to_json(verbose=false)
    raise ItemError.new("Failed verification")
  end
  true
end

#verification_files(druid) ⇒ Object


47
48
49
50
# File 'lib/sdr_recovery/recovery_verify.rb', line 47

def verification_files(druid)
  files = []
  files
end

#verification_queries(druid) ⇒ Object


42
43
44
45
# File 'lib/sdr_recovery/recovery_verify.rb', line 42

def verification_queries(druid)
  queries = []
  queries
end