Package com.maxmind.geoip2
Interface DatabaseProvider
-
- All Superinterfaces:
GeoIp2Provider
- All Known Implementing Classes:
DatabaseReader
public interface DatabaseProvider extends GeoIp2Provider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AnonymousIpResponse
anonymousIp(InetAddress ipAddress)
Look up an IP address in a GeoIP2 Anonymous IP.AsnResponse
asn(InetAddress ipAddress)
Look up an IP address in a GeoLite2 ASN database.ConnectionTypeResponse
connectionType(InetAddress ipAddress)
Look up an IP address in a GeoIP2 Connection Type database.DomainResponse
domain(InetAddress ipAddress)
Look up an IP address in a GeoIP2 Domain database.EnterpriseResponse
enterprise(InetAddress ipAddress)
Look up an IP address in a GeoIP2 Enterprise database.IspResponse
isp(InetAddress ipAddress)
Look up an IP address in a GeoIP2 ISP database.Optional<AnonymousIpResponse>
tryAnonymousIp(InetAddress ipAddress)
Look up an IP address in a GeoIP2 Anonymous IP.Optional<AsnResponse>
tryAsn(InetAddress ipAddress)
Look up an IP address in a GeoLite2 ASN database.Optional<CityResponse>
tryCity(InetAddress ipAddress)
Optional<ConnectionTypeResponse>
tryConnectionType(InetAddress ipAddress)
Look up an IP address in a GeoIP2 Connection Type database.Optional<CountryResponse>
tryCountry(InetAddress ipAddress)
Optional<DomainResponse>
tryDomain(InetAddress ipAddress)
Look up an IP address in a GeoIP2 Domain database.Optional<EnterpriseResponse>
tryEnterprise(InetAddress ipAddress)
Look up an IP address in a GeoIP2 Enterprise database.Optional<IspResponse>
tryIsp(InetAddress ipAddress)
Look up an IP address in a GeoIP2 ISP database.-
Methods inherited from interface com.maxmind.geoip2.GeoIp2Provider
city, country
-
-
-
-
Method Detail
-
tryCountry
Optional<CountryResponse> tryCountry(InetAddress ipAddress) throws IOException, GeoIp2Exception
- 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
Optional<CityResponse> tryCity(InetAddress ipAddress) throws IOException, GeoIp2Exception
- 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
AnonymousIpResponse anonymousIp(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.
- 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
AsnResponse asn(InetAddress ipAddress) throws IOException, GeoIp2Exception
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
Optional<AsnResponse> tryAsn(InetAddress ipAddress) throws IOException, GeoIp2Exception
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
ConnectionTypeResponse connectionType(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.
- 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
DomainResponse domain(InetAddress ipAddress) throws IOException, GeoIp2Exception
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
Optional<DomainResponse> tryDomain(InetAddress ipAddress) throws IOException, GeoIp2Exception
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
EnterpriseResponse enterprise(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.
- 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
IspResponse isp(InetAddress ipAddress) throws IOException, GeoIp2Exception
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
Optional<IspResponse> tryIsp(InetAddress ipAddress) throws IOException, GeoIp2Exception
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
-
-