com.maxmind.geoip2.model.AnonymousIpResponse Java Examples

The following examples show how to use com.maxmind.geoip2.model.AnonymousIpResponse. 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: IPLookupService.java    From nifi with Apache License 2.0 5 votes vote down vote up
private Record createRecord(final AnonymousIpResponse anonymousIp) {
    if (anonymousIp == null) {
        return null;
    }

    final Map<String, Object> values = new HashMap<>(5);
    values.put(AnonymousIpSchema.ANONYMOUS.getFieldName(), anonymousIp.isAnonymous());
    values.put(AnonymousIpSchema.ANONYMOUS_VPN.getFieldName(), anonymousIp.isAnonymousVpn());
    values.put(AnonymousIpSchema.HOSTING_PROVIDER.getFieldName(), anonymousIp.isHostingProvider());
    values.put(AnonymousIpSchema.PUBLIC_PROXY.getFieldName(), anonymousIp.isPublicProxy());
    values.put(AnonymousIpSchema.TOR_EXIT_NODE.getFieldName(), anonymousIp.isTorExitNode());

    return new MapRecord(AnonymousIpSchema.ANONYMOUS_IP_SCHEMA, values);
}
 
Example #2
Source File: DatabaseReader.java    From localization_nifi with Apache License 2.0 2 votes vote down vote up
/**
 * Look up an IP address in a GeoIP2 Anonymous IP.
 *
 * @param ipAddress IPv4 or IPv6 address to lookup.
 * @return a AnonymousIpResponse for the requested IP address.
 * @throws GeoIp2Exception if there is an error looking up the IP
 * @throws IOException if there is an IO error
 */
public AnonymousIpResponse anonymousIp(InetAddress ipAddress) throws IOException,
        GeoIp2Exception {
    return this.get(ipAddress, AnonymousIpResponse.class, false, "GeoIP2-Anonymous-IP");
}
 
Example #3
Source File: DatabaseReader.java    From nifi with Apache License 2.0 2 votes vote down vote up
/**
 * Look up an IP address in a GeoIP2 Anonymous IP.
 *
 * @param ipAddress IPv4 or IPv6 address to lookup.
 * @return a AnonymousIpResponse for the requested IP address.
 * @throws GeoIp2Exception if there is an error looking up the IP
 * @throws IOException if there is an IO error
 */
public AnonymousIpResponse anonymousIp(InetAddress ipAddress) throws IOException, GeoIp2Exception {
    return this.get(ipAddress, AnonymousIpResponse.class, false, "GeoIP2-Anonymous-IP");
}
 
Example #4
Source File: DatabaseReader.java    From nifi with Apache License 2.0 2 votes vote down vote up
/**
 * Look up an IP address in a GeoIP2 Anonymous IP.
 *
 * @param ipAddress IPv4 or IPv6 address to lookup.
 * @return a AnonymousIpResponse for the requested IP address.
 * @throws IOException if there is an IO error
 */
public AnonymousIpResponse anonymousIp(InetAddress ipAddress) throws IOException {
    return get(ipAddress, AnonymousIpResponse.class, false, "GeoIP2-Anonymous-IP");
}