Class: Rets::ClientProgressReporter

Inherits:
Object
  • Object
show all
Defined in:
lib/rets/client_progress_reporter.rb

Instance Method Summary collapse

Constructor Details

#initialize(logger, stats, stats_prefix) ⇒ ClientProgressReporter

Returns a new instance of ClientProgressReporter.



15
16
17
18
19
# File 'lib/rets/client_progress_reporter.rb', line 15

def initialize(logger, stats, stats_prefix)
  @logger = logger
  @stats = stats || NullStatsReporter.new
  @stats_prefix = stats_prefix
end

Instance Method Details

#bad_cached_metadata(cached_metadata) ⇒ Object



44
45
46
# File 'lib/rets/client_progress_reporter.rb', line 44

def ()
  @logger.info  ? "Rets::Client: Cached metadata out of date" : "Rets::Client: Cached metadata unavailable"
end

#could_not_resolve_find_metadata(key) ⇒ Object



35
36
37
38
# File 'lib/rets/client_progress_reporter.rb', line 35

def (key)
  @stats.count("#{@stats_prefix}could_not_resolve_find_metadata")
  @logger.warn "Rets::Client: Can't resolve find metadata for #{key.inspect}"
end

#find_with_retries_exceeded_retry_count(exception) ⇒ Object



27
28
29
# File 'lib/rets/client_progress_reporter.rb', line 27

def find_with_retries_exceeded_retry_count(exception)
  @stats.count("#{@stats_prefix}find_with_retries_exceeded_retry_count")
end

#find_with_retries_failed_a_retry(exception, retries, max_retries) ⇒ Object



21
22
23
24
25
# File 'lib/rets/client_progress_reporter.rb', line 21

def find_with_retries_failed_a_retry(exception, retries, max_retries)
  @stats.count("#{@stats_prefix}find_with_retries_failed_retry")
  @logger.warn("Rets::Client: Failed with message: #{exception.message}")
  @logger.info("Rets::Client: Retry #{retries}/#{max_retries}")
end

#loginObject



48
49
50
# File 'lib/rets/client_progress_reporter.rb', line 48

def 
  @stats.count("#{@stats_prefix}login")
end

#no_records_foundObject



31
32
33
# File 'lib/rets/client_progress_reporter.rb', line 31

def no_records_found
  @logger.info("Rets::Client: No Records Found")
end

#use_cached_metadataObject



40
41
42
# File 'lib/rets/client_progress_reporter.rb', line 40

def 
  @logger.info "Rets::Client: Use cached metadata"
end