com.maxmind.geoip2.model.AsnResponse Java Examples
The following examples show how to use
com.maxmind.geoip2.model.AsnResponse.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GeoIPASNDissector.java From logparser with Apache License 2.0 | 5 votes |
public void dissect(final Parsable<?> parsable, final String inputname, final InetAddress ipAddress) throws DissectionFailure { AsnResponse response; try { response = reader.asn(ipAddress); } catch (IOException | GeoIp2Exception e) { return; } extractAsnFields(parsable, inputname, response); }
Example #2
Source File: GeoIPASNDissector.java From logparser with Apache License 2.0 | 5 votes |
protected void extractAsnFields(final Parsable<?> parsable, final String inputname, AsnResponse response) throws DissectionFailure { if (wantAsnNumber) { parsable.addDissection(inputname, "ASN", "asn.number", response.getAutonomousSystemNumber()); } if (wantAsnOrganization) { parsable.addDissection(inputname, "STRING", "asn.organization", response.getAutonomousSystemOrganization()); } }