public class DatabaseReader extends Object implements DatabaseProvider, Closeable
get method.| Modifier and Type | Class and Description |
|---|---|
static class |
DatabaseReader.Builder
Constructs a Builder for the DatabaseReader.
|
| Modifier and Type | Method and Description |
|---|---|
AnonymousIpResponse |
anonymousIp(InetAddress ipAddress)
Look up an IP address in a GeoIP2 Anonymous IP.
|
CityResponse |
city(InetAddress ipAddress) |
void |
close()
Closes the database.
|
ConnectionTypeResponse |
connectionType(InetAddress ipAddress)
Look up an IP address in a GeoIP2 Connection Type database.
|
CountryResponse |
country(InetAddress ipAddress) |
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.
|
com.maxmind.db.Metadata |
getMetadata() |
IspResponse |
isp(InetAddress ipAddress)
Look up an IP address in a GeoIP2 ISP database.
|
public void close()
throws IOException
Closes the database.
If you are using FileMode.MEMORY_MAPPED, this will
not unmap the underlying file due to a limitation in Java's
MappedByteBuffer. It will however set the reference to
the buffer to null, allowing the garbage collector to
collect it.
close in interface Closeableclose in interface AutoCloseableIOException - if an I/O error occurs.public CountryResponse country(InetAddress ipAddress) throws IOException, GeoIp2Exception
country in interface GeoIp2ProvideripAddress - IPv4 or IPv6 address to lookup.IOException - if there is an IO errorGeoIp2Exception - if there is an error looking up the IPpublic CityResponse city(InetAddress ipAddress) throws IOException, GeoIp2Exception
city in interface GeoIp2ProvideripAddress - IPv4 or IPv6 address to lookup.IOException - if there is an IO errorGeoIp2Exception - if there is an error looking up the IPpublic AnonymousIpResponse anonymousIp(InetAddress ipAddress) throws IOException, GeoIp2Exception
anonymousIp in interface DatabaseProvideripAddress - IPv4 or IPv6 address to lookup.GeoIp2Exception - if there is an error looking up the IPIOException - if there is an IO errorpublic ConnectionTypeResponse connectionType(InetAddress ipAddress) throws IOException, GeoIp2Exception
connectionType in interface DatabaseProvideripAddress - IPv4 or IPv6 address to lookup.GeoIp2Exception - if there is an error looking up the IPIOException - if there is an IO errorpublic DomainResponse domain(InetAddress ipAddress) throws IOException, GeoIp2Exception
domain in interface DatabaseProvideripAddress - IPv4 or IPv6 address to lookup.GeoIp2Exception - if there is an error looking up the IPIOException - if there is an IO errorpublic EnterpriseResponse enterprise(InetAddress ipAddress) throws IOException, GeoIp2Exception
enterprise in interface DatabaseProvideripAddress - IPv4 or IPv6 address to lookup.GeoIp2Exception - if there is an error looking up the IPIOException - if there is an IO errorpublic IspResponse isp(InetAddress ipAddress) throws IOException, GeoIp2Exception
isp in interface DatabaseProvideripAddress - IPv4 or IPv6 address to lookup.GeoIp2Exception - if there is an error looking up the IPIOException - if there is an IO errorpublic com.maxmind.db.Metadata getMetadata()
Copyright © 2016 MaxMind, Inc.. All Rights Reserved.