Package com.maxmind.geoip2
Interface DatabaseProvider
- All Superinterfaces:
GeoIp2Provider
- All Known Implementing Classes:
DatabaseReader
-
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.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.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 the IP address 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 the IP address 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 the IP address 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 the IP address 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 the IP address 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 the IP address 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 the IP address 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 lookup or empty if the IP address 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
-