private Record createRecord(final IspResponse isp) { if (isp == null) { return null; } final Map<String, Object> values = new HashMap<>(4); values.put(IspSchema.ASN.getFieldName(), isp.getAutonomousSystemNumber()); values.put(IspSchema.ASN_ORG.getFieldName(), isp.getAutonomousSystemOrganization()); values.put(IspSchema.NAME.getFieldName(), isp.getIsp()); values.put(IspSchema.ORG.getFieldName(), isp.getOrganization()); return new MapRecord(IspSchema.ISP_SCHEMA, values); }
final String ispName = response.getIsp(); if (ispName != null) { attrs.put(new StringBuilder(ipAttributeName).append(".isp.name").toString(), ispName);
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 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; } }
protected void extractIspFields(final Parsable<?> parsable, final String inputname, IspResponse response) throws DissectionFailure { if (wantIspName) { parsable.addDissection(inputname, "STRING", "isp.name", response.getIsp()); } if (wantIspOrganization) { parsable.addDissection(inputname, "STRING", "isp.organization", response.getOrganization()); } }
final String ispName = response.getIsp(); if (ispName != null) { attrs.put(new StringBuilder(ipAttributeName).append(".isp.name").toString(), ispName);
session.setProperty("sessionAdminSubDiv2", cityResponse.getSubdivisions().get(1).getGeoNameId()); String isp = databaseReader.isp(InetAddress.getByName(remoteAddr)).getIsp(); if (isp != null) { session.setProperty("sessionIsp", isp);