Class: Rox::Core::ConfigurationFetcherRoxy

Inherits:
ConfigurationFetcherBase show all
Defined in:
lib/rox/core/network/configuration_fetcher_roxy.rb

Instance Method Summary collapse

Methods inherited from ConfigurationFetcherBase

#initialize, #write_fetch_error_to_log_and_invoke_fetch_handler, #write_fetch_exception_to_log_and_invoke_fetch_handler

Constructor Details

This class inherits a constructor from Rox::Core::ConfigurationFetcherBase

Instance Method Details

#fetchObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/rox/core/network/configuration_fetcher_roxy.rb', line 8

def fetch
  source = ConfigurationSource::ROXY
  begin
    fetch_roxy = fetch_from_roxy
    if fetch_roxy.success_status_code?
      return ConfigurationFetchResult.new(fetch_roxy.text, source)
    else
      write_fetch_error_to_log_and_invoke_fetch_handler(source, fetch_roxy)
    end
  rescue StandardError => ex
    write_fetch_exception_to_log_and_invoke_fetch_handler(source, ex)
  end

  nil
end

#fetch_from_roxyObject



24
25
26
# File 'lib/rox/core/network/configuration_fetcher_roxy.rb', line 24

def fetch_from_roxy
  @request.send_get(@request_configuration_builder.build_for_roxy)
end