Package org.localify.common.geoip
Class MaxmindGeoIp
java.lang.Object
org.localify.common.geoip.MaxmindGeoIp
- All Implemented Interfaces:
GeoIpService
An implementation of
GeoIpService that uses the MaxMind GeoIP2 database.-
Constructor Summary
ConstructorsConstructorDescriptionMaxmindGeoIp(com.maxmind.geoip2.DatabaseReader reader) Constructs a new MaxmindGeoIp. -
Method Summary
Modifier and TypeMethodDescriptiongetDetails(String ipAddress, boolean permitFallback) Gets the GeoIP details for a given IP address.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.localify.common.geoip.GeoIpService
getDetails
-
Constructor Details
-
MaxmindGeoIp
public MaxmindGeoIp(com.maxmind.geoip2.DatabaseReader reader) Constructs a new MaxmindGeoIp.- Parameters:
reader- The MaxMind database reader.
-
-
Method Details
-
getDetails
Description copied from interface:GeoIpServiceGets the GeoIP details for a given IP address.- Specified by:
getDetailsin interfaceGeoIpService- Parameters:
ipAddress- The IP address.permitFallback- Whether to permit fallback to a default location if the IP address is not found.- Returns:
- The GeoIP details, or null if not found and fallback is not permitted.
-