- All Superinterfaces:
GeoIp2Provider
- All Known Implementing Classes:
DatabaseReader
Interface for GeoIP2 database providers.
-
Method Summary
Modifier and TypeMethodDescriptionanonymousIp
(InetAddress ipAddress) Look up an IP address in a GeoIP2 Anonymous IP.asn
(InetAddress ipAddress) Look up an IP address in a GeoLite2 ASN database.connectionType
(InetAddress ipAddress) Look up an IP address in a GeoIP2 Connection Type database.domain
(InetAddress ipAddress) Look up an IP address in a GeoIP2 Domain database.enterprise
(InetAddress ipAddress) Look up an IP address in a GeoIP2 Enterprise database.ipRisk
(InetAddress ipAddress) Deprecated.This database has been discontinued.isp
(InetAddress ipAddress) Look up an IP address in a GeoIP2 ISP database.tryAnonymousIp
(InetAddress ipAddress) Look up an IP address in a GeoIP2 Anonymous IP.tryAsn
(InetAddress ipAddress) Look up an IP address in a GeoLite2 ASN database.tryCity
(InetAddress ipAddress) tryConnectionType
(InetAddress ipAddress) Look up an IP address in a GeoIP2 Connection Type database.tryCountry
(InetAddress ipAddress) tryDomain
(InetAddress ipAddress) Look up an IP address in a GeoIP2 Domain database.tryEnterprise
(InetAddress ipAddress) Look up an IP address in a GeoIP2 Enterprise database.tryIpRisk
(InetAddress ipAddress) Deprecated.This database has been discontinued.tryIsp
(InetAddress ipAddress) Look up an IP address in a GeoIP2 ISP database.Methods inherited from interface com.maxmind.geoip2.GeoIp2Provider
city, country
-
Method Details
-
tryCountry
- Parameters:
ipAddress
- IPv4 or IPv6 address to lookup.- Returns:
- A Country model for the requested IP address or empty if it is not in the DB.
- Throws:
GeoIp2Exception
- if there is an error looking up the IPIOException
- if there is an IO error
-
tryCity
- Parameters:
ipAddress
- IPv4 or IPv6 address to lookup.- Returns:
- A City model for the requested IP address or empty if it is not in the DB.
- Throws:
GeoIp2Exception
- if there is an error looking up the IPIOException
- if there is an IO error
-
anonymousIp
Look up an IP address in a GeoIP2 Anonymous IP.- Parameters:
ipAddress
- IPv4 or IPv6 address to lookup.- Returns:
- a AnonymousIpResponse for the requested IP address.
- Throws:
GeoIp2Exception
- if there is an error looking up the IPIOException
- if there is an IO error
-
tryAnonymousIp
Optional<AnonymousIpResponse> tryAnonymousIp(InetAddress ipAddress) throws IOException, GeoIp2Exception Look up an IP address in a GeoIP2 Anonymous IP.- Parameters:
ipAddress
- IPv4 or IPv6 address to lookup.- Returns:
- a AnonymousIpResponse for the requested IP address or empty if it is not in the DB.
- Throws:
GeoIp2Exception
- if there is an error looking up the IPIOException
- if there is an IO error
-
ipRisk
Deprecated.This database has been discontinued.Look up an IP address in a GeoIP2 IP Risk database.- Parameters:
ipAddress
- IPv4 or IPv6 address to lookup.- Returns:
- an IpRiskResponse for the requested IP address.
- Throws:
GeoIp2Exception
- if there is an error looking up the IPIOException
- if there is an IO error
-
tryIpRisk
@Deprecated Optional<IpRiskResponse> tryIpRisk(InetAddress ipAddress) throws IOException, GeoIp2Exception Deprecated.This database has been discontinued.Look up an IP address in a GeoIP2 IP Risk database.- Parameters:
ipAddress
- IPv4 or IPv6 address to lookup.- Returns:
- an IPRiskResponse for the requested IP address or empty if it is not in the DB.
- Throws:
GeoIp2Exception
- if there is an error looking up the IPIOException
- if there is an IO error
-
asn
Look up an IP address in a GeoLite2 ASN database.- Parameters:
ipAddress
- IPv4 or IPv6 address to lookup.- Returns:
- an IspResponse for the requested IP address.
- Throws:
GeoIp2Exception
- if there is an error looking up the IPIOException
- if there is an IO error
-
tryAsn
Look up an IP address in a GeoLite2 ASN database.- Parameters:
ipAddress
- IPv4 or IPv6 address to lookup.- Returns:
- an IspResponse for the requested IP address or empty if it is not in the DB.
- Throws:
GeoIp2Exception
- if there is an error looking up the IPIOException
- if there is an IO error
-
connectionType
Look up an IP address in a GeoIP2 Connection Type database.- Parameters:
ipAddress
- IPv4 or IPv6 address to lookup.- Returns:
- a ConnectTypeResponse for the requested IP address.
- Throws:
GeoIp2Exception
- if there is an error looking up the IPIOException
- if there is an IO error
-
tryConnectionType
Optional<ConnectionTypeResponse> tryConnectionType(InetAddress ipAddress) throws IOException, GeoIp2Exception Look up an IP address in a GeoIP2 Connection Type database.- Parameters:
ipAddress
- IPv4 or IPv6 address to lookup.- Returns:
- a ConnectTypeResponse for the requested IP address or empty if it is not in the DB.
- Throws:
GeoIp2Exception
- if there is an error looking up the IPIOException
- if there is an IO error
-
domain
Look up an IP address in a GeoIP2 Domain database.- Parameters:
ipAddress
- IPv4 or IPv6 address to lookup.- Returns:
- a DomainResponse for the requested IP address.
- Throws:
GeoIp2Exception
- if there is an error looking up the IPIOException
- if there is an IO error
-
tryDomain
Look up an IP address in a GeoIP2 Domain database.- Parameters:
ipAddress
- IPv4 or IPv6 address to lookup.- Returns:
- a DomainResponse for the requested IP address or empty if it is not in the DB.
- Throws:
GeoIp2Exception
- if there is an error looking up the IPIOException
- if there is an IO error
-
enterprise
Look up an IP address in a GeoIP2 Enterprise database.- Parameters:
ipAddress
- IPv4 or IPv6 address to lookup.- Returns:
- an EnterpriseResponse for the requested IP address.
- Throws:
GeoIp2Exception
- if there is an error looking up the IPIOException
- if there is an IO error
-
tryEnterprise
Optional<EnterpriseResponse> tryEnterprise(InetAddress ipAddress) throws IOException, GeoIp2Exception Look up an IP address in a GeoIP2 Enterprise database.- Parameters:
ipAddress
- IPv4 or IPv6 address to lookup.- Returns:
- an EnterpriseResponse for the requested IP address or empty if it is not in the DB.
- Throws:
GeoIp2Exception
- if there is an error looking up the IPIOException
- if there is an IO error
-
isp
Look up an IP address in a GeoIP2 ISP database.- Parameters:
ipAddress
- IPv4 or IPv6 address to lookup.- Returns:
- an IspResponse for the requested IP address.
- Throws:
GeoIp2Exception
- if there is an error looking up the IPIOException
- if there is an IO error
-
tryIsp
Look up an IP address in a GeoIP2 ISP database.- Parameters:
ipAddress
- IPv4 or IPv6 address to look up or empty if it is not in the DB.- Returns:
- an IspResponse for the requested IP address.
- Throws:
GeoIp2Exception
- if there is an error looking up the IPIOException
- if there is an IO error
-