private void setIsp(InetAddress address, GenericRecord properties) { IspResponse isp; try { isp = ispLookup.isp(address); } catch (AddressNotFoundException e) { return; } catch (Exception e) { LOGGER.error(e, "Error while searching for location information."); return; } put(properties,"_isp", isp.getIsp()); }
public boolean contains(String key) { try { InetAddress ip = InetAddress.getByName(key); IspResponse r = reader.isp(ip); String test = r.getIsp().toLowerCase(); if (test.contains("hosting")) { return false; } } catch (Exception error) { error.printStackTrace(); } return true; }
public void dissect(final Parsable<?> parsable, final String inputname, final InetAddress ipAddress) throws DissectionFailure { IspResponse response; try { response = reader.isp(ipAddress); } catch (IOException | GeoIp2Exception e) { return; } extractAsnFields(parsable, inputname, response); extractIspFields(parsable, inputname, response); }
public String solve(String key) { String value = null; try { String parts[] = key.split("/"); if (parts.length < 3) return null; String sip = parts[2]; InetAddress ip = InetAddress.getByName(sip); IspResponse r = reader.isp(ip); switch (parts[1]) { case "org": return r.getOrganization(); case "isp": return r.getIsp(); case "json": return r.toJson(); default: return null; } } catch (Exception e) { } return value; } }
forensiqCount.incrementAndGet(); InetAddress ip4 = InetAddress.getByName(ip); IspResponse r = reader.isp(ip4); String test = r.getOrganization().toLowerCase();
session.setProperty("sessionAdminSubDiv2", cityResponse.getSubdivisions().get(1).getGeoNameId()); String isp = databaseReader.isp(InetAddress.getByName(remoteAddr)).getIsp(); if (isp != null) { session.setProperty("sessionIsp", isp);