lib/wmap/host_tracker.rb
# Setter to refresh the entry from the cache one at a time
Setter to refresh the entry from the cache one at a time
Setter to refresh the entry from the cache one at a time
def refresh(host)
		puts "Refresh the local host repository for host: #{host} "
		host=host.strip.downcase
		if @known_hosts.key?(host)
			old_ip=@known_hosts[host]
			new_ip=host_2_ip(host)
			if is_ip?(new_ip)
				if old_ip==new_ip
					puts "No change for the host entry: #{host}\t#{old_ip}"
					return nil
				else
					@known_hosts[host]=new_ip
					@known_hosts[new_ip]=host
					puts "Entry refreshed: #{host}\t#{@known_hosts[host]}"
					return host
				end
			else
				puts "Host can no longer be resolved in the Internet. Entry removed: #{host}\t#{@known_hosts[host]}"
				@known_hosts.delete(host)
				return host
			end
		else
			puts "Error entry non exist: #{host}"
		end
	rescue => ee
		puts "Exception on method #{__method__}: #{ee}"
	end
def refresh ( host ) puts "Refresh the local host repository for host: #{host} " host = host . strip . downcase if @known_hosts . key? ( host ) old_ip = @known_hosts [ host ] new_ip = host_2_ip ( host ) if is_ip? ( new_ip ) if old_ip == new_ip puts "No change for the host entry: #{host}\t#{old_ip}" return nil else @known_hosts [ host ] = new_ip @known_hosts [ new_ip ] = host puts "Entry refreshed: #{host}\t#{@known_hosts[host]}" return host end else puts "Host can no longer be resolved in the Internet. Entry removed: #{host}\t#{@known_hosts[host]}" @known_hosts . delete ( host ) return host end else puts "Error entry non exist: #{host}" end rescue => ee puts "Exception on method #{__method__}: #{ee}" end
Setter to refresh the entry from the cache one at a time
Setter to refresh the entry from the cache one at a time
host
<not_specific>