lib/wmap/host_tracker/primary_host.rb
# Procedures to identify primary host-name from the site store redirection URLs. The assumption is that on site redirection, it must be directed to the well known primary site.
Procedures to identify primary host-name from the site store redirection URLs. The assumption is that on site redirection, it must be directed to the well known primary site.
Procedures to identify primary host - name from the site store redirection URLs . The assumption is that on site redirection it must be directed to the well known primary site .
def update_from_site_redirections!
			puts "Invoke internal procedures to update the primary host-name table from the site store."
			begin
				my_tracker=Wmap::SiteTracker.instance
        my_tracker.sites_file=@data_dir + "sites"
        my_tracker.load_site_stores_from_file
        urls = my_tracker.get_redirection_urls
        my_tracker = nil
				urls.map do |url|
					if is_url?(url)
						host=url_2_host(url)
						if is_fqdn?(host)
							ip=host_2_ip(host)
							unless @known_hosts.key?(ip)
								self.add(host)
							end
						end
					end
				end
				self.save!
			rescue Exception => ee
				puts "Exception on method #{__method__}: #{ee}" if @verbose
				return nil
			end
		end
def update_from_site_redirections! puts "Invoke internal procedures to update the primary host-name table from the site store." begin my_tracker = Wmap :: SiteTracker . instance my_tracker . sites_file = @data_dir + "sites" my_tracker . load_site_stores_from_file urls = my_tracker . get_redirection_urls my_tracker = nil urls . map do | url | if is_url? ( url ) host = url_2_host ( url ) if is_fqdn? ( host ) ip = host_2_ip ( host ) unless @known_hosts . key? ( ip ) self . add ( host ) end end end end self . save! rescue Exception => ee puts "Exception on method #{__method__}: #{ee}" if @verbose return nil end end
Procedures to identify primary host-name from the site store redirection URLs.
Procedures to identify primary host - name from the site store redirection URLs .
# Add duplication check