@Singleton public class GeoLite2Geolocator extends java.lang.Object implements Geolocator
Geolocator
implementation for MaxMind GeoLite2 database.
This product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com.
Constructor and Description |
---|
GeoLite2Geolocator(PlanFiles files,
PlanConfig config) |
Modifier and Type | Method and Description |
---|---|
java.util.Optional<java.lang.String> |
getCountry(java.net.InetAddress inetAddress) |
void |
prepare()
Do everything that is needed for the geolocator to function.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCountry
@Inject public GeoLite2Geolocator(PlanFiles files, PlanConfig config)
public void prepare() throws java.io.IOException
Geolocator
prepare
in interface Geolocator
java.io.IOException
- If the preparation failsjava.net.UnknownHostException
- If preparation requires internet, but internet is not available.public java.util.Optional<java.lang.String> getCountry(java.net.InetAddress inetAddress)
getCountry
in interface Geolocator