class Rets::ClientProgressReporter

Public Class Methods

new(logger, stats, stats_prefix) click to toggle source
# 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

Public Instance Methods

bad_cached_metadata(cached_metadata) click to toggle source
# File lib/rets/client_progress_reporter.rb, line 44
def bad_cached_metadata(cached_metadata)
  @logger.info cached_metadata ? "Rets::Client: Cached metadata out of date" : "Rets::Client: Cached metadata unavailable"
end
could_not_resolve_find_metadata(key) click to toggle source
# File lib/rets/client_progress_reporter.rb, line 35
def could_not_resolve_find_metadata(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) click to toggle source
# 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) click to toggle source
# 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
no_records_found() click to toggle source
# File lib/rets/client_progress_reporter.rb, line 31
def no_records_found
  @logger.info("Rets::Client: No Records Found")
end
use_cached_metadata() click to toggle source
# File lib/rets/client_progress_reporter.rb, line 40
def use_cached_metadata
  @logger.info "Rets::Client: Use cached metadata"
end