public override WhoIsInformation GetInformationByIp(string ip) { Assert.ArgumentNotNullOrEmpty(ip, "ip"); // Retrieve from cache KickFireGeoIpCache geoIpCache = KickFireGeoIpCacheManager.GeoIpCache; var whoIsInformation = geoIpCache.Get(ip); if (whoIsInformation != null) { return(whoIsInformation); } // Retrieve from Sitecore Provider whoIsInformation = base.GetInformationByIp(ip); // Skip further processing if not in configured country if (!_countries.Any() || _countries.Contains(whoIsInformation.Country)) { // Suppliment with KickFire var company = GetCompany(ip); if (company != null) { // Suppliment with business details whoIsInformation.BusinessName = company.Name; if (company.IsISP == 1) { whoIsInformation.Isp = company.Name; } whoIsInformation.Dns = company.Website; whoIsInformation.Url = company.Website; } } geoIpCache.Add(ip, whoIsInformation); return(whoIsInformation); }
static KickFireGeoIpCacheManager() { _syncLock = new object(); _geoIpCache = new KickFireGeoIpCache(); }